Skip to content

Commit cc014d1

Browse files
author
awstools
committed
feat(client-cloudwatch): This release adds the APIs (PutAlarmMuteRule, ListAlarmMuteRules, GetAlarmMuteRule and DeleteAlarmMuteRule) to manage a new Cloudwatch resource, AlarmMuteRules. AlarmMuteRules allow customers to temporarily mute alarm notifications during expected downtime periods.
1 parent aff0c5e commit cc014d1

17 files changed

+1260
-24
lines changed

clients/client-cloudwatch/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ see LICENSE for more information.
211211

212212
## Client Commands (Operations List)
213213

214+
<details>
215+
<summary>
216+
DeleteAlarmMuteRule
217+
</summary>
218+
219+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch/command/DeleteAlarmMuteRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/DeleteAlarmMuteRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/DeleteAlarmMuteRuleCommandOutput/)
220+
</details>
214221
<details>
215222
<summary>
216223
DeleteAlarms
@@ -318,6 +325,13 @@ EnableInsightRules
318325
</details>
319326
<details>
320327
<summary>
328+
GetAlarmMuteRule
329+
</summary>
330+
331+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch/command/GetAlarmMuteRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/GetAlarmMuteRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/GetAlarmMuteRuleCommandOutput/)
332+
</details>
333+
<details>
334+
<summary>
321335
GetDashboard
322336
</summary>
323337

@@ -360,6 +374,13 @@ GetMetricWidgetImage
360374
</details>
361375
<details>
362376
<summary>
377+
ListAlarmMuteRules
378+
</summary>
379+
380+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch/command/ListAlarmMuteRulesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/ListAlarmMuteRulesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/ListAlarmMuteRulesCommandOutput/)
381+
</details>
382+
<details>
383+
<summary>
363384
ListDashboards
364385
</summary>
365386

@@ -395,6 +416,13 @@ ListTagsForResource
395416
</details>
396417
<details>
397418
<summary>
419+
PutAlarmMuteRule
420+
</summary>
421+
422+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch/command/PutAlarmMuteRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/PutAlarmMuteRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/PutAlarmMuteRuleCommandOutput/)
423+
</details>
424+
<details>
425+
<summary>
398426
PutAnomalyDetector
399427
</summary>
400428

