Skip to content

Commit fb478aa

Browse files
author
awstools
committed
feat(client-internetmonitor): This release adds a new feature for Amazon CloudWatch Internet Monitor that enables customers to set custom thresholds, for performance and availability drops, for triggering when to create a health event.
1 parent a3ee38f commit fb478aa

File tree

8 files changed

+152
-0
lines changed

8 files changed

+152
-0
lines changed

clients/client-internetmonitor/src/commands/CreateMonitorCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ export interface CreateMonitorCommandOutput extends CreateMonitorOutput, __Metad
6767
* },
6868
* },
6969
* TrafficPercentageToMonitor: Number("int"),
70+
* HealthEventsConfig: { // HealthEventsConfig
71+
* AvailabilityScoreThreshold: Number("double"),
72+
* PerformanceScoreThreshold: Number("double"),
73+
* },
7074
* };
7175
* const command = new CreateMonitorCommand(input);
7276
* const response = await client.send(command);

clients/client-internetmonitor/src/commands/GetHealthEventCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export interface GetHealthEventCommandOutput extends GetHealthEventOutput, __Met
111111
* // Status: "STRING_VALUE", // required
112112
* // PercentOfTotalTrafficImpacted: Number("double"),
113113
* // ImpactType: "STRING_VALUE", // required
114+
* // HealthScoreThreshold: Number("double"),
114115
* // };
115116
*
116117
* ```

clients/client-internetmonitor/src/commands/GetMonitorCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export interface GetMonitorCommandOutput extends GetMonitorOutput, __MetadataBea
7272
* // },
7373
* // },
7474
* // TrafficPercentageToMonitor: Number("int"),
75+
* // HealthEventsConfig: { // HealthEventsConfig
76+
* // AvailabilityScoreThreshold: Number("double"),
77+
* // PerformanceScoreThreshold: Number("double"),
78+
* // },
7579
* // };
7680
*
7781
* ```

clients/client-internetmonitor/src/commands/ListHealthEventsCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export interface ListHealthEventsCommandOutput extends ListHealthEventsOutput, _
117117
* // Status: "STRING_VALUE", // required
118118
* // PercentOfTotalTrafficImpacted: Number("double"),
119119
* // ImpactType: "STRING_VALUE", // required
120+
* // HealthScoreThreshold: Number("double"),
120121
* // },
121122
* // ],
122123
* // NextToken: "STRING_VALUE",

clients/client-internetmonitor/src/commands/UpdateMonitorCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export interface UpdateMonitorCommandOutput extends UpdateMonitorOutput, __Metad
6666
* },
6767
* },
6868
* TrafficPercentageToMonitor: Number("int"),
69+
* HealthEventsConfig: { // HealthEventsConfig
70+
* AvailabilityScoreThreshold: Number("double"),
71+
* PerformanceScoreThreshold: Number("double"),
72+
* },
6973
* };
7074
* const command = new UpdateMonitorCommand(input);
7175
* const response = await client.send(command);

clients/client-internetmonitor/src/models/models_0.ts

+47
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ export class ConflictException extends __BaseException {
100100
}
101101
}
102102

103+
/**
104+
* @public
105+
* <p>A complex type for the configuration. Defines the health event threshold percentages, for performance score and availability score. Amazon CloudWatch Internet Monitor creates a health event when
106+
* there's an internet issue that affects your application end users where a health score percentage is at or below a set threshold. If you
107+
* don't set a health event threshold, the default value is 95%.</p>
108+
*/
109+
export interface HealthEventsConfig {
110+
/**
111+
* <p>The health event threshold percentage set for availability scores.</p>
112+
*/
113+
AvailabilityScoreThreshold?: number;
114+
115+
/**
116+
* <p>The health event threshold percentage set for performance scores.</p>
117+
*/
118+
PerformanceScoreThreshold?: number;
119+
}
120+
103121
/**
104122
* @public
105123
* @enum
@@ -197,6 +215,13 @@ export interface CreateMonitorInput {
197215
* <p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.</p>
198216
*/
199217
TrafficPercentageToMonitor?: number;
218+
219+
/**
220+
* <p>Defines the health event threshold percentages, for performance score and availability score. Internet Monitor creates a health event when
221+
* there's an internet issue that affects your application end users where a health score percentage is at or below a set threshold. If you
222+
* don't set a health event threshold, the default calue is 95%.</p>
223+
*/
224+
HealthEventsConfig?: HealthEventsConfig;
200225
}
201226

