Skip to content

Commit

Permalink
feat(client-cloudwatch): Adding support for the suppression of Compos…
Browse files Browse the repository at this point in the history
…ite Alarm actions
  • Loading branch information
awstools committed Jul 21, 2022
1 parent 972d020 commit e94c855
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 2 deletions.
161 changes: 160 additions & 1 deletion clients/client-cloudwatch/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-cl

import { CloudWatchServiceException as __BaseException } from "./CloudWatchServiceException";

export enum ActionsSuppressedBy {
Alarm = "Alarm",
ExtensionPeriod = "ExtensionPeriod",
WaitPeriod = "WaitPeriod",
}

export type AlarmType = "CompositeAlarm" | "MetricAlarm";

export type HistoryItemType = "Action" | "ConfigurationUpdate" | "StateUpdate";
Expand Down Expand Up @@ -606,14 +612,115 @@ export interface CompositeAlarm {
StateReasonData?: string;

/**
* <p>The time stamp of the last update to the alarm state.</p>
* <p>Tracks the timestamp of any state update, even if <code>StateValue</code> doesn't change.</p>
*/
StateUpdatedTimestamp?: Date;

/**
* <p>The state value for the alarm.</p>
*/
StateValue?: StateValue | string;

/**
* <p>
* The timestamp
* of the last change
* to the alarm's <code>StateValue</code>.
* </p>
*/
StateTransitionedTimestamp?: Date;

/**
* <p>
* When the value is <code>ALARM</code>,
* it means
* that the actions are suppressed
* because the suppressor alarm is
* in <code>ALARM</code>
* When the value is <code>WaitPeriod</code>,
* it means that
* the actions are suppressed
* because the composite alarm is waiting
* for the suppressor alarm
* to go
* into
* into the <code>ALARM</code> state.
* The maximum waiting time is as specified
* in <code>ActionsSuppressorWaitPeriod</code>.
* After this time,
* the composite alarm performs its actions.
* When the value is <code>ExtensionPeriod</code>,
* it means
* that the actions are suppressed
* because the composite alarm is waiting
* after the suppressor alarm went out
* of the <code>ALARM</code> state.
* The maximum waiting time is as specified
* in <code>ActionsSuppressorExtensionPeriod</code>.
* After this time,
* the composite alarm performs its actions.
* </p>
*/
ActionsSuppressedBy?: ActionsSuppressedBy | string;

/**
* <p>
* Captures the reason for action suppression.
* </p>
*/
ActionsSuppressedReason?: string;

/**
* <p>
* Actions will be suppressed
* if the suppressor alarm is
* in the <code>ALARM</code> state.
* <code>ActionsSuppressor</code> can be an AlarmName or an Amazon Resource Name (ARN)
* from an existing alarm.
* </p>
*/
ActionsSuppressor?: string;

/**
* <p>
* The maximum time
* in seconds
* that the composite alarm waits
* for the suppressor alarm
* to go
* into the <code>ALARM</code> state.
* After this time,
* the composite alarm performs its actions.
* </p>
* <important>
* <p>
* <code>WaitPeriod</code>
* is required only
* when <code>ActionsSuppressor</code> is specified.
* </p>
* </important>
*/
ActionsSuppressorWaitPeriod?: number;

/**
* <p>
* The maximum time
* in seconds
* that the composite alarm waits
* after suppressor alarm goes out
* of the <code>ALARM</code> state.
* After this time,
* the composite alarm performs its actions.
* </p>
* <important>
* <p>
* <code>ExtensionPeriod</code>
* is required only
* when <code>ActionsSuppressor</code> is specified.
* </p>
* </important>
*/
ActionsSuppressorExtensionPeriod?: number;
}

