com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudwatch Show documentation
/*
* Copyright 2019-2024 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 javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PutMetricAlarmRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name for the alarm. This name must be unique within the Region.
*
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
*
*/
private String alarmName;
/**
*
* The description for the alarm.
*
*/
private String alarmDescription;
/**
*
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*
*/
private Boolean actionsEnabled;
/**
*
* The actions to execute when this alarm transitions to an OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*/
private com.amazonaws.internal.SdkInternalList oKActions;
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*/
private com.amazonaws.internal.SdkInternalList alarmActions;
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*/
private com.amazonaws.internal.SdkInternalList insufficientDataActions;
/**
*
* The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you must
* specify either MetricName
or a Metrics
array.
*
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters. Instead, you specify all this information in the
* Metrics
array.
*
*/
private String metricName;
/**
*
* The namespace for the metric associated specified in MetricName
.
*
*/
private String namespace;
/**
*
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
but
* not both.
*
*/
private String statistic;
/**
*
* The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either Statistic
* or ExtendedStatistic
but not both.
*
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch
* statistics definitions.
*
*/
private String extendedStatistic;
/**
*
* The dimensions for the metric specified in MetricName
.
*
*/
private com.amazonaws.internal.SdkInternalList dimensions;
/**
*
* The length, in seconds, used each time the metric specified in MetricName
is evaluated. Valid values
* are 10, 30, and any multiple of 60.
*
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based on a
* metric math expression, you specify the period for each metric within the objects in the Metrics
* array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case,
* it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm
* might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution
* alarm, which has a higher charge than other alarms. For more information about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
multiplied by
* EvaluationPeriods
cannot be more than 86,400 seconds.
*
*/
private Integer period;
/**
*
* The unit of measure for the statistic. 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. If you are creating an alarm
* based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the
* Metrics
array.
*
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for the
* metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works
* as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is not
* published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
state.
*
*/
private String unit;
/**
*
* The number of periods over which data is compared to the specified threshold. If you are setting an alarm that
* requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that
* number. If you are setting an "M out of N" alarm, this value is the N.
*
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
*
*/
private Integer evaluationPeriods;
/**
*
* The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an
* "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
*
*/
private Integer datapointsToAlarm;
/**
*
* The value against which the specified statistic is compared.
*
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based on
* anomaly detection models.
*
*/
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.
*
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
*
*/
private String comparisonOperator;
/**
*
* Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the default
* behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
missing data
* even if you choose a different option for TreatMissingData
. When an AWS/DynamoDB
metric
* has missing data, alarms that evaluate that metric remain in their current state.
*
*
*/
private String treatMissingData;
/**
*
* Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not change
* during periods with too few data points to be statistically significant. If you specify evaluate
or
* omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are
* available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
*
* Valid Values: evaluate | ignore
*
*/
private String evaluateLowSampleCountPercentile;
/**
*
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result of a
* metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information, see MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters of PutMetricAlarm
in the same operation. Instead, you
* retrieve the metrics you are using in your math expression as part of the Metrics
array.
*
*/
private com.amazonaws.internal.SdkInternalList metrics;
/**
*
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be
* able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions by
* granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored.
* To change the tags of an existing alarm, use TagResource or
* UntagResource.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
*
*/
private String thresholdMetricId;
/**
*
* The name for the alarm. This name must be unique within the Region.
*
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
*
*
* @param alarmName
* The name for the alarm. This name must be unique within the Region.
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
*/
public void setAlarmName(String alarmName) {
this.alarmName = alarmName;
}
/**
*
* The name for the alarm. This name must be unique within the Region.
*
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
*
*
* @return The name for the alarm. This name must be unique within the Region.
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
*/
public String getAlarmName() {
return this.alarmName;
}
/**
*
* The name for the alarm. This name must be unique within the Region.
*
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
*
*
* @param alarmName
* The name for the alarm. This name must be unique within the Region.
*
* The name must contain only UTF-8 characters, and can't contain ASCII control characters
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withAlarmName(String alarmName) {
setAlarmName(alarmName);
return this;
}
/**
*
* The description for the alarm.
*
*
* @param alarmDescription
* The description for the alarm.
*/
public void setAlarmDescription(String alarmDescription) {
this.alarmDescription = alarmDescription;
}
/**
*
* The description for the alarm.
*
*
* @return The description for the alarm.
*/
public String getAlarmDescription() {
return this.alarmDescription;
}
/**
*
* The description for the alarm.
*
*
* @param alarmDescription
* The description for the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withAlarmDescription(String alarmDescription) {
setAlarmDescription(alarmDescription);
return this;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*
*
* @param actionsEnabled
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*/
public void setActionsEnabled(Boolean actionsEnabled) {
this.actionsEnabled = actionsEnabled;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*
*
* @return Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*/
public Boolean getActionsEnabled() {
return this.actionsEnabled;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*
*
* @param actionsEnabled
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withActionsEnabled(Boolean actionsEnabled) {
setActionsEnabled(actionsEnabled);
return this;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*
*
* @return Indicates whether actions should be executed during any changes to the alarm state. The default is
* TRUE
.
*/
public Boolean isActionsEnabled() {
return this.actionsEnabled;
}
/**
*
* The actions to execute when this alarm transitions to an OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @return The actions to execute when this alarm transitions to an OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*/
public java.util.List getOKActions() {
if (oKActions == null) {
oKActions = new com.amazonaws.internal.SdkInternalList();
}
return oKActions;
}
/**
*
* The actions to execute when this alarm transitions to an OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @param oKActions
* The actions to execute when this alarm transitions to an OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*/
public void setOKActions(java.util.Collection oKActions) {
if (oKActions == null) {
this.oKActions = null;
return;
}
this.oKActions = new com.amazonaws.internal.SdkInternalList(oKActions);
}
/**
*
* The actions to execute when this alarm transitions to an OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOKActions(java.util.Collection)} or {@link #withOKActions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param oKActions
* The actions to execute when this alarm transitions to an OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withOKActions(String... oKActions) {
if (this.oKActions == null) {
setOKActions(new com.amazonaws.internal.SdkInternalList(oKActions.length));
}
for (String ele : oKActions) {
this.oKActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to an OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @param oKActions
* The actions to execute when this alarm transitions to an OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withOKActions(java.util.Collection oKActions) {
setOKActions(oKActions);
return this;
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @return The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*/
public java.util.List getAlarmActions() {
if (alarmActions == null) {
alarmActions = new com.amazonaws.internal.SdkInternalList();
}
return alarmActions;
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @param alarmActions
* The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*/
public void setAlarmActions(java.util.Collection alarmActions) {
if (alarmActions == null) {
this.alarmActions = null;
return;
}
this.alarmActions = new com.amazonaws.internal.SdkInternalList(alarmActions);
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAlarmActions(java.util.Collection)} or {@link #withAlarmActions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param alarmActions
* The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withAlarmActions(String... alarmActions) {
if (this.alarmActions == null) {
setAlarmActions(new com.amazonaws.internal.SdkInternalList(alarmActions.length));
}
for (String ele : alarmActions) {
this.alarmActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @param alarmActions
* The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withAlarmActions(java.util.Collection alarmActions) {
setAlarmActions(alarmActions);
return this;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @return The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*/
public java.util.List getInsufficientDataActions() {
if (insufficientDataActions == null) {
insufficientDataActions = new com.amazonaws.internal.SdkInternalList();
}
return insufficientDataActions;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*/
public void setInsufficientDataActions(java.util.Collection insufficientDataActions) {
if (insufficientDataActions == null) {
this.insufficientDataActions = null;
return;
}
this.insufficientDataActions = new com.amazonaws.internal.SdkInternalList(insufficientDataActions);
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInsufficientDataActions(java.util.Collection)} or
* {@link #withInsufficientDataActions(java.util.Collection)} if you want to override the existing values.
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withInsufficientDataActions(String... insufficientDataActions) {
if (this.insufficientDataActions == null) {
setInsufficientDataActions(new com.amazonaws.internal.SdkInternalList(insufficientDataActions.length));
}
for (String ele : insufficientDataActions) {
this.insufficientDataActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:
*
* EC2 actions:
*
*
* -
*
* arn:aws:automate:region:ec2:stop
*
*
* -
*
* arn:aws:automate:region:ec2:terminate
*
*
* -
*
* arn:aws:automate:region:ec2:reboot
*
*
* -
*
* arn:aws:automate:region:ec2:recover
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
*
*
* -
*
* arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0
*
*
*
*
* Autoscaling action:
*
*
* -
*
* arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
*
*
*
*
* Lambda actions:
*
*
* -
*
* Invoke the latest version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name
*
*
* -
*
* Invoke a specific version of a Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:version-number
*
*
* -
*
* Invoke a function by using an alias Lambda function:
* arn:aws:lambda:region:account-id:function:function-name:alias-name
*
*
*
*
* SNS notification action:
*
*
* -
*
* arn:aws:sns:region:account-id:sns-topic-name
*
*
*
*
* SSM integration actions:
*
*
* -
*
* arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
*
*
* -
*
* arn:aws:ssm-incidents::account-id:responseplan/response-plan-name
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withInsufficientDataActions(java.util.Collection insufficientDataActions) {
setInsufficientDataActions(insufficientDataActions);
return this;
}
/**
*
* The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you must
* specify either MetricName
or a Metrics
array.
*
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters. Instead, you specify all this information in the
* Metrics
array.
*
*
* @param metricName
* The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you
* must specify either MetricName
or a Metrics
array.
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters. Instead, you specify all this
* information in the Metrics
array.
*/
public void setMetricName(String metricName) {
this.metricName = metricName;
}
/**
*
* The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you must
* specify either MetricName
or a Metrics
array.
*
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters. Instead, you specify all this information in the
* Metrics
array.
*
*
* @return The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you
* must specify either MetricName
or a Metrics
array.
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters. Instead, you specify all this
* information in the Metrics
array.
*/
public String getMetricName() {
return this.metricName;
}
/**
*
* The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you must
* specify either MetricName
or a Metrics
array.
*
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters. Instead, you specify all this information in the
* Metrics
array.
*
*
* @param metricName
* The name for the metric associated with the alarm. For each PutMetricAlarm
operation, you
* must specify either MetricName
or a Metrics
array.
*
* If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the
* Namespace
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters. Instead, you specify all this
* information in the Metrics
array.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withMetricName(String metricName) {
setMetricName(metricName);
return this;
}
/**
*
* The namespace for the metric associated specified in MetricName
.
*
*
* @param namespace
* The namespace for the metric associated specified in MetricName
.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* The namespace for the metric associated specified in MetricName
.
*
*
* @return The namespace for the metric associated specified in MetricName
.
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* The namespace for the metric associated specified in MetricName
.
*
*
* @param namespace
* The namespace for the metric associated specified in MetricName
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
but
* not both.
*
*
* @param statistic
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
* but not both.
* @see Statistic
*/
public void setStatistic(String statistic) {
this.statistic = statistic;
}
/**
*
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
but
* not both.
*
*
* @return The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or
* ExtendedStatistic,
but not both.
* @see Statistic
*/
public String getStatistic() {
return this.statistic;
}
/**
*
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
but
* not both.
*
*
* @param statistic
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
* but not both.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public PutMetricAlarmRequest withStatistic(String statistic) {
setStatistic(statistic);
return this;
}
/**
*
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
but
* not both.
*
*
* @param statistic
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
* but not both.
* @see Statistic
*/
public void setStatistic(Statistic statistic) {
withStatistic(statistic);
}
/**
*
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
but
* not both.
*
*
* @param statistic
* The statistic for the metric specified in MetricName
, other than percentile. For percentile
* statistics, use ExtendedStatistic
. When you call PutMetricAlarm
and specify a
* MetricName
, you must specify either Statistic
or ExtendedStatistic,
* but not both.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public PutMetricAlarmRequest withStatistic(Statistic statistic) {
this.statistic = statistic.toString();
return this;
}
/**
*
* The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either Statistic
* or ExtendedStatistic
but not both.
*
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch
* statistics definitions.
*
*
* @param extendedStatistic
* The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either
* Statistic
or ExtendedStatistic
but not both.
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch statistics definitions.
*/
public void setExtendedStatistic(String extendedStatistic) {
this.extendedStatistic = extendedStatistic;
}
/**
*
* The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either Statistic
* or ExtendedStatistic
but not both.
*
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch
* statistics definitions.
*
*
* @return The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either
* Statistic
or ExtendedStatistic
but not both.
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch statistics definitions.
*/
public String getExtendedStatistic() {
return this.extendedStatistic;
}
/**
*
* The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either Statistic
* or ExtendedStatistic
but not both.
*
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch
* statistics definitions.
*
*
* @param extendedStatistic
* The extended statistic for the metric specified in MetricName
. When you call
* PutMetricAlarm
and specify a MetricName
, you must specify either
* Statistic
or ExtendedStatistic
but not both.
*
* If you specify ExtendedStatistic
, the following are valid values:
*
*
* -
*
* p90
*
*
* -
*
* tm90
*
*
* -
*
* tc90
*
*
* -
*
* ts90
*
*
* -
*
* wm90
*
*
* -
*
* IQM
*
*
* -
*
* PR(n:m)
where n and m are values of the metric
*
*
* -
*
* TC(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* TS(X%:X%)
where X is between 10 and 90 inclusive.
*
*
* -
*
* WM(X%:X%)
where X is between 10 and 90 inclusive.
*
*
*
*
* For more information about these extended statistics, see CloudWatch statistics definitions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withExtendedStatistic(String extendedStatistic) {
setExtendedStatistic(extendedStatistic);
return this;
}
/**
*
* The dimensions for the metric specified in MetricName
.
*
*
* @return The dimensions for the metric specified in MetricName
.
*/
public java.util.List getDimensions() {
if (dimensions == null) {
dimensions = new com.amazonaws.internal.SdkInternalList();
}
return dimensions;
}
/**
*
* The dimensions for the metric specified in MetricName
.
*
*
* @param dimensions
* The dimensions for the metric specified in MetricName
.
*/
public void setDimensions(java.util.Collection dimensions) {
if (dimensions == null) {
this.dimensions = null;
return;
}
this.dimensions = new com.amazonaws.internal.SdkInternalList(dimensions);
}
/**
*
* The dimensions for the metric specified in MetricName
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDimensions(java.util.Collection)} or {@link #withDimensions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param dimensions
* The dimensions for the metric specified in MetricName
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withDimensions(Dimension... dimensions) {
if (this.dimensions == null) {
setDimensions(new com.amazonaws.internal.SdkInternalList(dimensions.length));
}
for (Dimension ele : dimensions) {
this.dimensions.add(ele);
}
return this;
}
/**
*
* The dimensions for the metric specified in MetricName
.
*
*
* @param dimensions
* The dimensions for the metric specified in MetricName
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withDimensions(java.util.Collection dimensions) {
setDimensions(dimensions);
return this;
}
/**
*
* The length, in seconds, used each time the metric specified in MetricName
is evaluated. Valid values
* are 10, 30, and any multiple of 60.
*
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based on a
* metric math expression, you specify the period for each metric within the objects in the Metrics
* array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case,
* it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm
* might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution
* alarm, which has a higher charge than other alarms. For more information about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
multiplied by
* EvaluationPeriods
cannot be more than 86,400 seconds.
*
*
* @param period
* The length, in seconds, used each time the metric specified in MetricName
is evaluated. Valid
* values are 10, 30, and any multiple of 60.
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based
* on a metric math expression, you specify the period for each metric within the objects in the
* Metrics
array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In
* this case, it does not receive data for the attempts that do not correspond to a one-minute data
* resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets
* this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information
* about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
* multiplied by EvaluationPeriods
cannot be more than 86,400 seconds.
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
*
* The length, in seconds, used each time the metric specified in MetricName
is evaluated. Valid values
* are 10, 30, and any multiple of 60.
*
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based on a
* metric math expression, you specify the period for each metric within the objects in the Metrics
* array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case,
* it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm
* might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution
* alarm, which has a higher charge than other alarms. For more information about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
multiplied by
* EvaluationPeriods
cannot be more than 86,400 seconds.
*
*
* @return The length, in seconds, used each time the metric specified in MetricName
is evaluated.
* Valid values are 10, 30, and any multiple of 60.
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based
* on a metric math expression, you specify the period for each metric within the objects in the
* Metrics
array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In
* this case, it does not receive data for the attempts that do not correspond to a one-minute data
* resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets
* this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information
* about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
* multiplied by EvaluationPeriods
cannot be more than 86,400 seconds.
*/
public Integer getPeriod() {
return this.period;
}
/**
*
* The length, in seconds, used each time the metric specified in MetricName
is evaluated. Valid values
* are 10, 30, and any multiple of 60.
*
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based on a
* metric math expression, you specify the period for each metric within the objects in the Metrics
* array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case,
* it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm
* might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution
* alarm, which has a higher charge than other alarms. For more information about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
multiplied by
* EvaluationPeriods
cannot be more than 86,400 seconds.
*
*
* @param period
* The length, in seconds, used each time the metric specified in MetricName
is evaluated. Valid
* values are 10, 30, and any multiple of 60.
*
* Period
is required for alarms based on static thresholds. If you are creating an alarm based
* on a metric math expression, you specify the period for each metric within the objects in the
* Metrics
array.
*
*
* Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
call with a
* StorageResolution
of 1. If you specify a period of 10 or 30 for a metric that does not have
* sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In
* this case, it does not receive data for the attempts that do not correspond to a one-minute data
* resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets
* this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information
* about pricing, see Amazon CloudWatch Pricing.
*
*
* An alarm's total current evaluation period can be no longer than one day, so Period
* multiplied by EvaluationPeriods
cannot be more than 86,400 seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withPeriod(Integer period) {
setPeriod(period);
return this;
}
/**
*
* The unit of measure for the statistic. 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. If you are creating an alarm
* based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the
* Metrics
array.
*
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for the
* metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works
* as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is not
* published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
state.
*
*
* @param unit
* The unit of measure for the statistic. 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. If
* you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if
* needed) within the objects in the Metrics
array.
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for
* the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the
* alarm works as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is
* not published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
* state.
* @see StandardUnit
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
*
* The unit of measure for the statistic. 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. If you are creating an alarm
* based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the
* Metrics
array.
*
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for the
* metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works
* as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is not
* published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
state.
*
*
* @return The unit of measure for the statistic. 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.
* If you are creating an alarm based on a metric math expression, you can specify the unit for each metric
* (if needed) within the objects in the Metrics
array.
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for
* the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the
* alarm works as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the
* alarm's behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is
* not published for this metric. Doing so causes the alarm to be stuck in the
* INSUFFICIENT DATA
state.
* @see StandardUnit
*/
public String getUnit() {
return this.unit;
}
/**
*
* The unit of measure for the statistic. 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. If you are creating an alarm
* based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the
* Metrics
array.
*
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for the
* metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works
* as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is not
* published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
state.
*
*
* @param unit
* The unit of measure for the statistic. 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. If
* you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if
* needed) within the objects in the Metrics
array.
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for
* the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the
* alarm works as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is
* not published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
* state.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StandardUnit
*/
public PutMetricAlarmRequest withUnit(String unit) {
setUnit(unit);
return this;
}
/**
*
* The unit of measure for the statistic. 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. If you are creating an alarm
* based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the
* Metrics
array.
*
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for the
* metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works
* as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is not
* published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
state.
*
*
* @param unit
* The unit of measure for the statistic. 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. If
* you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if
* needed) within the objects in the Metrics
array.
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for
* the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the
* alarm works as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is
* not published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
* state.
* @see StandardUnit
*/
public void setUnit(StandardUnit unit) {
withUnit(unit);
}
/**
*
* The unit of measure for the statistic. 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. If you are creating an alarm
* based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the
* Metrics
array.
*
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for the
* metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works
* as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is not
* published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
state.
*
*
* @param unit
* The unit of measure for the statistic. 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. If
* you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if
* needed) within the objects in the Metrics
array.
*
* If you don't specify Unit
, CloudWatch retrieves all unit types that have been published for
* the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the
* alarm works as intended.
*
*
* However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's
* behavior is not defined and it behaves unpredictably.
*
*
* We recommend omitting Unit
so that you don't inadvertently specify an incorrect unit that is
* not published for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT DATA
* state.
* @return Returns a reference to this 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. If you are setting an alarm that
* requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that
* number. If you are setting an "M out of N" alarm, this value is the N.
*
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
*
*
* @param evaluationPeriods
* The number of periods over which data is compared to the specified threshold. If you are setting an alarm
* that requires that a number of consecutive data points be breaching to trigger the alarm, this value
* specifies that number. If you are setting an "M out of N" alarm, this value is the N.
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
*/
public void setEvaluationPeriods(Integer evaluationPeriods) {
this.evaluationPeriods = evaluationPeriods;
}
/**
*
* The number of periods over which data is compared to the specified threshold. If you are setting an alarm that
* requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that
* number. If you are setting an "M out of N" alarm, this value is the N.
*
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
*
*
* @return The number of periods over which data is compared to the specified threshold. If you are setting an alarm
* that requires that a number of consecutive data points be breaching to trigger the alarm, this value
* specifies that number. If you are setting an "M out of N" alarm, this value is the N.
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
*/
public Integer getEvaluationPeriods() {
return this.evaluationPeriods;
}
/**
*
* The number of periods over which data is compared to the specified threshold. If you are setting an alarm that
* requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that
* number. If you are setting an "M out of N" alarm, this value is the N.
*
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
*
*
* @param evaluationPeriods
* The number of periods over which data is compared to the specified threshold. If you are setting an alarm
* that requires that a number of consecutive data points be breaching to trigger the alarm, this value
* specifies that number. If you are setting an "M out of N" alarm, this value is the N.
*
* An alarm's total current evaluation period can be no longer than one day, so this number multiplied by
* Period
cannot be more than 86,400 seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withEvaluationPeriods(Integer evaluationPeriods) {
setEvaluationPeriods(evaluationPeriods);
return this;
}
/**
*
* The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an
* "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
*
*
* @param datapointsToAlarm
* The number of data points that must be breaching to trigger the alarm. This is used only if you are
* setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
*/
public void setDatapointsToAlarm(Integer datapointsToAlarm) {
this.datapointsToAlarm = datapointsToAlarm;
}
/**
*
* The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an
* "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
*
*
* @return The number of data points that must be breaching to trigger the alarm. This is used only if you are
* setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
*/
public Integer getDatapointsToAlarm() {
return this.datapointsToAlarm;
}
/**
*
* The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an
* "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
*
*
* @param datapointsToAlarm
* The number of data points that must be breaching to trigger the alarm. This is used only if you are
* setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withDatapointsToAlarm(Integer datapointsToAlarm) {
setDatapointsToAlarm(datapointsToAlarm);
return this;
}
/**
*
* The value against which the specified statistic is compared.
*
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based on
* anomaly detection models.
*
*
* @param threshold
* The value against which the specified statistic is compared.
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based
* on anomaly detection models.
*/
public void setThreshold(Double threshold) {
this.threshold = threshold;
}
/**
*
* The value against which the specified statistic is compared.
*
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based on
* anomaly detection models.
*
*
* @return The value against which the specified statistic is compared.
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based
* on anomaly detection models.
*/
public Double getThreshold() {
return this.threshold;
}
/**
*
* The value against which the specified statistic is compared.
*
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based on
* anomaly detection models.
*
*
* @param threshold
* The value against which the specified statistic is compared.
*
* This parameter is required for alarms based on static thresholds, but should not be used for alarms based
* on anomaly detection models.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withThreshold(Double threshold) {
setThreshold(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.
*
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
*
*
* @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 values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
* @see ComparisonOperator
*/
public void setComparisonOperator(String comparisonOperator) {
this.comparisonOperator = comparisonOperator;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
*
*
* @return The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
,
* and GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
* @see ComparisonOperator
*/
public String getComparisonOperator() {
return this.comparisonOperator;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
*
*
* @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 values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ComparisonOperator
*/
public PutMetricAlarmRequest withComparisonOperator(String comparisonOperator) {
setComparisonOperator(comparisonOperator);
return this;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
*
*
* @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 values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
* @see ComparisonOperator
*/
public void setComparisonOperator(ComparisonOperator comparisonOperator) {
withComparisonOperator(comparisonOperator);
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* The values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
*
*
* @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 values LessThanLowerOrGreaterThanUpperThreshold
, LessThanLowerThreshold
, and
* GreaterThanUpperThreshold
are used only for alarms based on anomaly detection models.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ComparisonOperator
*/
public PutMetricAlarmRequest withComparisonOperator(ComparisonOperator comparisonOperator) {
this.comparisonOperator = comparisonOperator.toString();
return this;
}
/**
*
* Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the default
* behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
missing data
* even if you choose a different option for TreatMissingData
. When an AWS/DynamoDB
metric
* has missing data, alarms that evaluate that metric remain in their current state.
*
*
*
* @param treatMissingData
* Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the
* default behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
missing
* data even if you choose a different option for TreatMissingData
. When an
* AWS/DynamoDB
metric has missing data, alarms that evaluate that metric remain in their
* current state.
*
*/
public void setTreatMissingData(String treatMissingData) {
this.treatMissingData = treatMissingData;
}
/**
*
* Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the default
* behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
missing data
* even if you choose a different option for TreatMissingData
. When an AWS/DynamoDB
metric
* has missing data, alarms that evaluate that metric remain in their current state.
*
*
*
* @return Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the
* default behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
* missing data even if you choose a different option for TreatMissingData
. When an
* AWS/DynamoDB
metric has missing data, alarms that evaluate that metric remain in their
* current state.
*
*/
public String getTreatMissingData() {
return this.treatMissingData;
}
/**
*
* Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the default
* behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
missing data
* even if you choose a different option for TreatMissingData
. When an AWS/DynamoDB
metric
* has missing data, alarms that evaluate that metric remain in their current state.
*
*
*
* @param treatMissingData
* Sets how this alarm is to handle missing data points. If TreatMissingData
is omitted, the
* default behavior of missing
is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.
*
* Valid Values: breaching | notBreaching | ignore | missing
*
*
*
* Alarms that evaluate metrics in the AWS/DynamoDB
namespace always ignore
missing
* data even if you choose a different option for TreatMissingData
. When an
* AWS/DynamoDB
metric has missing data, alarms that evaluate that metric remain in their
* current state.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withTreatMissingData(String treatMissingData) {
setTreatMissingData(treatMissingData);
return this;
}
/**
*
* Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not change
* during periods with too few data points to be statistically significant. If you specify evaluate
or
* omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are
* available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
*
* Valid Values: evaluate | ignore
*
*
* @param evaluateLowSampleCountPercentile
* Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not
* change during periods with too few data points to be statistically significant. If you specify
* evaluate
or omit this parameter, the alarm is always evaluated and possibly changes state no
* matter how many data points are available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
* Valid Values: evaluate | ignore
*/
public void setEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) {
this.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile;
}
/**
*
* Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not change
* during periods with too few data points to be statistically significant. If you specify evaluate
or
* omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are
* available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
*
* Valid Values: evaluate | ignore
*
*
* @return Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not
* change during periods with too few data points to be statistically significant. If you specify
* evaluate
or omit this parameter, the alarm is always evaluated and possibly changes state no
* matter how many data points are available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
* Valid Values: evaluate | ignore
*/
public String getEvaluateLowSampleCountPercentile() {
return this.evaluateLowSampleCountPercentile;
}
/**
*
* Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not change
* during periods with too few data points to be statistically significant. If you specify evaluate
or
* omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are
* available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
*
* Valid Values: evaluate | ignore
*
*
* @param evaluateLowSampleCountPercentile
* Used only for alarms based on percentiles. If you specify ignore
, the alarm state does not
* change during periods with too few data points to be statistically significant. If you specify
* evaluate
or omit this parameter, the alarm is always evaluated and possibly changes state no
* matter how many data points are available. For more information, see Percentile-Based CloudWatch Alarms and Low Data Samples.
*
* Valid Values: evaluate | ignore
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) {
setEvaluateLowSampleCountPercentile(evaluateLowSampleCountPercentile);
return this;
}
/**
*
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result of a
* metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information, see MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters of PutMetricAlarm
in the same operation. Instead, you
* retrieve the metrics you are using in your math expression as part of the Metrics
array.
*
*
* @return An array of MetricDataQuery
structures that enable you to create an alarm based on the
* result of a metric math expression. For each PutMetricAlarm
operation, you must specify
* either MetricName
or a Metrics
array.
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information,
* see
* MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters of PutMetricAlarm
in
* the same operation. Instead, you retrieve the metrics you are using in your math expression as part of
* the Metrics
array.
*/
public java.util.List getMetrics() {
if (metrics == null) {
metrics = new com.amazonaws.internal.SdkInternalList();
}
return metrics;
}
/**
*
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result of a
* metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information, see MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters of PutMetricAlarm
in the same operation. Instead, you
* retrieve the metrics you are using in your math expression as part of the Metrics
array.
*
*
* @param metrics
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result
* of a metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information,
* see
* MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters of PutMetricAlarm
in the
* same operation. Instead, you retrieve the metrics you are using in your math expression as part of the
* Metrics
array.
*/
public void setMetrics(java.util.Collection metrics) {
if (metrics == null) {
this.metrics = null;
return;
}
this.metrics = new com.amazonaws.internal.SdkInternalList(metrics);
}
/**
*
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result of a
* metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information, see MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters of PutMetricAlarm
in the same operation. Instead, you
* retrieve the metrics you are using in your math expression as part of the Metrics
array.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMetrics(java.util.Collection)} or {@link #withMetrics(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param metrics
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result
* of a metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information,
* see
* MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters of PutMetricAlarm
in the
* same operation. Instead, you retrieve the metrics you are using in your math expression as part of the
* Metrics
array.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withMetrics(MetricDataQuery... metrics) {
if (this.metrics == null) {
setMetrics(new com.amazonaws.internal.SdkInternalList(metrics.length));
}
for (MetricDataQuery ele : metrics) {
this.metrics.add(ele);
}
return this;
}
/**
*
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result of a
* metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information, see MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
, Statistic
,
* or ExtendedStatistic
parameters of PutMetricAlarm
in the same operation. Instead, you
* retrieve the metrics you are using in your math expression as part of the Metrics
array.
*
*
* @param metrics
* An array of MetricDataQuery
structures that enable you to create an alarm based on the result
* of a metric math expression. For each PutMetricAlarm
operation, you must specify either
* MetricName
or a Metrics
array.
*
* Each item in the Metrics
array either retrieves a metric or performs a math expression.
*
*
* One item in the Metrics
array is the expression that the alarm watches. You designate this
* expression by setting ReturnData
to true for this object in the array. For more information,
* see
* MetricDataQuery.
*
*
* If you use the Metrics
parameter, you cannot include the Namespace
,
* MetricName
, Dimensions
, Period
, Unit
,
* Statistic
, or ExtendedStatistic
parameters of PutMetricAlarm
in the
* same operation. Instead, you retrieve the metrics you are using in your math expression as part of the
* Metrics
array.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withMetrics(java.util.Collection metrics) {
setMetrics(metrics);
return this;
}
/**
*
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be
* able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions by
* granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored.
* To change the tags of an existing alarm, use TagResource or
* UntagResource.
*
*
* @return A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an
* alarm. To be able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions
* by granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are
* ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be
* able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions by
* granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored.
* To change the tags of an existing alarm, use TagResource or
* UntagResource.
*
*
* @param tags
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm.
* To be able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions
* by granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are
* ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be
* able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions by
* granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored.
* To change the tags of an existing alarm, use TagResource or
* UntagResource.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm.
* To be able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions
* by granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are
* ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be
* able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions by
* granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored.
* To change the tags of an existing alarm, use TagResource or
* UntagResource.
*
*
* @param tags
* A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm.
* To be able to associate tags with the alarm when you create the alarm, you must have the
* cloudwatch:TagResource
permission.
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions
* by granting a user permission to access or change only resources with certain tag values.
*
*
* If you are using this operation to update an existing alarm, any tags you specify in this parameter are
* ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
*
*
* @param thresholdMetricId
* If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this
* page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
*/
public void setThresholdMetricId(String thresholdMetricId) {
this.thresholdMetricId = thresholdMetricId;
}
/**
*
* If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
*
*
* @return If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this
* page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
*/
public String getThresholdMetricId() {
return this.thresholdMetricId;
}
/**
*
* If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
*
*
* @param thresholdMetricId
* If this is an alarm based on an anomaly detection model, make this value match the ID of the
* ANOMALY_DETECTION_BAND
function.
*
* For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this
* page.
*
*
* If your alarm uses this parameter, it cannot have Auto Scaling actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutMetricAlarmRequest withThresholdMetricId(String thresholdMetricId) {
setThresholdMetricId(thresholdMetricId);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAlarmName() != null)
sb.append("AlarmName: ").append(getAlarmName()).append(",");
if (getAlarmDescription() != null)
sb.append("AlarmDescription: ").append(getAlarmDescription()).append(",");
if (getActionsEnabled() != null)
sb.append("ActionsEnabled: ").append(getActionsEnabled()).append(",");
if (getOKActions() != null)
sb.append("OKActions: ").append(getOKActions()).append(",");
if (getAlarmActions() != null)
sb.append("AlarmActions: ").append(getAlarmActions()).append(",");
if (getInsufficientDataActions() != null)
sb.append("InsufficientDataActions: ").append(getInsufficientDataActions()).append(",");
if (getMetricName() != null)
sb.append("MetricName: ").append(getMetricName()).append(",");
if (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getStatistic() != null)
sb.append("Statistic: ").append(getStatistic()).append(",");
if (getExtendedStatistic() != null)
sb.append("ExtendedStatistic: ").append(getExtendedStatistic()).append(",");
if (getDimensions() != null)
sb.append("Dimensions: ").append(getDimensions()).append(",");
if (getPeriod() != null)
sb.append("Period: ").append(getPeriod()).append(",");
if (getUnit() != null)
sb.append("Unit: ").append(getUnit()).append(",");
if (getEvaluationPeriods() != null)
sb.append("EvaluationPeriods: ").append(getEvaluationPeriods()).append(",");
if (getDatapointsToAlarm() != null)
sb.append("DatapointsToAlarm: ").append(getDatapointsToAlarm()).append(",");
if (getThreshold() != null)
sb.append("Threshold: ").append(getThreshold()).append(",");
if (getComparisonOperator() != null)
sb.append("ComparisonOperator: ").append(getComparisonOperator()).append(",");
if (getTreatMissingData() != null)
sb.append("TreatMissingData: ").append(getTreatMissingData()).append(",");
if (getEvaluateLowSampleCountPercentile() != null)
sb.append("EvaluateLowSampleCountPercentile: ").append(getEvaluateLowSampleCountPercentile()).append(",");
if (getMetrics() != null)
sb.append("Metrics: ").append(getMetrics()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getThresholdMetricId() != null)
sb.append("ThresholdMetricId: ").append(getThresholdMetricId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutMetricAlarmRequest == false)
return false;
PutMetricAlarmRequest other = (PutMetricAlarmRequest) obj;
if (other.getAlarmName() == null ^ this.getAlarmName() == null)
return false;
if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == false)
return false;
if (other.getAlarmDescription() == null ^ this.getAlarmDescription() == null)
return false;
if (other.getAlarmDescription() != null && other.getAlarmDescription().equals(this.getAlarmDescription()) == false)
return false;
if (other.getActionsEnabled() == null ^ this.getActionsEnabled() == null)
return false;
if (other.getActionsEnabled() != null && other.getActionsEnabled().equals(this.getActionsEnabled()) == false)
return false;
if (other.getOKActions() == null ^ this.getOKActions() == null)
return false;
if (other.getOKActions() != null && other.getOKActions().equals(this.getOKActions()) == false)
return false;
if (other.getAlarmActions() == null ^ this.getAlarmActions() == null)
return false;
if (other.getAlarmActions() != null && other.getAlarmActions().equals(this.getAlarmActions()) == false)
return false;
if (other.getInsufficientDataActions() == null ^ this.getInsufficientDataActions() == null)
return false;
if (other.getInsufficientDataActions() != null && other.getInsufficientDataActions().equals(this.getInsufficientDataActions()) == false)
return false;
if (other.getMetricName() == null ^ this.getMetricName() == null)
return false;
if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false)
return false;
if (other.getNamespace() == null ^ this.getNamespace() == null)
return false;
if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false)
return false;
if (other.getStatistic() == null ^ this.getStatistic() == null)
return false;
if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false)
return false;
if (other.getExtendedStatistic() == null ^ this.getExtendedStatistic() == null)
return false;
if (other.getExtendedStatistic() != null && other.getExtendedStatistic().equals(this.getExtendedStatistic()) == false)
return false;
if (other.getDimensions() == null ^ this.getDimensions() == null)
return false;
if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false)
return false;
if (other.getPeriod() == null ^ this.getPeriod() == null)
return false;
if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false)
return false;
if (other.getUnit() == null ^ this.getUnit() == null)
return false;
if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false)
return false;
if (other.getEvaluationPeriods() == null ^ this.getEvaluationPeriods() == null)
return false;
if (other.getEvaluationPeriods() != null && other.getEvaluationPeriods().equals(this.getEvaluationPeriods()) == false)
return false;
if (other.getDatapointsToAlarm() == null ^ this.getDatapointsToAlarm() == null)
return false;
if (other.getDatapointsToAlarm() != null && other.getDatapointsToAlarm().equals(this.getDatapointsToAlarm()) == false)
return false;
if (other.getThreshold() == null ^ this.getThreshold() == null)
return false;
if (other.getThreshold() != null && other.getThreshold().equals(this.getThreshold()) == false)
return false;
if (other.getComparisonOperator() == null ^ this.getComparisonOperator() == null)
return false;
if (other.getComparisonOperator() != null && other.getComparisonOperator().equals(this.getComparisonOperator()) == false)
return false;
if (other.getTreatMissingData() == null ^ this.getTreatMissingData() == null)
return false;
if (other.getTreatMissingData() != null && other.getTreatMissingData().equals(this.getTreatMissingData()) == false)
return false;
if (other.getEvaluateLowSampleCountPercentile() == null ^ this.getEvaluateLowSampleCountPercentile() == null)
return false;
if (other.getEvaluateLowSampleCountPercentile() != null
&& other.getEvaluateLowSampleCountPercentile().equals(this.getEvaluateLowSampleCountPercentile()) == false)
return false;
if (other.getMetrics() == null ^ this.getMetrics() == null)
return false;
if (other.getMetrics() != null && other.getMetrics().equals(this.getMetrics()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getThresholdMetricId() == null ^ this.getThresholdMetricId() == null)
return false;
if (other.getThresholdMetricId() != null && other.getThresholdMetricId().equals(this.getThresholdMetricId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAlarmName() == null) ? 0 : getAlarmName().hashCode());
hashCode = prime * hashCode + ((getAlarmDescription() == null) ? 0 : getAlarmDescription().hashCode());
hashCode = prime * hashCode + ((getActionsEnabled() == null) ? 0 : getActionsEnabled().hashCode());
hashCode = prime * hashCode + ((getOKActions() == null) ? 0 : getOKActions().hashCode());
hashCode = prime * hashCode + ((getAlarmActions() == null) ? 0 : getAlarmActions().hashCode());
hashCode = prime * hashCode + ((getInsufficientDataActions() == null) ? 0 : getInsufficientDataActions().hashCode());
hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode());
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode());
hashCode = prime * hashCode + ((getExtendedStatistic() == null) ? 0 : getExtendedStatistic().hashCode());
hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode());
hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
hashCode = prime * hashCode + ((getEvaluationPeriods() == null) ? 0 : getEvaluationPeriods().hashCode());
hashCode = prime * hashCode + ((getDatapointsToAlarm() == null) ? 0 : getDatapointsToAlarm().hashCode());
hashCode = prime * hashCode + ((getThreshold() == null) ? 0 : getThreshold().hashCode());
hashCode = prime * hashCode + ((getComparisonOperator() == null) ? 0 : getComparisonOperator().hashCode());
hashCode = prime * hashCode + ((getTreatMissingData() == null) ? 0 : getTreatMissingData().hashCode());
hashCode = prime * hashCode + ((getEvaluateLowSampleCountPercentile() == null) ? 0 : getEvaluateLowSampleCountPercentile().hashCode());
hashCode = prime * hashCode + ((getMetrics() == null) ? 0 : getMetrics().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getThresholdMetricId() == null) ? 0 : getThresholdMetricId().hashCode());
return hashCode;
}
@Override
public PutMetricAlarmRequest clone() {
return (PutMetricAlarmRequest) super.clone();
}
}