202227
/**
@@ -658,6 +683,11 @@ export interface GetHealthEventOutput {
658683
* <p>The type of impairment of a specific health event.</p>
659684
*/
660685
ImpactType: HealthEventImpactType | string | undefined;
686+
687+
/**
688+
* <p>The threshold percentage for health events when Amazon CloudWatch Internet Monitor creates a health event.</p>
689+
*/
690+
HealthScoreThreshold?: number;
661691
}
662692

663693
/**
@@ -755,6 +785,12 @@ export interface GetMonitorOutput {
755785
* <p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.</p>
756786
*/
757787
TrafficPercentageToMonitor?: number;
788+
789+
/**
790+
* <p>The list of health event thresholds. A health event threshold percentage, for performance and availability, determines the level
791+
* of impact at which Amazon CloudWatch Internet Monitor creates a health event when there's an internet issue that affects your application end users.</p>
792+
*/
793+
HealthEventsConfig?: HealthEventsConfig;
758794
}
759795

760796
/**
@@ -811,6 +847,11 @@ export interface HealthEvent {
811847
* <p>The type of impairment for a health event.</p>
812848
*/
813849
ImpactType: HealthEventImpactType | string | undefined;
850+
851+
/**
852+
* <p>The value of the threshold percentage for performance or availability that was configured when Amazon CloudWatch Internet Monitor created the health event.</p>
853+
*/
854+
HealthScoreThreshold?: number;
814855
}
815856

816857
/**
@@ -1083,6 +1124,12 @@ export interface UpdateMonitorInput {
10831124
* <p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.</p>
10841125
*/
10851126
TrafficPercentageToMonitor?: number;
1127+
1128+
/**
1129+
* <p>The list of health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates
1130+
* a health event when there's an internet issue that affects your application end users.</p>
1131+
*/
1132+
HealthEventsConfig?: HealthEventsConfig;
10861133
}
10871134

10881135
/**

clients/client-internetmonitor/src/protocols/Aws_restJson1.ts

+27
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
map,
1414
parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset,
1515
resolvedPath as __resolvedPath,
16+
serializeFloat as __serializeFloat,
1617
take,
1718
withBaseException,
1819
} from "@aws-sdk/smithy-client";
@@ -41,6 +42,7 @@ import {
4142
BadRequestException,
4243
ConflictException,
4344
HealthEvent,
45+
HealthEventsConfig,
4446
ImpactedLocation,
4547
InternalServerErrorException,
4648
InternalServerException,
@@ -73,6 +75,7 @@ export const se_CreateMonitorCommand = async (
7375
body = JSON.stringify(
7476
take(input, {
7577
ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
78+
HealthEventsConfig: (_) => se_HealthEventsConfig(_, context),
7679
InternetMeasurementsLogDelivery: (_) => _json(_),
7780
MaxCityNetworksToMonitor: [],
7881
MonitorName: [],
@@ -331,6 +334,7 @@ export const se_UpdateMonitorCommand = async (
331334
body = JSON.stringify(
332335
take(input, {
333336
ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
337+
HealthEventsConfig: (_) => se_HealthEventsConfig(_, context),
334338
InternetMeasurementsLogDelivery: (_) => _json(_),
335339
MaxCityNetworksToMonitor: [],
336340
ResourcesToAdd: (_) => _json(_),
@@ -484,6 +488,7 @@ export const de_GetHealthEventCommand = async (
484488
EndedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
485489
EventArn: __expectString,
486490
EventId: __expectString,
491+
HealthScoreThreshold: __limitedParseDouble,
487492
ImpactType: __expectString,
488493
ImpactedLocations: (_) => de_ImpactedLocationsList(_, context),
489494
LastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
@@ -546,6 +551,7 @@ export const de_GetMonitorCommand = async (
546551
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
547552
const doc = take(data, {
548553
CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
554+
HealthEventsConfig: (_) => de_HealthEventsConfig(_, context),
549555
InternetMeasurementsLogDelivery: _json,
550556
MaxCityNetworksToMonitor: __expectInt32,
551557
ModifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
@@ -1149,6 +1155,16 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
11491155
return __decorateServiceException(exception, parsedOutput.body);
11501156
};
11511157

1158+
/**
1159+
* serializeAws_restJson1HealthEventsConfig
1160+
*/
1161+
const se_HealthEventsConfig = (input: HealthEventsConfig, context: __SerdeContext): any => {
1162+
return take(input, {
1163+
AvailabilityScoreThreshold: __serializeFloat,
1164+
PerformanceScoreThreshold: __serializeFloat,
1165+
});
1166+
};
1167+
11521168
// se_InternetMeasurementsLogDelivery omitted.
11531169

