Class PutCompositeAlarmRequest
- java.lang.Object
-
- software.amazon.awssdk.core.SdkRequest
-
- software.amazon.awssdk.awscore.AwsRequest
-
- software.amazon.awssdk.services.cloudwatch.model.CloudWatchRequest
-
- software.amazon.awssdk.services.cloudwatch.model.PutCompositeAlarmRequest
-
- All Implemented Interfaces:
SdkPojo
,ToCopyableBuilder<PutCompositeAlarmRequest.Builder,PutCompositeAlarmRequest>
@Generated("software.amazon.awssdk:codegen") public final class PutCompositeAlarmRequest extends CloudWatchRequest implements ToCopyableBuilder<PutCompositeAlarmRequest.Builder,PutCompositeAlarmRequest>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PutCompositeAlarmRequest.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
actionsEnabled()
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.String
actionsSuppressor()
Actions will be suppressed if the suppressor alarm is in theALARM
state.Integer
actionsSuppressorExtensionPeriod()
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state.Integer
actionsSuppressorWaitPeriod()
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state.List<String>
alarmActions()
The actions to execute when this alarm transitions to theALARM
state from any other state.String
alarmDescription()
The description for the composite alarm.String
alarmName()
The name for the composite alarm.String
alarmRule()
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.static PutCompositeAlarmRequest.Builder
builder()
boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
boolean
hasAlarmActions()
For responses, this returns true if the service returned a value for the AlarmActions property.int
hashCode()
boolean
hasInsufficientDataActions()
For responses, this returns true if the service returned a value for the InsufficientDataActions property.boolean
hasOkActions()
For responses, this returns true if the service returned a value for the OKActions property.boolean
hasTags()
For responses, this returns true if the service returned a value for the Tags property.List<String>
insufficientDataActions()
The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.List<String>
okActions()
The actions to execute when this alarm transitions to anOK
state from any other state.List<SdkField<?>>
sdkFields()
static Class<? extends PutCompositeAlarmRequest.Builder>
serializableBuilderClass()
List<Tag>
tags()
A list of key-value pairs to associate with the composite alarm.PutCompositeAlarmRequest.Builder
toBuilder()
String
toString()
Returns a string representation of this object.-
Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfiguration
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
actionsEnabled
public final Boolean actionsEnabled()
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is
TRUE
.- Returns:
- Indicates whether actions should be executed during any changes to the alarm state of the composite
alarm. The default is
TRUE
.
-
hasAlarmActions
public final boolean hasAlarmActions()
For responses, this returns true if the service returned a value for the AlarmActions property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
alarmActions
public final List<String> alarmActions()
The actions to execute when this alarm transitions to the
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values:
arn:aws:sns:region:account-id:sns-topic-name
|arn:aws:ssm:region:account-id:opsitem:severity
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasAlarmActions()
method.- Returns:
- The actions to execute when this alarm transitions to the
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values:
arn:aws:sns:region:account-id:sns-topic-name
|arn:aws:ssm:region:account-id:opsitem:severity
-
alarmDescription
public final String alarmDescription()
The description for the composite alarm.
- Returns:
- The description for the composite alarm.
-
alarmName
public final String alarmName()
The name for the composite alarm. This name must be unique within the Region.
- Returns:
- The name for the composite alarm. This name must be unique within the Region.
-
alarmRule
public final String alarmRule()
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.
You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.
Functions can include the following:
-
ALARM("alarm-name or alarm-ARN")
is TRUE if the named alarm is in ALARM state. -
OK("alarm-name or alarm-ARN")
is TRUE if the named alarm is in OK state. -
INSUFFICIENT_DATA("alarm-name or alarm-ARN")
is TRUE if the named alarm is in INSUFFICIENT_DATA state. -
TRUE
always evaluates to TRUE. -
FALSE
always evaluates to FALSE.
TRUE and FALSE are useful for testing a complex
AlarmRule
structure, and for testing your alarm actions.Alarm names specified in
AlarmRule
can be surrounded with double-quotes ("), but do not have to be.The following are some examples of
AlarmRule
:-
ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)
specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state. -
ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)
specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window. -
(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)
goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.
The
AlarmRule
can specify as many as 100 "children" alarms. TheAlarmRule
expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses.- Returns:
- An expression that specifies which other alarms are to be evaluated to determine this composite alarm's
state. For each alarm that you reference, you designate a function that specifies whether that alarm
needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT)
to combine multiple functions in a single expression. You can use parenthesis to logically group the
functions in your expression.
You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.
Functions can include the following:
-
ALARM("alarm-name or alarm-ARN")
is TRUE if the named alarm is in ALARM state. -
OK("alarm-name or alarm-ARN")
is TRUE if the named alarm is in OK state. -
INSUFFICIENT_DATA("alarm-name or alarm-ARN")
is TRUE if the named alarm is in INSUFFICIENT_DATA state. -
TRUE
always evaluates to TRUE. -
FALSE
always evaluates to FALSE.
TRUE and FALSE are useful for testing a complex
AlarmRule
structure, and for testing your alarm actions.Alarm names specified in
AlarmRule
can be surrounded with double-quotes ("), but do not have to be.The following are some examples of
AlarmRule
:-
ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)
specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state. -
ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)
specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window. -
(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)
goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.
The
AlarmRule
can specify as many as 100 "children" alarms. TheAlarmRule
expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses. -
-
-
hasInsufficientDataActions
public final boolean hasInsufficientDataActions()
For responses, this returns true if the service returned a value for the InsufficientDataActions property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
insufficientDataActions
public final List<String> insufficientDataActions()
The actions to execute when this alarm transitions to the
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values:
arn:aws:sns:region:account-id:sns-topic-name
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasInsufficientDataActions()
method.- Returns:
- The actions to execute when this alarm transitions to the
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values:
arn:aws:sns:region:account-id:sns-topic-name
-
hasOkActions
public final boolean hasOkActions()
For responses, this returns true if the service returned a value for the OKActions property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
okActions
public final List<String> okActions()
The actions to execute when this alarm transitions to an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values:
arn:aws:sns:region:account-id:sns-topic-name
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasOkActions()
method.- Returns:
- The actions to execute when this alarm transitions to an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values:
arn:aws:sns:region:account-id:sns-topic-name
-
hasTags
public final boolean hasTags()
For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
tags
public final List<Tag> tags()
A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTags()
method.- Returns:
- A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags
with an alarm.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.
-
actionsSuppressor
public final String actionsSuppressor()
Actions will be suppressed if the suppressor alarm is in the
ALARM
state.ActionsSuppressor
can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.- Returns:
- Actions will be suppressed if the suppressor alarm is in the
ALARM
state.ActionsSuppressor
can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.
-
actionsSuppressorWaitPeriod
public final Integer actionsSuppressorWaitPeriod()
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the
ALARM
state. After this time, the composite alarm performs its actions.WaitPeriod
is required only whenActionsSuppressor
is specified.- Returns:
- The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the
ALARM
state. After this time, the composite alarm performs its actions.WaitPeriod
is required only whenActionsSuppressor
is specified.
-
actionsSuppressorExtensionPeriod
public final Integer actionsSuppressorExtensionPeriod()
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the
ALARM
state. After this time, the composite alarm performs its actions.ExtensionPeriod
is required only whenActionsSuppressor
is specified.- Returns:
- The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the
ALARM
state. After this time, the composite alarm performs its actions.ExtensionPeriod
is required only whenActionsSuppressor
is specified.
-
toBuilder
public PutCompositeAlarmRequest.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<PutCompositeAlarmRequest.Builder,PutCompositeAlarmRequest>
- Specified by:
toBuilder
in classCloudWatchRequest
-
builder
public static PutCompositeAlarmRequest.Builder builder()
-
serializableBuilderClass
public static Class<? extends PutCompositeAlarmRequest.Builder> serializableBuilderClass()
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classAwsRequest
-
equals
public final boolean equals(Object obj)
- Overrides:
equals
in classAwsRequest
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
getValueForField
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
- Overrides:
getValueForField
in classSdkRequest
-
-