/* * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.cloudwatch.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Creates or updates an alarm and associates it with the specified Amazon * CloudWatch metric. Optionally, this operation can associate one or more * Amazon Simple Notification Service resources with the alarm. *
*
* When this operation creates an alarm, the alarm state is immediately set to
* INSUFFICIENT_DATA
. The alarm is evaluated and its
* StateValue
is set appropriately. Any actions associated with the
* StateValue
is then executed.
*
StateValue
is left
* unchanged. ec2:DescribeInstanceStatus
and
* ec2:DescribeInstances
for all alarms on Amazon EC2 instance
* status metrics.ec2:StopInstances
for alarms with stop actions.ec2:TerminateInstances
for alarms with terminate actions.ec2:DescribeInstanceRecoveryAttribute
, and
* ec2:RecoverInstances
for alarms with recover actions.* If you have read/write permissions for Amazon CloudWatch but not for Amazon * EC2, you can still create an alarm but the stop or terminate actions won't be * performed on the Amazon EC2 instance. However, if you are later granted * permission to use the associated Amazon EC2 APIs, the alarm actions you * created earlier will be performed. For more information about IAM * permissions, see Permissions and Policies in Using IAM. *
** If you are using an IAM role (e.g., an Amazon EC2 instance profile), you * cannot stop or terminate the instance using alarm actions. However, you can * still see the alarm state and perform any other actions such as Amazon SNS * notifications or Auto Scaling policies. *
** If you are using temporary security credentials granted using the AWS * Security Token Service (AWS STS), you cannot stop or terminate an Amazon EC2 * instance using alarm actions. *
** The descriptive name for the alarm. This name must be unique within the * user's AWS account *
*
* Constraints:
* Length: 1 - 255
*/
private String alarmName;
/**
*
* The description for the alarm. *
*
* Constraints:
* Length: 0 - 1024
*/
private String alarmDescription;
/**
*
* Indicates whether or not actions should be executed during any changes to * the alarm's state. *
*/ private Boolean actionsEnabled; /** *
* 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. *
*/ private java.util.List
* 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. *
*/ private java.util.List
* 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. *
*/ private java.util.List* The name for the alarm's associated metric. *
*
* Constraints:
* Length: 1 - 255
*/
private String metricName;
/**
*
* The namespace for the alarm's associated metric. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [^:].*
*/
private String namespace;
/**
*
* The statistic to apply to the alarm's associated metric. *
*
* Constraints:
* Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
*/
private String statistic;
/**
*
* The dimensions for the alarm's associated metric. *
*/ private java.util.List* The period in seconds over which the specified statistic is applied. *
*
* Constraints:
* Range: 60 -
*/
private Integer period;
/**
*
* 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. *
*
* Constraints:
* Allowed Values: Seconds, Microseconds, Milliseconds, Bytes,
* Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits,
* Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second,
* Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second,
* Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second,
* Count/Second, None
*/
private String unit;
/**
*
* The number of periods over which data is compared to the specified * threshold. *
*
* Constraints:
* Range: 1 -
*/
private Integer evaluationPeriods;
/**
*
* The value against which the specified statistic is compared. *
*/ private Double threshold; /** *
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* Constraints:
* Allowed Values: GreaterThanOrEqualToThreshold,
* GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
*/
private String comparisonOperator;
/**
*
* The descriptive name for the alarm. This name must be unique within the * user's AWS account *
*
* Constraints:
* Length: 1 - 255
*
* @return
* The descriptive name for the alarm. This name must be unique * within the user's AWS account *
*/ public String getAlarmName() { return alarmName; } /** ** The descriptive name for the alarm. This name must be unique within the * user's AWS account *
*
* Constraints:
* Length: 1 - 255
*
* @param alarmName
* The descriptive name for the alarm. This name must be unique * within the user's AWS account *
*/ public void setAlarmName(String alarmName) { this.alarmName = alarmName; } /** ** The descriptive name for the alarm. This name must be unique within the * user's AWS account *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 255
*
* @param alarmName
* The descriptive name for the alarm. This name must be unique * within the user's AWS account *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withAlarmName(String alarmName) { this.alarmName = alarmName; return this; } /** ** The description for the alarm. *
*
* Constraints:
* Length: 0 - 1024
*
* @return
* The description for the alarm. *
*/ public String getAlarmDescription() { return alarmDescription; } /** ** The description for the alarm. *
*
* Constraints:
* Length: 0 - 1024
*
* @param alarmDescription
* The description for the alarm. *
*/ public void setAlarmDescription(String alarmDescription) { this.alarmDescription = alarmDescription; } /** ** The description for the alarm. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
*
* @param alarmDescription
* The description for the alarm. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withAlarmDescription(String alarmDescription) { this.alarmDescription = alarmDescription; return this; } /** ** Indicates whether or not actions should be executed during any changes to * the alarm's state. *
* * @return* Indicates whether or not actions should be executed during any * changes to the alarm's state. *
*/ public Boolean isActionsEnabled() { return actionsEnabled; } /** ** Indicates whether or not actions should be executed during any changes to * the alarm's state. *
* * @return* Indicates whether or not actions should be executed during any * changes to the alarm's state. *
*/ public Boolean getActionsEnabled() { return actionsEnabled; } /** ** Indicates whether or not actions should be executed during any changes to * the alarm's state. *
* * @param actionsEnabled* Indicates whether or not actions should be executed during any * changes to the alarm's state. *
*/ public void setActionsEnabled(Boolean actionsEnabled) { this.actionsEnabled = actionsEnabled; } /** ** Indicates whether or not actions should be executed during any changes to * the alarm's state. *
** Returns a reference to this object so that method calls can be chained * together. * * @param actionsEnabled
* Indicates whether or not actions should be executed during any * changes to the alarm's state. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withActionsEnabled(Boolean actionsEnabled) { this.actionsEnabled = actionsEnabled; return this; } /** *
* 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. *
* * @return
* 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. *
*/ public java.util.List
* 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. *
* * @param 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:{< * i>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. *
*/ public void setOKActions(java.util.Collection
* 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 a reference to this object so that method calls can be chained * together. * * @param 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:{< * i>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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withOKActions(String... oKActions) { if (getOKActions() == null) { this.oKActions = new java.util.ArrayList
* 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 a reference to this object so that method calls can be chained * together. * * @param 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:{< * i>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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withOKActions(java.util.Collection
* 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. *
* * @return
* 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. *
*/ public java.util.List
* 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. *
* * @param 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:{< * i>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. *
*/ public void setAlarmActions(java.util.Collection
* 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 a reference to this object so that method calls can be chained * together. * * @param 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:{< * i>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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withAlarmActions(String... alarmActions) { if (getAlarmActions() == null) { this.alarmActions = new java.util.ArrayList
* 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 a reference to this object so that method calls can be chained * together. * * @param 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:{< * i>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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withAlarmActions(java.util.Collection
* 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. *
* * @return
* 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. *
*/ public java.util.List
* 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. *
* * @param 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:{< * i>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. *
*/ public void setInsufficientDataActions(java.util.Collection
* 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 a reference to this object so that method calls can be chained * together. * * @param 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:{< * i>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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withInsufficientDataActions(String... insufficientDataActions) { if (getInsufficientDataActions() == null) { this.insufficientDataActions = new java.util.ArrayList
* 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 a reference to this object so that method calls can be chained * together. * * @param 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:{< * i>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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withInsufficientDataActions( java.util.Collection* The name for the alarm's associated metric. *
*
* Constraints:
* Length: 1 - 255
*
* @return
* The name for the alarm's associated metric. *
*/ public String getMetricName() { return metricName; } /** ** The name for the alarm's associated metric. *
*
* Constraints:
* Length: 1 - 255
*
* @param metricName
* The name for the alarm's associated metric. *
*/ public void setMetricName(String metricName) { this.metricName = metricName; } /** ** The name for the alarm's associated metric. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 255
*
* @param metricName
* The name for the alarm's associated metric. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withMetricName(String metricName) { this.metricName = metricName; return this; } /** ** The namespace for the alarm's associated metric. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [^:].*
*
* @return
* The namespace for the alarm's associated metric. *
*/ public String getNamespace() { return namespace; } /** ** The namespace for the alarm's associated metric. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [^:].*
*
* @param namespace
* The namespace for the alarm's associated metric. *
*/ public void setNamespace(String namespace) { this.namespace = namespace; } /** ** The namespace for the alarm's associated metric. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 255
* Pattern: [^:].*
*
* @param namespace
* The namespace for the alarm's associated metric. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withNamespace(String namespace) { this.namespace = namespace; return this; } /** ** The statistic to apply to the alarm's associated metric. *
*
* Constraints:
* Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
*
* @return
* The statistic to apply to the alarm's associated metric. *
* @see Statistic */ public String getStatistic() { return statistic; } /** ** The statistic to apply to the alarm's associated metric. *
*
* Constraints:
* Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
*
* @param statistic
* The statistic to apply to the alarm's associated metric. *
* @see Statistic */ public void setStatistic(String statistic) { this.statistic = statistic; } /** ** The statistic to apply to the alarm's associated metric. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
*
* @param statistic
* The statistic to apply to the alarm's associated metric. *
* @return A reference to this updated object so that method calls can be * chained together. * @see Statistic */ public PutMetricAlarmRequest withStatistic(String statistic) { this.statistic = statistic; return this; } /** ** The statistic to apply to the alarm's associated metric. *
*
* Constraints:
* Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
*
* @param statistic
* The statistic to apply to the alarm's associated metric. *
* @see Statistic */ public void setStatistic(Statistic statistic) { this.statistic = statistic.toString(); } /** ** The statistic to apply to the alarm's associated metric. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: SampleCount, Average, Sum, Minimum, Maximum
*
* @param statistic
* The statistic to apply to the alarm's associated metric. *
* @return A reference to this updated object so that method calls can be * chained together. * @see Statistic */ public PutMetricAlarmRequest withStatistic(Statistic statistic) { this.statistic = statistic.toString(); return this; } /** ** The dimensions for the alarm's associated metric. *
* * @return* The dimensions for the alarm's associated metric. *
*/ public java.util.List* The dimensions for the alarm's associated metric. *
* * @param dimensions* The dimensions for the alarm's associated metric. *
*/ public void setDimensions(java.util.Collection* The dimensions for the alarm's associated metric. *
** Returns a reference to this object so that method calls can be chained * together. * * @param dimensions
* The dimensions for the alarm's associated metric. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withDimensions(Dimension... dimensions) { if (getDimensions() == null) { this.dimensions = new java.util.ArrayList* The dimensions for the alarm's associated metric. *
** Returns a reference to this object so that method calls can be chained * together. * * @param dimensions
* The dimensions for the alarm's associated metric. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withDimensions(java.util.Collection* The period in seconds over which the specified statistic is applied. *
*
* Constraints:
* Range: 60 -
*
* @return
* The period in seconds over which the specified statistic is * applied. *
*/ public Integer getPeriod() { return period; } /** ** The period in seconds over which the specified statistic is applied. *
*
* Constraints:
* Range: 60 -
*
* @param period
* The period in seconds over which the specified statistic is * applied. *
*/ public void setPeriod(Integer period) { this.period = period; } /** ** The period in seconds over which the specified statistic is applied. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 60 -
*
* @param period
* The period in seconds over which the specified statistic is * applied. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withPeriod(Integer period) { this.period = period; return this; } /** ** 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. *
*
* Constraints:
* Allowed Values: Seconds, Microseconds, Milliseconds, Bytes,
* Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits,
* Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second,
* Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second,
* Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second,
* Count/Second, None
*
* @return
* 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 StandardUnit */ public String getUnit() { return 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. *
*
* Constraints:
* Allowed Values: Seconds, Microseconds, Milliseconds, Bytes,
* Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits,
* Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second,
* Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second,
* Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second,
* Count/Second, None
*
* @param 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 StandardUnit */ public void setUnit(String unit) { this.unit = 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 a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: Seconds, Microseconds, Milliseconds, Bytes,
* Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits,
* Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second,
* Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second,
* Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second,
* Count/Second, None
*
* @param 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. *
* @return A reference to this updated object so that method calls can be * chained together. * @see StandardUnit */ public PutMetricAlarmRequest withUnit(String unit) { this.unit = unit; return this; } /** ** 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. *
*
* Constraints:
* Allowed Values: Seconds, Microseconds, Milliseconds, Bytes,
* Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits,
* Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second,
* Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second,
* Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second,
* Count/Second, None
*
* @param 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 StandardUnit */ public void setUnit(StandardUnit unit) { this.unit = unit.toString(); } /** ** 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 a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: Seconds, Microseconds, Milliseconds, Bytes,
* Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits,
* Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second,
* Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second,
* Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second,
* Count/Second, None
*
* @param 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. *
* @return A reference to this updated object so that method calls can be * chained together. * @see StandardUnit */ public PutMetricAlarmRequest withUnit(StandardUnit unit) { this.unit = unit.toString(); return this; } /** ** The number of periods over which data is compared to the specified * threshold. *
*
* Constraints:
* Range: 1 -
*
* @return
* The number of periods over which data is compared to the * specified threshold. *
*/ public Integer getEvaluationPeriods() { return evaluationPeriods; } /** ** The number of periods over which data is compared to the specified * threshold. *
*
* Constraints:
* Range: 1 -
*
* @param evaluationPeriods
* The number of periods over which data is compared to the * specified threshold. *
*/ public void setEvaluationPeriods(Integer evaluationPeriods) { this.evaluationPeriods = evaluationPeriods; } /** ** The number of periods over which data is compared to the specified * threshold. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 1 -
*
* @param evaluationPeriods
* The number of periods over which data is compared to the * specified threshold. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withEvaluationPeriods(Integer evaluationPeriods) { this.evaluationPeriods = evaluationPeriods; return this; } /** ** The value against which the specified statistic is compared. *
* * @return* The value against which the specified statistic is compared. *
*/ public Double getThreshold() { return threshold; } /** ** The value against which the specified statistic is compared. *
* * @param threshold* The value against which the specified statistic is compared. *
*/ public void setThreshold(Double threshold) { this.threshold = threshold; } /** ** The value against which the specified statistic is compared. *
** Returns a reference to this object so that method calls can be chained * together. * * @param threshold
* The value against which the specified statistic is compared. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PutMetricAlarmRequest withThreshold(Double threshold) { this.threshold = threshold; return this; } /** *
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* Constraints:
* Allowed Values: GreaterThanOrEqualToThreshold,
* GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
*
* @return
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* Constraints:
* Allowed Values: GreaterThanOrEqualToThreshold,
* GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The
* specified Statistic
value is used as the first
* operand.
*
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: GreaterThanOrEqualToThreshold,
* GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The
* specified Statistic
value is used as the first
* operand.
*
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* Constraints:
* Allowed Values: GreaterThanOrEqualToThreshold,
* GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The
* specified Statistic
value is used as the first
* operand.
*
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The specified
* Statistic
value is used as the first operand.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: GreaterThanOrEqualToThreshold,
* GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified
* Statistic
and Threshold
. The
* specified Statistic
value is used as the first
* operand.
*