export namespace CompositeAlarm {
Expand Down Expand Up @@ -3398,6 +3505,58 @@ export interface PutCompositeAlarmInput {
* certain tag values.</p>
*/
Tags?: Tag[];

/**
* <p>
* Actions will be suppressed
* if the suppressor alarm is
* in the <code>ALARM</code> state.
* <code>ActionsSuppressor</code> can be an AlarmName or an Amazon Resource Name (ARN)
* from an existing alarm.
* </p>
*/
ActionsSuppressor?: string;

/**
* <p>
* The maximum time
* in seconds
* that the composite alarm waits
* for the suppressor alarm
* to go
* into the <code>ALARM</code> state.
* After this time,
* the composite alarm performs its actions.
* </p>
* <important>
* <p>
* <code>WaitPeriod</code>
* is required only
* when <code>ActionsSuppressor</code> is specified.
* </p>
* </important>
*/
ActionsSuppressorWaitPeriod?: number;

/**
* <p>
* The maximum time
* in seconds
* that the composite alarm waits
* after suppressor alarm goes out
* of the <code>ALARM</code> state.
* After this time,
* the composite alarm performs its actions.
* </p>
* <important>
* <p>
* <code>ExtensionPeriod</code>
* is required only
* when <code>ActionsSuppressor</code> is specified.
* </p>
* </important>
*/
ActionsSuppressorExtensionPeriod?: number;
}

export namespace PutCompositeAlarmInput {
Expand Down
35 changes: 35 additions & 0 deletions clients/client-cloudwatch/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3741,6 +3741,15 @@ const serializeAws_queryPutCompositeAlarmInput = (input: PutCompositeAlarmInput,
entries[loc] = value;
});
}
if (input.ActionsSuppressor !== undefined && input.ActionsSuppressor !== null) {
entries["ActionsSuppressor"] = input.ActionsSuppressor;
}
if (input.ActionsSuppressorWaitPeriod !== undefined && input.ActionsSuppressorWaitPeriod !== null) {
entries["ActionsSuppressorWaitPeriod"] = input.ActionsSuppressorWaitPeriod;
}
if (input.ActionsSuppressorExtensionPeriod !== undefined && input.ActionsSuppressorExtensionPeriod !== null) {
entries["ActionsSuppressorExtensionPeriod"] = input.ActionsSuppressorExtensionPeriod;
}
return entries;
};