clients/client-cloudwatch/src/CloudWatch.ts

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import type {
99
import type { WaiterResult } from "@smithy/util-waiter";
1010

1111
import { CloudWatchClient } from "./CloudWatchClient";
12+
import {
13+
DeleteAlarmMuteRuleCommand,
14+
DeleteAlarmMuteRuleCommandInput,
15+
DeleteAlarmMuteRuleCommandOutput,
16+
} from "./commands/DeleteAlarmMuteRuleCommand";
1217
import {
1318
DeleteAlarmsCommand,
1419
DeleteAlarmsCommandInput,
@@ -84,6 +89,11 @@ import {
8489
EnableInsightRulesCommandInput,
8590
EnableInsightRulesCommandOutput,
8691
} from "./commands/EnableInsightRulesCommand";
92+
import {
93+
GetAlarmMuteRuleCommand,
94+
GetAlarmMuteRuleCommandInput,
95+
GetAlarmMuteRuleCommandOutput,
96+
} from "./commands/GetAlarmMuteRuleCommand";
8797
import {
8898
GetDashboardCommand,
8999
GetDashboardCommandInput,
@@ -114,6 +124,11 @@ import {
114124
GetMetricWidgetImageCommandInput,
115125
GetMetricWidgetImageCommandOutput,
116126
} from "./commands/GetMetricWidgetImageCommand";
127+
import {
128+
ListAlarmMuteRulesCommand,
129+
ListAlarmMuteRulesCommandInput,
130+
ListAlarmMuteRulesCommandOutput,
131+
} from "./commands/ListAlarmMuteRulesCommand";
117132
import {
118133
ListDashboardsCommand,
119134
ListDashboardsCommandInput,
@@ -135,6 +150,11 @@ import {
135150
ListTagsForResourceCommandInput,
136151
ListTagsForResourceCommandOutput,
137152
} from "./commands/ListTagsForResourceCommand";
153+
import {
154+
PutAlarmMuteRuleCommand,
155+
PutAlarmMuteRuleCommandInput,
156+
PutAlarmMuteRuleCommandOutput,
157+
} from "./commands/PutAlarmMuteRuleCommand";
138158
import {
139159
PutAnomalyDetectorCommand,
140160
PutAnomalyDetectorCommandInput,
@@ -201,14 +221,17 @@ import { paginateDescribeAlarms } from "./pagination/DescribeAlarmsPaginator";
201221
import { paginateDescribeAnomalyDetectors } from "./pagination/DescribeAnomalyDetectorsPaginator";
202222
import { paginateDescribeInsightRules } from "./pagination/DescribeInsightRulesPaginator";
203223
import { paginateGetMetricData } from "./pagination/GetMetricDataPaginator";
224+
import { paginateListAlarmMuteRules } from "./pagination/ListAlarmMuteRulesPaginator";
204225
import { paginateListDashboards } from "./pagination/ListDashboardsPaginator";
205226
import { paginateListManagedInsightRules } from "./pagination/ListManagedInsightRulesPaginator";
206227
import { paginateListMetrics } from "./pagination/ListMetricsPaginator";
207228
import { paginateListMetricStreams } from "./pagination/ListMetricStreamsPaginator";
208229
import { waitUntilAlarmExists } from "./waiters/waitForAlarmExists";
230+
import { waitUntilAlarmMuteRuleExists } from "./waiters/waitForAlarmMuteRuleExists";
209231
import { waitUntilCompositeAlarmExists } from "./waiters/waitForCompositeAlarmExists";
210232

211233
const commands = {
234+
DeleteAlarmMuteRuleCommand,
212235
DeleteAlarmsCommand,
213236
DeleteAnomalyDetectorCommand,
214237
DeleteDashboardsCommand,
@@ -224,17 +247,20 @@ const commands = {
224247
DisableInsightRulesCommand,
225248
EnableAlarmActionsCommand,
226249
EnableInsightRulesCommand,
250+
GetAlarmMuteRuleCommand,
227251
GetDashboardCommand,
228252
GetInsightRuleReportCommand,
229253
GetMetricDataCommand,
230254
GetMetricStatisticsCommand,
231255
GetMetricStreamCommand,
232256
GetMetricWidgetImageCommand,
257+
ListAlarmMuteRulesCommand,
233258
ListDashboardsCommand,
234259
ListManagedInsightRulesCommand,
235260
ListMetricsCommand,
236261
ListMetricStreamsCommand,
237262
ListTagsForResourceCommand,
263+
PutAlarmMuteRuleCommand,
238264
PutAnomalyDetectorCommand,
239265
PutCompositeAlarmCommand,
240266
PutDashboardCommand,
@@ -255,6 +281,7 @@ const paginators = {
255281
paginateDescribeAnomalyDetectors,
256282
paginateDescribeInsightRules,
257283
paginateGetMetricData,
284+
paginateListAlarmMuteRules,
258285
paginateListDashboards,
259286
paginateListManagedInsightRules,
260287
paginateListMetrics,
@@ -263,9 +290,27 @@ const paginators = {
263290
const waiters = {
264291
waitUntilAlarmExists,
265292
waitUntilCompositeAlarmExists,
293+
waitUntilAlarmMuteRuleExists,
266294
};
267295

268296
export interface CloudWatch {
297+
/**
298+
* @see {@link DeleteAlarmMuteRuleCommand}
299+
*/
300+
deleteAlarmMuteRule(
301+
args: DeleteAlarmMuteRuleCommandInput,
302+
options?: __HttpHandlerOptions
303+
): Promise<DeleteAlarmMuteRuleCommandOutput>;
304+
deleteAlarmMuteRule(
305+
args: DeleteAlarmMuteRuleCommandInput,
306+
cb: (err: any, data?: DeleteAlarmMuteRuleCommandOutput) => void
307+
): void;
308+
deleteAlarmMuteRule(
309+
args: DeleteAlarmMuteRuleCommandInput,
310+
options: __HttpHandlerOptions,
311+
cb: (err: any, data?: DeleteAlarmMuteRuleCommandOutput) => void
312+
): void;
313+
269314
/**
270315
* @see {@link DeleteAlarmsCommand}
271316
*/
@@ -526,6 +571,23 @@ export interface CloudWatch {
526571
cb: (err: any, data?: EnableInsightRulesCommandOutput) => void
527572
): void;
528573

574+
/**
575+
* @see {@link GetAlarmMuteRuleCommand}
576+
*/
577+
getAlarmMuteRule(
578+
args: GetAlarmMuteRuleCommandInput,
579+
options?: __HttpHandlerOptions
580+
): Promise<GetAlarmMuteRuleCommandOutput>;
581+
getAlarmMuteRule(
582+
args: GetAlarmMuteRuleCommandInput,
583+
cb: (err: any, data?: GetAlarmMuteRuleCommandOutput) => void
584+
): void;
585+
getAlarmMuteRule(
586+
args: GetAlarmMuteRuleCommandInput,
587+
options: __HttpHandlerOptions,
588+
cb: (err: any, data?: GetAlarmMuteRuleCommandOutput) => void
589+
): void;
590+
529591
/**
530592
* @see {@link GetDashboardCommand}
531593
*/
@@ -628,6 +690,24 @@ export interface CloudWatch {
628690
cb: (err: any, data?: GetMetricWidgetImageCommandOutput) => void
629691
): void;
630692

693+
/**
694+
* @see {@link ListAlarmMuteRulesCommand}
695+
*/
696+
listAlarmMuteRules(): Promise<ListAlarmMuteRulesCommandOutput>;
697+
listAlarmMuteRules(
698+
args: ListAlarmMuteRulesCommandInput,
699+
options?: __HttpHandlerOptions
700+
): Promise<ListAlarmMuteRulesCommandOutput>;
701+
listAlarmMuteRules(
702+
args: ListAlarmMuteRulesCommandInput,
703+
cb: (err: any, data?: ListAlarmMuteRulesCommandOutput) => void
704+
): void;
705+
listAlarmMuteRules(
706+
args: ListAlarmMuteRulesCommandInput,
707+
options: __HttpHandlerOptions,
708+
cb: (err: any, data?: ListAlarmMuteRulesCommandOutput) => void
709+
): void;
710+
631711
/**
632712
* @see {@link ListDashboardsCommand}
633713
*/
@@ -716,6 +796,23 @@ export interface CloudWatch {
716796
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
717797
): void;
718798

799+
/**
800+
* @see {@link PutAlarmMuteRuleCommand}
801+
*/
802+
putAlarmMuteRule(
803+
args: PutAlarmMuteRuleCommandInput,
804+
options?: __HttpHandlerOptions
805+
): Promise<PutAlarmMuteRuleCommandOutput>;
806+
putAlarmMuteRule(
807+
args: PutAlarmMuteRuleCommandInput,
808+
cb: (err: any, data?: PutAlarmMuteRuleCommandOutput) => void
809+
): void;
810+
putAlarmMuteRule(
811+
args: PutAlarmMuteRuleCommandInput,
812+
options: __HttpHandlerOptions,
813+
cb: (err: any, data?: PutAlarmMuteRuleCommandOutput) => void
814+
): void;
815+
719816
/**
720817
* @see {@link PutAnomalyDetectorCommand}
721818
*/
@@ -993,6 +1090,17 @@ export interface CloudWatch {
9931090
paginationConfig?: Omit<PaginationConfiguration, "client">
9941091
): Paginator<GetMetricDataCommandOutput>;
9951092

1093+
/**
1094+
* @see {@link ListAlarmMuteRulesCommand}
1095+
* @param args - command input.
1096+
* @param paginationConfig - optional pagination config.
1097+
* @returns AsyncIterable of {@link ListAlarmMuteRulesCommandOutput}.
1098+
*/
1099+
paginateListAlarmMuteRules(
1100+
args?: ListAlarmMuteRulesCommandInput,
1101+
paginationConfig?: Omit<PaginationConfiguration, "client">
1102+
): Paginator<ListAlarmMuteRulesCommandOutput>;
1103+
9961104
/**
9971105
* @see {@link ListDashboardsCommand}
9981106
* @param args - command input.
@@ -1056,6 +1164,16 @@ export interface CloudWatch {
10561164
args: DescribeAlarmsCommandInput,
10571165
waiterConfig: number | Omit<WaiterConfiguration<CloudWatch>, "client">
10581166
): Promise<WaiterResult>;
1167+
1168+
/**
1169+
* @see {@link GetAlarmMuteRuleCommand}
1170+
* @param args - command input.
1171+
* @param waiterConfig - `maxWaitTime` in seconds or waiter config object.
1172+
*/
1173+
waitUntilAlarmMuteRuleExists(
1174+
args: GetAlarmMuteRuleCommandInput,
1175+
waiterConfig: number | Omit<WaiterConfiguration<CloudWatch>, "client">
1176+
): Promise<WaiterResult>;
10591177
}
10601178

10611179
/**

clients/client-cloudwatch/src/CloudWatchClient.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ import {
6868
defaultCloudWatchHttpAuthSchemeParametersProvider,
6969
resolveHttpAuthSchemeConfig,
7070
} from "./auth/httpAuthSchemeProvider";
71+
import {
72+
DeleteAlarmMuteRuleCommandInput,
73+
DeleteAlarmMuteRuleCommandOutput,
74+
} from "./commands/DeleteAlarmMuteRuleCommand";
7175
import { DeleteAlarmsCommandInput, DeleteAlarmsCommandOutput } from "./commands/DeleteAlarmsCommand";
7276
import {
7377
DeleteAnomalyDetectorCommandInput,
@@ -107,6 +111,7 @@ import {
107111
} from "./commands/DisableInsightRulesCommand";
108112
import { EnableAlarmActionsCommandInput, EnableAlarmActionsCommandOutput } from "./commands/EnableAlarmActionsCommand";
109113
import { EnableInsightRulesCommandInput, EnableInsightRulesCommandOutput } from "./commands/EnableInsightRulesCommand";
114+
import { GetAlarmMuteRuleCommandInput, GetAlarmMuteRuleCommandOutput } from "./commands/GetAlarmMuteRuleCommand";
110115
import { GetDashboardCommandInput, GetDashboardCommandOutput } from "./commands/GetDashboardCommand";
111116
import {
112117
GetInsightRuleReportCommandInput,
@@ -122,6 +127,7 @@ import {
122127
GetMetricWidgetImageCommandInput,
123128
GetMetricWidgetImageCommandOutput,
124129
} from "./commands/GetMetricWidgetImageCommand";
130+
import { ListAlarmMuteRulesCommandInput, ListAlarmMuteRulesCommandOutput } from "./commands/ListAlarmMuteRulesCommand";
125131
import { ListDashboardsCommandInput, ListDashboardsCommandOutput } from "./commands/ListDashboardsCommand";
126132
import {
127133
ListManagedInsightRulesCommandInput,
@@ -133,6 +139,7 @@ import {
133139
ListTagsForResourceCommandInput,
134140
ListTagsForResourceCommandOutput,
135141
} from "./commands/ListTagsForResourceCommand";
142+
import { PutAlarmMuteRuleCommandInput, PutAlarmMuteRuleCommandOutput } from "./commands/PutAlarmMuteRuleCommand";
136143
import { PutAnomalyDetectorCommandInput, PutAnomalyDetectorCommandOutput } from "./commands/PutAnomalyDetectorCommand";
137144
import { PutCompositeAlarmCommandInput, PutCompositeAlarmCommandOutput } from "./commands/PutCompositeAlarmCommand";
138145
import { PutDashboardCommandInput, PutDashboardCommandOutput } from "./commands/PutDashboardCommand";
@@ -164,6 +171,7 @@ export { __Client };
164171
* @public
165172
*/
166173
export type ServiceInputTypes =
174+
| DeleteAlarmMuteRuleCommandInput
167175
| DeleteAlarmsCommandInput
168176
| DeleteAnomalyDetectorCommandInput
169177
| DeleteDashboardsCommandInput
@@ -179,17 +187,20 @@ export type ServiceInputTypes =
179187
| DisableInsightRulesCommandInput
180188
| EnableAlarmActionsCommandInput
181189
| EnableInsightRulesCommandInput
190+
| GetAlarmMuteRuleCommandInput
182191
| GetDashboardCommandInput
183192
| GetInsightRuleReportCommandInput
184193
| GetMetricDataCommandInput
185194
| GetMetricStatisticsCommandInput
186195
| GetMetricStreamCommandInput
187196
| GetMetricWidgetImageCommandInput
197+
| ListAlarmMuteRulesCommandInput
188198
| ListDashboardsCommandInput
189199
| ListManagedInsightRulesCommandInput
190200
| ListMetricStreamsCommandInput
191201
| ListMetricsCommandInput
192202
| ListTagsForResourceCommandInput
203+
| PutAlarmMuteRuleCommandInput
193204
| PutAnomalyDetectorCommandInput
194205
| PutCompositeAlarmCommandInput
195206
| PutDashboardCommandInput
@@ -208,6 +219,7 @@ export type ServiceInputTypes =
208219
* @public
209220
*/
210221
export type ServiceOutputTypes =
222+
| DeleteAlarmMuteRuleCommandOutput
211223
| DeleteAlarmsCommandOutput
212224
| DeleteAnomalyDetectorCommandOutput
213225
| DeleteDashboardsCommandOutput
@@ -223,17 +235,20 @@ export type ServiceOutputTypes =
223235
| DisableInsightRulesCommandOutput
224236
| EnableAlarmActionsCommandOutput
225237
| EnableInsightRulesCommandOutput
238+
| GetAlarmMuteRuleCommandOutput
226239
| GetDashboardCommandOutput
227240
| GetInsightRuleReportCommandOutput
228241
| GetMetricDataCommandOutput
229242
| GetMetricStatisticsCommandOutput
230243
| GetMetricStreamCommandOutput
231244
| GetMetricWidgetImageCommandOutput
245+
| ListAlarmMuteRulesCommandOutput
232246
| ListDashboardsCommandOutput
233247
| ListManagedInsightRulesCommandOutput
234248
| ListMetricStreamsCommandOutput
235249
| ListMetricsCommandOutput
236250
| ListTagsForResourceCommandOutput
251+
| PutAlarmMuteRuleCommandOutput
237252
| PutAnomalyDetectorCommandOutput
238253
| PutCompositeAlarmCommandOutput
239254
| PutDashboardCommandOutput

0 commit comments

Comments
 (0)