Class PutMetricAlarmRequest
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceRequest
-
- com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest
-
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
public class PutMetricAlarmRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
-
Constructor Summary
Constructors Constructor Description PutMetricAlarmRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PutMetricAlarmRequest
clone()
Creates a shallow clone of this request.boolean
equals(Object obj)
Boolean
getActionsEnabled()
Indicates whether or not actions should be executed during any changes to the alarm's state.List<String>
getAlarmActions()
The list of actions to execute when this alarm transitions into anALARM
state from any other state.String
getAlarmDescription()
The description for the alarm.String
getAlarmName()
The descriptive name for the alarm.String
getComparisonOperator()
The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
.List<Dimension>
getDimensions()
The dimensions for the alarm's associated metric.Integer
getEvaluationPeriods()
The number of periods over which data is compared to the specified threshold.List<String>
getInsufficientDataActions()
The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state.String
getMetricName()
The name for the alarm's associated metric.String
getNamespace()
The namespace for the alarm's associated metric.List<String>
getOKActions()
The list of actions to execute when this alarm transitions into anOK
state from any other state.Integer
getPeriod()
The period in seconds over which the specified statistic is applied.String
getStatistic()
The statistic to apply to the alarm's associated metric.Double
getThreshold()
The value against which the specified statistic is compared.String
getUnit()
The statistic's unit of measure.int
hashCode()
Boolean
isActionsEnabled()
Indicates whether or not actions should be executed during any changes to the alarm's state.void
setActionsEnabled(Boolean actionsEnabled)
Indicates whether or not actions should be executed during any changes to the alarm's state.void
setAlarmActions(Collection<String> alarmActions)
The list of actions to execute when this alarm transitions into anALARM
state from any other state.void
setAlarmDescription(String alarmDescription)
The description for the alarm.void
setAlarmName(String alarmName)
The descriptive name for the alarm.void
setComparisonOperator(ComparisonOperator comparisonOperator)
The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
.void
setComparisonOperator(String comparisonOperator)
The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
.void
setDimensions(Collection<Dimension> dimensions)
The dimensions for the alarm's associated metric.void
setEvaluationPeriods(Integer evaluationPeriods)
The number of periods over which data is compared to the specified threshold.void
setInsufficientDataActions(Collection<String> insufficientDataActions)
The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state.void
setMetricName(String metricName)
The name for the alarm's associated metric.void
setNamespace(String namespace)
The namespace for the alarm's associated metric.void
setOKActions(Collection<String> oKActions)
The list of actions to execute when this alarm transitions into anOK
state from any other state.void
setPeriod(Integer period)
The period in seconds over which the specified statistic is applied.void
setStatistic(Statistic statistic)
The statistic to apply to the alarm's associated metric.void
setStatistic(String statistic)
The statistic to apply to the alarm's associated metric.void
setThreshold(Double threshold)
The value against which the specified statistic is compared.void
setUnit(StandardUnit unit)
The statistic's unit of measure.void
setUnit(String unit)
The statistic's unit of measure.String
toString()
Returns a string representation of this object; useful for testing and debugging.PutMetricAlarmRequest
withActionsEnabled(Boolean actionsEnabled)
Indicates whether or not actions should be executed during any changes to the alarm's state.PutMetricAlarmRequest
withAlarmActions(String... alarmActions)
The list of actions to execute when this alarm transitions into anALARM
state from any other state.PutMetricAlarmRequest
withAlarmActions(Collection<String> alarmActions)
The list of actions to execute when this alarm transitions into anALARM
state from any other state.PutMetricAlarmRequest
withAlarmDescription(String alarmDescription)
The description for the alarm.PutMetricAlarmRequest
withAlarmName(String alarmName)
The descriptive name for the alarm.PutMetricAlarmRequest
withComparisonOperator(ComparisonOperator comparisonOperator)
The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
.PutMetricAlarmRequest
withComparisonOperator(String comparisonOperator)
The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
.PutMetricAlarmRequest
withDimensions(Dimension... dimensions)
The dimensions for the alarm's associated metric.PutMetricAlarmRequest
withDimensions(Collection<Dimension> dimensions)
The dimensions for the alarm's associated metric.PutMetricAlarmRequest
withEvaluationPeriods(Integer evaluationPeriods)
The number of periods over which data is compared to the specified threshold.PutMetricAlarmRequest
withInsufficientDataActions(String... insufficientDataActions)
The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state.PutMetricAlarmRequest
withInsufficientDataActions(Collection<String> insufficientDataActions)
The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state.PutMetricAlarmRequest
withMetricName(String metricName)
The name for the alarm's associated metric.PutMetricAlarmRequest
withNamespace(String namespace)
The namespace for the alarm's associated metric.PutMetricAlarmRequest
withOKActions(String... oKActions)
The list of actions to execute when this alarm transitions into anOK
state from any other state.PutMetricAlarmRequest
withOKActions(Collection<String> oKActions)
The list of actions to execute when this alarm transitions into anOK
state from any other state.PutMetricAlarmRequest
withPeriod(Integer period)
The period in seconds over which the specified statistic is applied.PutMetricAlarmRequest
withStatistic(Statistic statistic)
The statistic to apply to the alarm's associated metric.PutMetricAlarmRequest
withStatistic(String statistic)
The statistic to apply to the alarm's associated metric.PutMetricAlarmRequest
withThreshold(Double threshold)
The value against which the specified statistic is compared.PutMetricAlarmRequest
withUnit(StandardUnit unit)
The statistic's unit of measure.PutMetricAlarmRequest
withUnit(String unit)
The statistic's unit of measure.-
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
-
-
-
Method Detail
-
setAlarmName
public void setAlarmName(String alarmName)
The descriptive name for the alarm. This name must be unique within the user's AWS account
- Parameters:
alarmName
- The descriptive name for the alarm. This name must be unique within the user's AWS account
-
getAlarmName
public String getAlarmName()
The descriptive name for the alarm. This name must be unique within the user's AWS account
- Returns:
- The descriptive name for the alarm. This name must be unique within the user's AWS account
-
withAlarmName
public PutMetricAlarmRequest withAlarmName(String alarmName)
The descriptive name for the alarm. This name must be unique within the user's AWS account
- Parameters:
alarmName
- The descriptive name for the alarm. This name must be unique within the user's AWS account- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAlarmDescription
public void setAlarmDescription(String alarmDescription)
The description for the alarm.
- Parameters:
alarmDescription
- The description for the alarm.
-
getAlarmDescription
public String getAlarmDescription()
The description for the alarm.
- Returns:
- The description for the alarm.
-
withAlarmDescription
public PutMetricAlarmRequest withAlarmDescription(String alarmDescription)
The description for the alarm.
- Parameters:
alarmDescription
- The description for the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setActionsEnabled
public void setActionsEnabled(Boolean actionsEnabled)
Indicates whether or not actions should be executed during any changes to the alarm's state.
- Parameters:
actionsEnabled
- Indicates whether or not actions should be executed during any changes to the alarm's state.
-
getActionsEnabled
public Boolean getActionsEnabled()
Indicates whether or not actions should be executed during any changes to the alarm's state.
- Returns:
- Indicates whether or not actions should be executed during any changes to the alarm's state.
-
withActionsEnabled
public PutMetricAlarmRequest withActionsEnabled(Boolean actionsEnabled)
Indicates whether or not actions should be executed during any changes to the alarm's state.
- Parameters:
actionsEnabled
- Indicates whether or not actions should be executed during any changes to the alarm's state.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isActionsEnabled
public Boolean isActionsEnabled()
Indicates whether or not actions should be executed during any changes to the alarm's state.
- Returns:
- Indicates whether or not actions should be executed during any changes to the alarm's state.
-
getOKActions
public List<String> getOKActions()
The list of actions to execute when this alarm transitions into an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- The list of actions to execute when this alarm transitions into
an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws :swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
-
setOKActions
public void setOKActions(Collection<String> oKActions)
The list of actions to execute when this alarm transitions into an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Parameters:
oKActions
- The list of actions to execute when this alarm transitions into anOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
-
withOKActions
public PutMetricAlarmRequest withOKActions(String... oKActions)
The list of actions to execute when this alarm transitions into an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
NOTE: This method appends the values to the existing list (if any). Use
setOKActions(java.util.Collection)
orwithOKActions(java.util.Collection)
if you want to override the existing values.- Parameters:
oKActions
- The list of actions to execute when this alarm transitions into anOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withOKActions
public PutMetricAlarmRequest withOKActions(Collection<String> oKActions)
The list of actions to execute when this alarm transitions into an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Parameters:
oKActions
- The list of actions to execute when this alarm transitions into anOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getAlarmActions
public List<String> getAlarmActions()
The list of actions to execute when this alarm transitions into an
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- The list of actions to execute when this alarm transitions into
an
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws :swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
-
setAlarmActions
public void setAlarmActions(Collection<String> alarmActions)
The list of actions to execute when this alarm transitions into an
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Parameters:
alarmActions
- The list of actions to execute when this alarm transitions into anALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
-
withAlarmActions
public PutMetricAlarmRequest withAlarmActions(String... alarmActions)
The list of actions to execute when this alarm transitions into an
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
NOTE: This method appends the values to the existing list (if any). Use
setAlarmActions(java.util.Collection)
orwithAlarmActions(java.util.Collection)
if you want to override the existing values.- Parameters:
alarmActions
- The list of actions to execute when this alarm transitions into anALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withAlarmActions
public PutMetricAlarmRequest withAlarmActions(Collection<String> alarmActions)
The list of actions to execute when this alarm transitions into an
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Parameters:
alarmActions
- The list of actions to execute when this alarm transitions into anALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getInsufficientDataActions
public List<String> getInsufficientDataActions()
The list of actions to execute when this alarm transitions into an
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- The list of actions to execute when this alarm transitions into
an
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws :swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
-
setInsufficientDataActions
public void setInsufficientDataActions(Collection<String> insufficientDataActions)
The list of actions to execute when this alarm transitions into an
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Parameters:
insufficientDataActions
- The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
-
withInsufficientDataActions
public PutMetricAlarmRequest withInsufficientDataActions(String... insufficientDataActions)
The list of actions to execute when this alarm transitions into an
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
NOTE: This method appends the values to the existing list (if any). Use
setInsufficientDataActions(java.util.Collection)
orwithInsufficientDataActions(java.util.Collection)
if you want to override the existing values.- Parameters:
insufficientDataActions
- The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withInsufficientDataActions
public PutMetricAlarmRequest withInsufficientDataActions(Collection<String> insufficientDataActions)
The list of actions to execute when this alarm transitions into an
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer- account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws:swf:us-east -1:{customer-account}:action/actions/AWS_EC2.InstanceId .Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account}:action/actions /AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Parameters:
insufficientDataActions
- The list of actions to execute when this alarm transitions into anINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: arn:aws:automate:region (e.g., us-east-1):ec2:stop | arn:aws:automate:region (e.g., us-east-1):ec2:terminate | arn:aws:automate:region (e.g., us-east-1):ec2:recover
Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer -account}:action/actions/AWS_EC2.InstanceId.Stop/1.0 | arn:aws: swf:us-east-1:{customer-account}:action/actions/AWS_EC2 .InstanceId.Terminate/1.0 | arn:aws:swf:us-east-1:{customer-account }:action/actions/AWS_EC2.InstanceId.Reboot/1.0
Note: You must create at least one stop, terminate, or reboot alarm using the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role for the first time. After this IAM role is created, you can create stop, terminate, or reboot alarms using the CLI.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMetricName
public void setMetricName(String metricName)
The name for the alarm's associated metric.
- Parameters:
metricName
- The name for the alarm's associated metric.
-
getMetricName
public String getMetricName()
The name for the alarm's associated metric.
- Returns:
- The name for the alarm's associated metric.
-
withMetricName
public PutMetricAlarmRequest withMetricName(String metricName)
The name for the alarm's associated metric.
- Parameters:
metricName
- The name for the alarm's associated metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setNamespace
public void setNamespace(String namespace)
The namespace for the alarm's associated metric.
- Parameters:
namespace
- The namespace for the alarm's associated metric.
-
getNamespace
public String getNamespace()
The namespace for the alarm's associated metric.
- Returns:
- The namespace for the alarm's associated metric.
-
withNamespace
public PutMetricAlarmRequest withNamespace(String namespace)
The namespace for the alarm's associated metric.
- Parameters:
namespace
- The namespace for the alarm's associated metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStatistic
public void setStatistic(String statistic)
The statistic to apply to the alarm's associated metric.
- Parameters:
statistic
- The statistic to apply to the alarm's associated metric.- See Also:
Statistic
-
getStatistic
public String getStatistic()
The statistic to apply to the alarm's associated metric.
- Returns:
- The statistic to apply to the alarm's associated metric.
- See Also:
Statistic
-
withStatistic
public PutMetricAlarmRequest withStatistic(String statistic)
The statistic to apply to the alarm's associated metric.
- Parameters:
statistic
- The statistic to apply to the alarm's associated metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
Statistic
-
setStatistic
public void setStatistic(Statistic statistic)
The statistic to apply to the alarm's associated metric.
- Parameters:
statistic
- The statistic to apply to the alarm's associated metric.- See Also:
Statistic
-
withStatistic
public PutMetricAlarmRequest withStatistic(Statistic statistic)
The statistic to apply to the alarm's associated metric.
- Parameters:
statistic
- The statistic to apply to the alarm's associated metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
Statistic
-
getDimensions
public List<Dimension> getDimensions()
The dimensions for the alarm's associated metric.
- Returns:
- The dimensions for the alarm's associated metric.
-
setDimensions
public void setDimensions(Collection<Dimension> dimensions)
The dimensions for the alarm's associated metric.
- Parameters:
dimensions
- The dimensions for the alarm's associated metric.
-
withDimensions
public PutMetricAlarmRequest withDimensions(Dimension... dimensions)
The dimensions for the alarm's associated metric.
NOTE: This method appends the values to the existing list (if any). Use
setDimensions(java.util.Collection)
orwithDimensions(java.util.Collection)
if you want to override the existing values.- Parameters:
dimensions
- The dimensions for the alarm's associated metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withDimensions
public PutMetricAlarmRequest withDimensions(Collection<Dimension> dimensions)
The dimensions for the alarm's associated metric.
- Parameters:
dimensions
- The dimensions for the alarm's associated metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPeriod
public void setPeriod(Integer period)
The period in seconds over which the specified statistic is applied.
- Parameters:
period
- The period in seconds over which the specified statistic is applied.
-
getPeriod
public Integer getPeriod()
The period in seconds over which the specified statistic is applied.
- Returns:
- The period in seconds over which the specified statistic is applied.
-
withPeriod
public PutMetricAlarmRequest withPeriod(Integer period)
The period in seconds over which the specified statistic is applied.
- Parameters:
period
- The period in seconds over which the specified statistic is applied.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setUnit
public void setUnit(String unit)
The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.
Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Parameters:
unit
- The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- See Also:
StandardUnit
-
getUnit
public String getUnit()
The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.
Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Returns:
- The statistic's unit of measure. For example, the units for the
Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks
the number of bytes that an instance receives on all network
interfaces. You can also specify a unit when you create a custom
metric. Units help provide conceptual meaning to your data.
Metric data points that specify a unit of measure, such as
Percent, are aggregated separately.
Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- See Also:
StandardUnit
-
withUnit
public PutMetricAlarmRequest withUnit(String unit)
The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.
Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Parameters:
unit
- The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
StandardUnit
-
setUnit
public void setUnit(StandardUnit unit)
The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.
Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Parameters:
unit
- The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- See Also:
StandardUnit
-
withUnit
public PutMetricAlarmRequest withUnit(StandardUnit unit)
The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.
Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Parameters:
unit
- The statistic's unit of measure. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.Note: If you specify a unit, you must use a unit that is appropriate for the metric. Otherwise, this can cause an Amazon CloudWatch alarm to get stuck in the INSUFFICIENT DATA state.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
StandardUnit
-
setEvaluationPeriods
public void setEvaluationPeriods(Integer evaluationPeriods)
The number of periods over which data is compared to the specified threshold.
- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold.
-
getEvaluationPeriods
public Integer getEvaluationPeriods()
The number of periods over which data is compared to the specified threshold.
- Returns:
- The number of periods over which data is compared to the specified threshold.
-
withEvaluationPeriods
public PutMetricAlarmRequest withEvaluationPeriods(Integer evaluationPeriods)
The number of periods over which data is compared to the specified threshold.
- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setThreshold
public void setThreshold(Double threshold)
The value against which the specified statistic is compared.
- Parameters:
threshold
- The value against which the specified statistic is compared.
-
getThreshold
public Double getThreshold()
The value against which the specified statistic is compared.
- Returns:
- The value against which the specified statistic is compared.
-
withThreshold
public PutMetricAlarmRequest withThreshold(Double threshold)
The value against which the specified statistic is compared.
- Parameters:
threshold
- The value against which the specified statistic is compared.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setComparisonOperator
public void setComparisonOperator(String comparisonOperator)
The arithmetic operation to use when comparing the specified
Statistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- See Also:
ComparisonOperator
-
getComparisonOperator
public String getComparisonOperator()
The arithmetic operation to use when comparing the specified
Statistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Returns:
- The arithmetic operation to use when comparing the specified
Statistic
andThreshold
. The specifiedStatistic
value is used as the first operand. - See Also:
ComparisonOperator
-
withComparisonOperator
public PutMetricAlarmRequest withComparisonOperator(String comparisonOperator)
The arithmetic operation to use when comparing the specified
Statistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
ComparisonOperator
-
setComparisonOperator
public void setComparisonOperator(ComparisonOperator comparisonOperator)
The arithmetic operation to use when comparing the specified
Statistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- See Also:
ComparisonOperator
-
withComparisonOperator
public PutMetricAlarmRequest withComparisonOperator(ComparisonOperator comparisonOperator)
The arithmetic operation to use when comparing the specified
Statistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specifiedStatistic
andThreshold
. The specifiedStatistic
value is used as the first operand.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
ComparisonOperator
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public PutMetricAlarmRequest clone()
Description copied from class:AmazonWebServiceRequest
Creates a shallow clone of this request. Explicitly does not clone the deep structure of the request object.- Overrides:
clone
in classAmazonWebServiceRequest
- See Also:
Object.clone()
-
-