Expand Down Expand Up @@ -4296,6 +4305,12 @@ const deserializeAws_queryCompositeAlarm = (output: any, context: __SerdeContext
StateReasonData: undefined,
StateUpdatedTimestamp: undefined,
StateValue: undefined,
StateTransitionedTimestamp: undefined,
ActionsSuppressedBy: undefined,
ActionsSuppressedReason: undefined,
ActionsSuppressor: undefined,
ActionsSuppressorWaitPeriod: undefined,
ActionsSuppressorExtensionPeriod: undefined,
};
if (output["ActionsEnabled"] !== undefined) {
contents.ActionsEnabled = __parseBoolean(output["ActionsEnabled"]);
Expand Down Expand Up @@ -4356,6 +4371,26 @@ const deserializeAws_queryCompositeAlarm = (output: any, context: __SerdeContext
if (output["StateValue"] !== undefined) {
contents.StateValue = __expectString(output["StateValue"]);
}
if (output["StateTransitionedTimestamp"] !== undefined) {
contents.StateTransitionedTimestamp = __expectNonNull(__parseRfc3339DateTime(output["StateTransitionedTimestamp"]));
}
if (output["ActionsSuppressedBy"] !== undefined) {
contents.ActionsSuppressedBy = __expectString(output["ActionsSuppressedBy"]);
}
if (output["ActionsSuppressedReason"] !== undefined) {
contents.ActionsSuppressedReason = __expectString(output["ActionsSuppressedReason"]);
}
if (output["ActionsSuppressor"] !== undefined) {
contents.ActionsSuppressor = __expectString(output["ActionsSuppressor"]);
}
if (output["ActionsSuppressorWaitPeriod"] !== undefined) {
contents.ActionsSuppressorWaitPeriod = __strictParseInt32(output["ActionsSuppressorWaitPeriod"]) as number;
}
if (output["ActionsSuppressorExtensionPeriod"] !== undefined) {
contents.ActionsSuppressorExtensionPeriod = __strictParseInt32(
output["ActionsSuppressorExtensionPeriod"]
) as number;
}
return contents;
};

Expand Down
90 changes: 89 additions & 1 deletion codegen/sdk-codegen/aws-models/cloudwatch.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,34 @@
"smithy.api#box": {}
}
},
"com.amazonaws.cloudwatch#ActionsSuppressedBy": {
"type": "string",
"traits": {
"smithy.api#enum": [
{
"value": "WaitPeriod",
"name": "WaitPeriod"
},
{
"value": "ExtensionPeriod",
"name": "ExtensionPeriod"
},
{
"value": "Alarm",
"name": "Alarm"
}
]
}
},
"com.amazonaws.cloudwatch#ActionsSuppressedReason": {
"type": "string",
"traits": {
"smithy.api#length": {
"min": 0,
"max": 1024
}
}
},
"com.amazonaws.cloudwatch#AlarmArn": {
"type": "string",
"traits": {
Expand Down Expand Up @@ -472,14 +500,50 @@
"StateUpdatedTimestamp": {
"target": "com.amazonaws.cloudwatch#Timestamp",
"traits": {
"smithy.api#documentation": "<p>The time stamp of the last update to the alarm state.</p>"
"smithy.api#documentation": "<p>Tracks the timestamp of any state update, even if <code>StateValue</code> doesn't change.</p>"
}
},
"StateValue": {
"target": "com.amazonaws.cloudwatch#StateValue",
"traits": {
"smithy.api#documentation": "<p>The state value for the alarm.</p>"
}
},
"StateTransitionedTimestamp": {
"target": "com.amazonaws.cloudwatch#Timestamp",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tThe timestamp \n\t\t\tof the last change \n\t\t\tto the alarm's <code>StateValue</code>.\n\t\t</p>"
}
},
"ActionsSuppressedBy": {
"target": "com.amazonaws.cloudwatch#ActionsSuppressedBy",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tWhen the value is <code>ALARM</code>, \n\t\t\tit means \n\t\t\tthat the actions are suppressed\n\t\t\tbecause the suppressor alarm is \n\t\t\tin <code>ALARM</code>\n\t\t\tWhen the value is <code>WaitPeriod</code>, \n\t\t\tit means that \n\t\t\tthe actions are suppressed \n\t\t\tbecause the composite alarm is waiting\n\t\t\tfor the suppressor alarm \n\t\t\tto go \n\t\t\tinto \n\t\t\tinto the <code>ALARM</code> state. \n\t\t\tThe maximum waiting time is as specified\n\t\t\tin <code>ActionsSuppressorWaitPeriod</code>. \n\t\t\tAfter this time, \n\t\t\tthe composite alarm performs its actions.\n\t\t\tWhen the value is <code>ExtensionPeriod</code>,\n\t\t\tit means \n\t\t\tthat the actions are suppressed\n\t\t\tbecause the composite alarm is waiting \n\t\t\tafter the suppressor alarm went out\n\t\t\tof the <code>ALARM</code> state. \n\t\t\tThe maximum waiting time is as specified \n\t\t\tin <code>ActionsSuppressorExtensionPeriod</code>. \n\t\t\tAfter this time,\n\t\t\tthe composite alarm performs its actions.\n\t\t</p>"
}
},
"ActionsSuppressedReason": {
"target": "com.amazonaws.cloudwatch#ActionsSuppressedReason",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tCaptures the reason for action suppression.\n\t\t</p>"
}
},
"ActionsSuppressor": {
"target": "com.amazonaws.cloudwatch#AlarmArn",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tActions will be suppressed \n\t\t\tif the suppressor alarm is \n\t\t\tin the <code>ALARM</code> state. \n\t\t\t<code>ActionsSuppressor</code> can be an AlarmName or an Amazon Resource Name (ARN) \n\t\t\tfrom an existing alarm. \n\t\t</p>"
}
},
"ActionsSuppressorWaitPeriod": {
"target": "com.amazonaws.cloudwatch#SuppressorPeriod",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tThe maximum time \n\t\t\tin seconds \n\t\t\tthat the composite alarm waits\n\t\t\tfor the suppressor alarm \n\t\t\tto go \n\t\t\tinto the <code>ALARM</code> state. \n\t\t\tAfter this time, \n\t\t\tthe composite alarm performs its actions.\n\t\t</p>\n\t\t <important>\n\t\t\t <p>\n\t\t\t\t <code>WaitPeriod</code> \n\t\t\t\tis required only \n\t\t\t\twhen <code>ActionsSuppressor</code> is specified.\n\t\t\t</p>\n\t\t </important>"
}
},
"ActionsSuppressorExtensionPeriod": {
"target": "com.amazonaws.cloudwatch#SuppressorPeriod",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tThe maximum time \n\t\t\tin seconds\n\t\t\tthat the composite alarm waits \n\t\t\tafter suppressor alarm goes out \n\t\t\tof the <code>ALARM</code> state. \n\t\t\tAfter this time, \n\t\t\tthe composite alarm performs its actions.\n\t\t</p>\n\t\t <important>\n\t\t\t <p>\n\t\t\t\t <code>ExtensionPeriod</code> \n\t\t\t\tis required only \n\t\t\t\twhen <code>ActionsSuppressor</code> is specified.\n\t\t\t</p>\n\t\t </important>"
}
}
},
"traits": {
Expand Down Expand Up @@ -4029,6 +4093,24 @@
"traits": {
"smithy.api#documentation": "<p>A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm.</p>\n\t\t <p>Tags can help you organize and categorize your\n\t\t\tresources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with\n\t\t\tcertain tag values.</p>"
}
},
"ActionsSuppressor": {
"target": "com.amazonaws.cloudwatch#AlarmArn",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tActions will be suppressed \n\t\t\tif the suppressor alarm is \n\t\t\tin the <code>ALARM</code> state.\n\t\t\t<code>ActionsSuppressor</code> can be an AlarmName or an Amazon Resource Name (ARN) \n\t\t\tfrom an existing alarm.\n\t\t</p>"
}
},
"ActionsSuppressorWaitPeriod": {
"target": "com.amazonaws.cloudwatch#SuppressorPeriod",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tThe maximum time \n\t\t\tin seconds \n\t\t\tthat the composite alarm waits\n\t\t\tfor the suppressor alarm \n\t\t\tto go \n\t\t\tinto the <code>ALARM</code> state. \n\t\t\tAfter this time, \n\t\t\tthe composite alarm performs its actions.\n\t\t</p>\n\t\t <important>\n\t\t\t <p>\n\t\t\t\t <code>WaitPeriod</code> \n\t\t\t\tis required only \n\t\t\t\twhen <code>ActionsSuppressor</code> is specified.\n\t\t\t</p>\n\t\t </important>"
}
},
"ActionsSuppressorExtensionPeriod": {
"target": "com.amazonaws.cloudwatch#SuppressorPeriod",
"traits": {
"smithy.api#documentation": "<p>\n\t\t\tThe maximum time \n\t\t\tin seconds\n\t\t\tthat the composite alarm waits \n\t\t\tafter suppressor alarm goes out \n\t\t\tof the <code>ALARM</code> state. \n\t\t\tAfter this time, \n\t\t\tthe composite alarm performs its actions.\n\t\t</p>\n\t\t <important>\n\t\t\t <p>\n\t\t\t\t <code>ExtensionPeriod</code> \n\t\t\t\tis required only \n\t\t\t\twhen <code>ActionsSuppressor</code> is specified.\n\t\t\t</p>\n\t\t </important>"
}
}
}
},
Expand Down Expand Up @@ -4986,6 +5068,12 @@
}
}
},
"com.amazonaws.cloudwatch#SuppressorPeriod": {
"type": "integer",
"traits": {
"smithy.api#box": {}
}
},
"com.amazonaws.cloudwatch#Tag": {
"type": "structure",
"members": {
Expand Down

0 comments on commit e94c855

Please sign in to comment.