11541170
// se_S3Config omitted.
@@ -1177,6 +1193,7 @@ const de_HealthEvent = (output: any, context: __SerdeContext): HealthEvent => {
11771193
EndedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
11781194
EventArn: __expectString,
11791195
EventId: __expectString,
1196+
HealthScoreThreshold: __limitedParseDouble,
11801197
ImpactType: __expectString,
11811198
ImpactedLocations: (_: any) => de_ImpactedLocationsList(_, context),
11821199
LastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
@@ -1198,6 +1215,16 @@ const de_HealthEventList = (output: any, context: __SerdeContext): HealthEvent[]
11981215
return retVal;
11991216
};
12001217

1218+
/**
1219+
* deserializeAws_restJson1HealthEventsConfig
1220+
*/
1221+
const de_HealthEventsConfig = (output: any, context: __SerdeContext): HealthEventsConfig => {
1222+
return take(output, {
1223+
AvailabilityScoreThreshold: __limitedParseDouble,
1224+
PerformanceScoreThreshold: __limitedParseDouble,
1225+
}) as any;
1226+
};
1227+
12011228
/**
12021229
* deserializeAws_restJson1ImpactedLocation
12031230
*/

codegen/sdk-codegen/aws-models/internetmonitor.json

+64
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@
162162
"smithy.api#default": 0,
163163
"smithy.api#documentation": "<p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.</p>"
164164
}
165+
},
166+
"HealthEventsConfig": {
167+
"target": "com.amazonaws.internetmonitor#HealthEventsConfig",
168+
"traits": {
169+
"smithy.api#documentation": "<p>Defines the health event threshold percentages, for performance score and availability score. Internet Monitor creates a health event when \n\t\t\tthere's an internet issue that affects your application end users where a health score percentage is at or below a set threshold. If you \n\t\t\tdon't set a health event threshold, the default calue is 95%.</p>"
170+
}
165171
}
166172
}
167173
},
@@ -357,6 +363,13 @@
357363
"smithy.api#documentation": "<p>The type of impairment of a specific health event.</p>",
358364
"smithy.api#required": {}
359365
}
366+
},
367+
"HealthScoreThreshold": {
368+
"target": "com.amazonaws.internetmonitor#Percentage",
369+
"traits": {
370+
"smithy.api#default": 0,
371+
"smithy.api#documentation": "<p>The threshold percentage for health events when Amazon CloudWatch Internet Monitor creates a health event.</p>"
372+
}
360373
}
361374
}
362375
},
@@ -488,6 +501,12 @@
488501
"smithy.api#default": 0,
489502
"smithy.api#documentation": "<p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.</p>"
490503
}
504+
},
505+
"HealthEventsConfig": {
506+
"target": "com.amazonaws.internetmonitor#HealthEventsConfig",
507+
"traits": {
508+
"smithy.api#documentation": "<p>The list of health event thresholds. A health event threshold percentage, for performance and availability, determines the level\n\t\t\tof impact at which Amazon CloudWatch Internet Monitor creates a health event when there's an internet issue that affects your application end users.</p>"
509+
}
491510
}
492511
}
493512
},
@@ -564,6 +583,13 @@
564583
"smithy.api#documentation": "<p>The type of impairment for a health event.</p>",
565584
"smithy.api#required": {}
566585
}
586+
},
587+
"HealthScoreThreshold": {
588+
"target": "com.amazonaws.internetmonitor#Percentage",
589+
"traits": {
590+
"smithy.api#default": 0,
591+
"smithy.api#documentation": "<p>The value of the threshold percentage for performance or availability that was configured when Amazon CloudWatch Internet Monitor created the health event.</p>"
592+
}
567593
}
568594
},
569595
"traits": {
@@ -639,6 +665,28 @@
639665
]
640666
}
641667
},
668+
"com.amazonaws.internetmonitor#HealthEventsConfig": {
669+
"type": "structure",
670+
"members": {
671+
"AvailabilityScoreThreshold": {
672+
"target": "com.amazonaws.internetmonitor#Percentage",
673+
"traits": {
674+
"smithy.api#default": 0,
675+
"smithy.api#documentation": "<p>The health event threshold percentage set for availability scores.</p>"
676+
}
677+
},
678+
"PerformanceScoreThreshold": {
679+
"target": "com.amazonaws.internetmonitor#Percentage",
680+
"traits": {
681+
"smithy.api#default": 0,
682+
"smithy.api#documentation": "<p>The health event threshold percentage set for performance scores.</p>"
683+
}
684+
}
685+
},
686+
"traits": {
687+
"smithy.api#documentation": "<p>A complex type for the configuration. Defines the health event threshold percentages, for performance score and availability score. Amazon CloudWatch Internet Monitor creates a health event when \n\t\t\tthere's an internet issue that affects your application end users where a health score percentage is at or below a set threshold. If you \n\t\t\tdon't set a health event threshold, the default value is 95%.</p>"
688+
}
689+
},
642690
"com.amazonaws.internetmonitor#ImpactedLocation": {
643691
"type": "structure",
644692
"members": {
@@ -1771,6 +1819,16 @@
17711819
"smithy.api#httpError": 404
17721820
}
17731821
},
1822+
"com.amazonaws.internetmonitor#Percentage": {
1823+
"type": "double",
1824+
"traits": {
1825+
"smithy.api#default": 0,
1826+
"smithy.api#range": {
1827+
"min": 0,
1828+
"max": 100
1829+
}
1830+
}
1831+
},
17741832
"com.amazonaws.internetmonitor#PerformanceMeasurement": {
17751833
"type": "structure",
17761834
"members": {
@@ -2224,6 +2282,12 @@
22242282
"smithy.api#default": 0,
22252283
"smithy.api#documentation": "<p>The percentage of the internet-facing traffic for your application that you want to monitor with this monitor.</p>"
22262284
}
2285+
},
2286+
"HealthEventsConfig": {
2287+
"target": "com.amazonaws.internetmonitor#HealthEventsConfig",
2288+
"traits": {
2289+
"smithy.api#documentation": "<p>The list of health event thresholds. A health event threshold percentage, for performance and availability, determines when Internet Monitor creates \n\t\t\ta health event when there's an internet issue that affects your application end users.</p>"
2290+
}
22272291
}
22282292
}
22292293
},

0 commit comments

Comments
 (0)