AWS SDK for C++

AWS SDK for C++ Version 1.11.788

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aws::CloudWatch::Model::PutMetricAlarmRequest Class Reference

#include <PutMetricAlarmRequest.h>

Inheritance diagram for Aws::CloudWatch::Model::PutMetricAlarmRequest:
[legend]

Public Member Functions

AWS_CLOUDWATCH_API PutMetricAlarmRequest ()=default
 
virtual const char * GetServiceRequestName () const override
 
AWS_CLOUDWATCH_API Aws::String SerializePayload () const override
 
AWS_CLOUDWATCH_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders () const override
 
const Aws::StringGetAlarmName () const
 
bool AlarmNameHasBeenSet () const
 
template<typename AlarmNameT = Aws::String>
void SetAlarmName (AlarmNameT &&value)
 
template<typename AlarmNameT = Aws::String>
PutMetricAlarmRequestWithAlarmName (AlarmNameT &&value)
 
 
 
template<typename AlarmDescriptionT = Aws::String>
void SetAlarmDescription (AlarmDescriptionT &&value)
 
template<typename AlarmDescriptionT = Aws::String>
PutMetricAlarmRequestWithAlarmDescription (AlarmDescriptionT &&value)
 
bool GetActionsEnabled () const
 
 
void SetActionsEnabled (bool value)
 
 
const Aws::Vector< Aws::String > & GetOKActions () const
 
bool OKActionsHasBeenSet () const
 
template<typename OKActionsT = Aws::Vector<Aws::String>>
void SetOKActions (OKActionsT &&value)
 
template<typename OKActionsT = Aws::Vector<Aws::String>>
PutMetricAlarmRequestWithOKActions (OKActionsT &&value)
 
template<typename OKActionsT = Aws::String>
PutMetricAlarmRequestAddOKActions (OKActionsT &&value)
 
 
bool AlarmActionsHasBeenSet () const
 
template<typename AlarmActionsT = Aws::Vector<Aws::String>>
void SetAlarmActions (AlarmActionsT &&value)
 
template<typename AlarmActionsT = Aws::Vector<Aws::String>>
PutMetricAlarmRequestWithAlarmActions (AlarmActionsT &&value)
 
template<typename AlarmActionsT = Aws::String>
PutMetricAlarmRequestAddAlarmActions (AlarmActionsT &&value)
 
 
 
template<typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
void SetInsufficientDataActions (InsufficientDataActionsT &&value)
 
template<typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
PutMetricAlarmRequestWithInsufficientDataActions (InsufficientDataActionsT &&value)
 
template<typename InsufficientDataActionsT = Aws::String>
PutMetricAlarmRequestAddInsufficientDataActions (InsufficientDataActionsT &&value)
 
const Aws::StringGetMetricName () const
 
bool MetricNameHasBeenSet () const
 
template<typename MetricNameT = Aws::String>
void SetMetricName (MetricNameT &&value)
 
template<typename MetricNameT = Aws::String>
PutMetricAlarmRequestWithMetricName (MetricNameT &&value)
 
const Aws::StringGetNamespace () const
 
bool NamespaceHasBeenSet () const
 
template<typename NamespaceT = Aws::String>
void SetNamespace (NamespaceT &&value)
 
template<typename NamespaceT = Aws::String>
PutMetricAlarmRequestWithNamespace (NamespaceT &&value)
 
 
bool StatisticHasBeenSet () const
 
void SetStatistic (Statistic value)
 
 
 
 
template<typename ExtendedStatisticT = Aws::String>
void SetExtendedStatistic (ExtendedStatisticT &&value)
 
template<typename ExtendedStatisticT = Aws::String>
PutMetricAlarmRequestWithExtendedStatistic (ExtendedStatisticT &&value)
 
const Aws::Vector< Dimension > & GetDimensions () const
 
bool DimensionsHasBeenSet () const
 
template<typename DimensionsT = Aws::Vector<Dimension>>
void SetDimensions (DimensionsT &&value)
 
template<typename DimensionsT = Aws::Vector<Dimension>>
PutMetricAlarmRequestWithDimensions (DimensionsT &&value)
 
template<typename DimensionsT = Dimension>
PutMetricAlarmRequestAddDimensions (DimensionsT &&value)
 
int GetPeriod () const
 
bool PeriodHasBeenSet () const
 
void SetPeriod (int value)
 
 
 
bool UnitHasBeenSet () const
 
void SetUnit (StandardUnit value)
 
 
int GetEvaluationPeriods () const
 
 
void SetEvaluationPeriods (int value)
 
 
int GetDatapointsToAlarm () const
 
 
void SetDatapointsToAlarm (int value)
 
 
double GetThreshold () const
 
bool ThresholdHasBeenSet () const
 
void SetThreshold (double value)
 
 
 
 
 
 
 
 
template<typename TreatMissingDataT = Aws::String>
void SetTreatMissingData (TreatMissingDataT &&value)
 
template<typename TreatMissingDataT = Aws::String>
PutMetricAlarmRequestWithTreatMissingData (TreatMissingDataT &&value)
 
 
 
template<typename EvaluateLowSampleCountPercentileT = Aws::String>
void SetEvaluateLowSampleCountPercentile (EvaluateLowSampleCountPercentileT &&value)
 
template<typename EvaluateLowSampleCountPercentileT = Aws::String>
PutMetricAlarmRequestWithEvaluateLowSampleCountPercentile (EvaluateLowSampleCountPercentileT &&value)
 
 
bool MetricsHasBeenSet () const
 
template<typename MetricsT = Aws::Vector<MetricDataQuery>>
void SetMetrics (MetricsT &&value)
 
template<typename MetricsT = Aws::Vector<MetricDataQuery>>
PutMetricAlarmRequestWithMetrics (MetricsT &&value)
 
template<typename MetricsT = MetricDataQuery>
PutMetricAlarmRequestAddMetrics (MetricsT &&value)
 
const Aws::Vector< Tag > & GetTags () const
 
bool TagsHasBeenSet () const
 
template<typename TagsT = Aws::Vector<Tag>>
void SetTags (TagsT &&value)
 
template<typename TagsT = Aws::Vector<Tag>>
PutMetricAlarmRequestWithTags (TagsT &&value)
 
template<typename TagsT = Tag>
PutMetricAlarmRequestAddTags (TagsT &&value)
 
 
 
template<typename ThresholdMetricIdT = Aws::String>
void SetThresholdMetricId (ThresholdMetricIdT &&value)
 
template<typename ThresholdMetricIdT = Aws::String>
PutMetricAlarmRequestWithThresholdMetricId (ThresholdMetricIdT &&value)
 
 
 
template<typename EvaluationCriteriaT = EvaluationCriteria>
void SetEvaluationCriteria (EvaluationCriteriaT &&value)
 
template<typename EvaluationCriteriaT = EvaluationCriteria>
PutMetricAlarmRequestWithEvaluationCriteria (EvaluationCriteriaT &&value)
 
int GetEvaluationInterval () const
 
 
void SetEvaluationInterval (int value)
 
 

Public Member Functions inherited from Aws::CloudWatch::CloudWatchRequest

virtual ~CloudWatchRequest ()
 
 
 

Public Member Functions inherited from Aws::AmazonSerializableWebServiceRequest

 
 
std::shared_ptr< Aws::IOStreamGetBody () const override
 

Public Member Functions inherited from Aws::AmazonWebServiceRequest

 
virtual ~AmazonWebServiceRequest ()=default
 
 
virtual void SetAdditionalCustomHeaderValue (const Aws::String &headerName, const Aws::String &headerValue)
 
virtual void AddQueryStringParameters (Aws::Http::URI &uri) const
 
virtual void PutToPresignedUrl (Aws::Http::URI &uri) const
 
virtual bool IsStreaming () const
 
virtual bool IsEventStreamRequest () const
 
virtual bool HasEventStreamResponse () const
 
virtual bool SignBody () const
 
virtual bool HasEmbeddedError (Aws::IOStream &body, const Aws::Http::HeaderValueCollection &header) const
 
virtual bool IsChunked () const
 
virtual void SetRequestSignedHandler (const RequestSignedHandler &handler)
 
 
 
 
 
 
 
 
 
virtual bool ShouldComputeContentMd5 () const
 
virtual bool ShouldValidateResponseChecksum () const
 
 
 
virtual void SetServiceSpecificParameters (const std::shared_ptr< Http::ServiceSpecificParameters > &serviceSpecificParameters) const
 
 
 
 
 
 
virtual bool RequestChecksumRequired () const
 
 
void SetRetryContext (const RetryContext &context) const
 
 
virtual void SetHeadersReceivedEventHandler (const Aws::Http::HeadersReceivedEventHandler &headersReceivedEventHandler)
 
virtual void SetHeadersReceivedEventHandler (Aws::Http::HeadersReceivedEventHandler &&headersReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (const Aws::Http::DataReceivedEventHandler &dataReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (Aws::Http::DataReceivedEventHandler &&dataReceivedEventHandler)
 
virtual void SetDataSentEventHandler (const Aws::Http::DataSentEventHandler &dataSentEventHandler)
 
virtual void SetDataSentEventHandler (Aws::Http::DataSentEventHandler &&dataSentEventHandler)
 
virtual void SetContinueRequestHandler (const Aws::Http::ContinueRequestHandler &continueRequestHandler)
 
virtual void SetContinueRequestHandler (Aws::Http::ContinueRequestHandler &&continueRequestHandler)
 
virtual void SetRequestRetryHandler (const RequestRetryHandler &handler)
 
 
virtual void SetHeadersReceivedEventHandler (const Aws::Http::HeadersReceivedEventHandler &headersReceivedEventHandler)
 
virtual void SetHeadersReceivedEventHandler (Aws::Http::HeadersReceivedEventHandler &&headersReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (const Aws::Http::DataReceivedEventHandler &dataReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (Aws::Http::DataReceivedEventHandler &&dataReceivedEventHandler)
 
virtual void SetDataSentEventHandler (const Aws::Http::DataSentEventHandler &dataSentEventHandler)
 
virtual void SetDataSentEventHandler (Aws::Http::DataSentEventHandler &&dataSentEventHandler)
 
virtual void SetContinueRequestHandler (const Aws::Http::ContinueRequestHandler &continueRequestHandler)
 
virtual void SetContinueRequestHandler (Aws::Http::ContinueRequestHandler &&continueRequestHandler)
 
virtual void SetRequestRetryHandler (const RequestRetryHandler &handler)
 
 

Additional Inherited Members

Public Types inherited from Aws::CloudWatch::CloudWatchRequest

 
 

Public Types inherited from Aws::AmazonWebServiceRequest

 

Protected Member Functions inherited from Aws::AmazonWebServiceRequest

virtual void DumpBodyToUrl (Aws::Http::URI &uri) const
 

Protected Attributes inherited from Aws::AmazonWebServiceRequest

 

Detailed Description

Definition at line 27 of file PutMetricAlarmRequest.h.

Constructor & Destructor Documentation

◆ PutMetricAlarmRequest()

AWS_CLOUDWATCH_API Aws::CloudWatch::Model::PutMetricAlarmRequest::PutMetricAlarmRequest ( )
default

Member Function Documentation

◆ ActionsEnabledHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::ActionsEnabledHasBeenSet ( ) const
inline

Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.

Definition at line 85 of file PutMetricAlarmRequest.h.

◆ AddAlarmActions()

template<typename AlarmActionsT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::AddAlarmActions ( AlarmActionsT &&  value)
inline

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

Start a Amazon Q Developer operational investigation

arn:aws:aiops:region:account-id:investigation-group:investigation-group-id

Definition at line 198 of file PutMetricAlarmRequest.h.

◆ AddDimensions()

template<typename DimensionsT = Dimension>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::AddDimensions ( DimensionsT &&  value)
inline

The dimensions for the metric specified in MetricName.

Definition at line 375 of file PutMetricAlarmRequest.h.

◆ AddInsufficientDataActions()

template<typename InsufficientDataActionsT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::AddInsufficientDataActions ( InsufficientDataActionsT &&  value)
inline

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

Definition at line 252 of file PutMetricAlarmRequest.h.

◆ AddMetrics()

template<typename MetricsT = MetricDataQuery>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::AddMetrics ( MetricsT &&  value)
inline

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, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 612 of file PutMetricAlarmRequest.h.

◆ AddOKActions()

template<typename OKActionsT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::AddOKActions ( OKActionsT &&  value)
inline

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

Definition at line 142 of file PutMetricAlarmRequest.h.

◆ AddTags()

template<typename TagsT = Tag>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::AddTags ( TagsT &&  value)
inline

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.

To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions.

Definition at line 649 of file PutMetricAlarmRequest.h.

◆ AlarmActionsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::AlarmActionsHasBeenSet ( ) const
inline

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

Start a Amazon Q Developer operational investigation

arn:aws:aiops:region:account-id:investigation-group:investigation-group-id

Definition at line 186 of file PutMetricAlarmRequest.h.

◆ AlarmDescriptionHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::AlarmDescriptionHasBeenSet ( ) const
inline

The description for the alarm.

Definition at line 66 of file PutMetricAlarmRequest.h.

◆ AlarmNameHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::AlarmNameHasBeenSet ( ) const
inline

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

Definition at line 48 of file PutMetricAlarmRequest.h.

◆ ComparisonOperatorHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::ComparisonOperatorHasBeenSet ( ) const
inline

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.

Definition at line 514 of file PutMetricAlarmRequest.h.

◆ DatapointsToAlarmHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::DatapointsToAlarmHasBeenSet ( ) const
inline

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.

Definition at line 476 of file PutMetricAlarmRequest.h.

◆ DimensionsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::DimensionsHasBeenSet ( ) const
inline

The dimensions for the metric specified in MetricName.

Definition at line 363 of file PutMetricAlarmRequest.h.

◆ EvaluateLowSampleCountPercentileHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::EvaluateLowSampleCountPercentileHasBeenSet ( ) const
inline

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

Definition at line 567 of file PutMetricAlarmRequest.h.

◆ EvaluationCriteriaHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::EvaluationCriteriaHasBeenSet ( ) const
inline

The evaluation criteria for the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

If you use the EvaluationCriteria parameter, you cannot include the Namespace, MetricName, Dimensions, Period, Unit, Statistic, ExtendedStatistic, Metrics, Threshold, ComparisonOperator, ThresholdMetricId, EvaluationPeriods, or DatapointsToAlarm parameters of PutMetricAlarm in the same operation. Instead, all evaluation parameters are defined within this structure.

For an example of how to use this parameter, see the PromQL alarm example on this page.

Definition at line 694 of file PutMetricAlarmRequest.h.

◆ EvaluationIntervalHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::EvaluationIntervalHasBeenSet ( ) const
inline

The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.

This parameter is required for alarms that use EvaluationCriteria, and cannot be specified for alarms configured with MetricName or Metrics.

Definition at line 715 of file PutMetricAlarmRequest.h.

◆ EvaluationPeriodsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::EvaluationPeriodsHasBeenSet ( ) const
inline

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.

Definition at line 456 of file PutMetricAlarmRequest.h.

◆ ExtendedStatisticHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::ExtendedStatisticHasBeenSet ( ) const
inline

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.

Definition at line 345 of file PutMetricAlarmRequest.h.

◆ GetActionsEnabled()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::GetActionsEnabled ( ) const
inline

Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.

Definition at line 84 of file PutMetricAlarmRequest.h.

◆ GetAlarmActions()

const Aws::Vector< Aws::String > & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetAlarmActions ( ) const
inline

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

Start a Amazon Q Developer operational investigation

arn:aws:aiops:region:account-id:investigation-group:investigation-group-id

Definition at line 185 of file PutMetricAlarmRequest.h.

◆ GetAlarmDescription()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetAlarmDescription ( ) const
inline

The description for the alarm.

Definition at line 65 of file PutMetricAlarmRequest.h.

◆ GetAlarmName()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetAlarmName ( ) const
inline

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

Definition at line 47 of file PutMetricAlarmRequest.h.

◆ GetComparisonOperator()

ComparisonOperator Aws::CloudWatch::Model::PutMetricAlarmRequest::GetComparisonOperator ( ) const
inline

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.

Definition at line 513 of file PutMetricAlarmRequest.h.

◆ GetDatapointsToAlarm()

int Aws::CloudWatch::Model::PutMetricAlarmRequest::GetDatapointsToAlarm ( ) const
inline

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.

Definition at line 475 of file PutMetricAlarmRequest.h.

◆ GetDimensions()

const Aws::Vector< Dimension > & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetDimensions ( ) const
inline

The dimensions for the metric specified in MetricName.

Definition at line 362 of file PutMetricAlarmRequest.h.

◆ GetEvaluateLowSampleCountPercentile()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetEvaluateLowSampleCountPercentile ( ) const
inline

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

Definition at line 566 of file PutMetricAlarmRequest.h.

◆ GetEvaluationCriteria()

const EvaluationCriteria & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetEvaluationCriteria ( ) const
inline

The evaluation criteria for the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

If you use the EvaluationCriteria parameter, you cannot include the Namespace, MetricName, Dimensions, Period, Unit, Statistic, ExtendedStatistic, Metrics, Threshold, ComparisonOperator, ThresholdMetricId, EvaluationPeriods, or DatapointsToAlarm parameters of PutMetricAlarm in the same operation. Instead, all evaluation parameters are defined within this structure.

For an example of how to use this parameter, see the PromQL alarm example on this page.

Definition at line 693 of file PutMetricAlarmRequest.h.

◆ GetEvaluationInterval()

int Aws::CloudWatch::Model::PutMetricAlarmRequest::GetEvaluationInterval ( ) const
inline

The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.

This parameter is required for alarms that use EvaluationCriteria, and cannot be specified for alarms configured with MetricName or Metrics.

Definition at line 714 of file PutMetricAlarmRequest.h.

◆ GetEvaluationPeriods()

int Aws::CloudWatch::Model::PutMetricAlarmRequest::GetEvaluationPeriods ( ) const
inline

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.

Definition at line 455 of file PutMetricAlarmRequest.h.

◆ GetExtendedStatistic()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetExtendedStatistic ( ) const
inline

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.

Definition at line 344 of file PutMetricAlarmRequest.h.

◆ GetInsufficientDataActions()

const Aws::Vector< Aws::String > & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetInsufficientDataActions ( ) const
inline

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

Definition at line 239 of file PutMetricAlarmRequest.h.

◆ GetMetricName()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetMetricName ( ) const
inline

The name for the metric associated with the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 271 of file PutMetricAlarmRequest.h.

◆ GetMetrics()

const Aws::Vector< MetricDataQuery > & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetMetrics ( ) const
inline

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, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 599 of file PutMetricAlarmRequest.h.

◆ GetNamespace()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetNamespace ( ) const
inline

The namespace for the metric associated specified in MetricName.

Definition at line 290 of file PutMetricAlarmRequest.h.

◆ GetOKActions()

const Aws::Vector< Aws::String > & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetOKActions ( ) const
inline

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

Definition at line 129 of file PutMetricAlarmRequest.h.

◆ GetPeriod()

int Aws::CloudWatch::Model::PutMetricAlarmRequest::GetPeriod ( ) const
inline

The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 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, 20, or 30 only for metrics that are stored by a PutMetricData call with a StorageResolution of 1. If you specify a period of 10, 20, 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, 20, 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 seven days, so Period multiplied by EvaluationPeriods can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).

Definition at line 405 of file PutMetricAlarmRequest.h.

◆ GetRequestSpecificHeaders()

AWS_CLOUDWATCH_API Aws::Http::HeaderValueCollection Aws::CloudWatch::Model::PutMetricAlarmRequest::GetRequestSpecificHeaders ( ) const
overridevirtual

◆ GetServiceRequestName()

virtual const char * Aws::CloudWatch::Model::PutMetricAlarmRequest::GetServiceRequestName ( ) const
inlineoverridevirtual

Implements Aws::AmazonWebServiceRequest.

Definition at line 35 of file PutMetricAlarmRequest.h.

◆ GetStatistic()

Statistic Aws::CloudWatch::Model::PutMetricAlarmRequest::GetStatistic ( ) const
inline

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.

Definition at line 312 of file PutMetricAlarmRequest.h.

◆ GetTags()

const Aws::Vector< Tag > & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetTags ( ) const
inline

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.

To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions.

Definition at line 636 of file PutMetricAlarmRequest.h.

◆ GetThreshold()

double Aws::CloudWatch::Model::PutMetricAlarmRequest::GetThreshold ( ) const
inline

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.

Definition at line 493 of file PutMetricAlarmRequest.h.

◆ GetThresholdMetricId()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetThresholdMetricId ( ) const
inline

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.

Definition at line 664 of file PutMetricAlarmRequest.h.

◆ GetTreatMissingData()

const Aws::String & Aws::CloudWatch::Model::PutMetricAlarmRequest::GetTreatMissingData ( ) const
inline

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.

This parameter is not applicable to PromQL alarms.

Definition at line 540 of file PutMetricAlarmRequest.h.

◆ GetUnit()

StandardUnit Aws::CloudWatch::Model::PutMetricAlarmRequest::GetUnit ( ) const
inline

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.

Definition at line 436 of file PutMetricAlarmRequest.h.

◆ InsufficientDataActionsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::InsufficientDataActionsHasBeenSet ( ) const
inline

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

Definition at line 240 of file PutMetricAlarmRequest.h.

◆ MetricNameHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::MetricNameHasBeenSet ( ) const
inline

The name for the metric associated with the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 272 of file PutMetricAlarmRequest.h.

◆ MetricsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::MetricsHasBeenSet ( ) const
inline

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, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 600 of file PutMetricAlarmRequest.h.

◆ NamespaceHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::NamespaceHasBeenSet ( ) const
inline

The namespace for the metric associated specified in MetricName.

Definition at line 291 of file PutMetricAlarmRequest.h.

◆ OKActionsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::OKActionsHasBeenSet ( ) const
inline

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

Definition at line 130 of file PutMetricAlarmRequest.h.

◆ PeriodHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::PeriodHasBeenSet ( ) const
inline

The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 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, 20, or 30 only for metrics that are stored by a PutMetricData call with a StorageResolution of 1. If you specify a period of 10, 20, 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, 20, 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 seven days, so Period multiplied by EvaluationPeriods can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).

Definition at line 406 of file PutMetricAlarmRequest.h.

◆ SerializePayload()

AWS_CLOUDWATCH_API Aws::String Aws::CloudWatch::Model::PutMetricAlarmRequest::SerializePayload ( ) const
overridevirtual

◆ SetActionsEnabled()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetActionsEnabled ( bool  value)
inline

Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.

Definition at line 86 of file PutMetricAlarmRequest.h.

◆ SetAlarmActions()

template<typename AlarmActionsT = Aws::Vector<Aws::String>>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetAlarmActions ( AlarmActionsT &&  value)
inline

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

Start a Amazon Q Developer operational investigation

arn:aws:aiops:region:account-id:investigation-group:investigation-group-id

Definition at line 188 of file PutMetricAlarmRequest.h.

◆ SetAlarmDescription()

template<typename AlarmDescriptionT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetAlarmDescription ( AlarmDescriptionT &&  value)
inline

The description for the alarm.

Definition at line 68 of file PutMetricAlarmRequest.h.

◆ SetAlarmName()

template<typename AlarmNameT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetAlarmName ( AlarmNameT &&  value)
inline

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

Definition at line 50 of file PutMetricAlarmRequest.h.

◆ SetComparisonOperator()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetComparisonOperator ( ComparisonOperator  value)
inline

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.

Definition at line 515 of file PutMetricAlarmRequest.h.

◆ SetDatapointsToAlarm()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetDatapointsToAlarm ( int  value)
inline

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.

Definition at line 477 of file PutMetricAlarmRequest.h.

◆ SetDimensions()

template<typename DimensionsT = Aws::Vector<Dimension>>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetDimensions ( DimensionsT &&  value)
inline

The dimensions for the metric specified in MetricName.

Definition at line 365 of file PutMetricAlarmRequest.h.

◆ SetEvaluateLowSampleCountPercentile()

template<typename EvaluateLowSampleCountPercentileT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetEvaluateLowSampleCountPercentile ( EvaluateLowSampleCountPercentileT &&  value)
inline

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

Definition at line 569 of file PutMetricAlarmRequest.h.

◆ SetEvaluationCriteria()

template<typename EvaluationCriteriaT = EvaluationCriteria>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetEvaluationCriteria ( EvaluationCriteriaT &&  value)
inline

The evaluation criteria for the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

If you use the EvaluationCriteria parameter, you cannot include the Namespace, MetricName, Dimensions, Period, Unit, Statistic, ExtendedStatistic, Metrics, Threshold, ComparisonOperator, ThresholdMetricId, EvaluationPeriods, or DatapointsToAlarm parameters of PutMetricAlarm in the same operation. Instead, all evaluation parameters are defined within this structure.

For an example of how to use this parameter, see the PromQL alarm example on this page.

Definition at line 696 of file PutMetricAlarmRequest.h.

◆ SetEvaluationInterval()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetEvaluationInterval ( int  value)
inline

The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.

This parameter is required for alarms that use EvaluationCriteria, and cannot be specified for alarms configured with MetricName or Metrics.

Definition at line 716 of file PutMetricAlarmRequest.h.

◆ SetEvaluationPeriods()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetEvaluationPeriods ( int  value)
inline

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.

Definition at line 457 of file PutMetricAlarmRequest.h.

◆ SetExtendedStatistic()

template<typename ExtendedStatisticT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetExtendedStatistic ( ExtendedStatisticT &&  value)
inline

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.

Definition at line 347 of file PutMetricAlarmRequest.h.

◆ SetInsufficientDataActions()

template<typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetInsufficientDataActions ( InsufficientDataActionsT &&  value)
inline

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

Definition at line 242 of file PutMetricAlarmRequest.h.

◆ SetMetricName()

template<typename MetricNameT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetMetricName ( MetricNameT &&  value)
inline

The name for the metric associated with the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 274 of file PutMetricAlarmRequest.h.

◆ SetMetrics()

template<typename MetricsT = Aws::Vector<MetricDataQuery>>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetMetrics ( MetricsT &&  value)
inline

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, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 602 of file PutMetricAlarmRequest.h.

◆ SetNamespace()

template<typename NamespaceT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetNamespace ( NamespaceT &&  value)
inline

The namespace for the metric associated specified in MetricName.

Definition at line 293 of file PutMetricAlarmRequest.h.

◆ SetOKActions()

template<typename OKActionsT = Aws::Vector<Aws::String>>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetOKActions ( OKActionsT &&  value)
inline

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

Definition at line 132 of file PutMetricAlarmRequest.h.

◆ SetPeriod()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetPeriod ( int  value)
inline

The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 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, 20, or 30 only for metrics that are stored by a PutMetricData call with a StorageResolution of 1. If you specify a period of 10, 20, 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, 20, 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 seven days, so Period multiplied by EvaluationPeriods can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).

Definition at line 407 of file PutMetricAlarmRequest.h.

◆ SetStatistic()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetStatistic ( Statistic  value)
inline

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.

Definition at line 314 of file PutMetricAlarmRequest.h.

◆ SetTags()

template<typename TagsT = Aws::Vector<Tag>>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetTags ( TagsT &&  value)
inline

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.

To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions.

Definition at line 639 of file PutMetricAlarmRequest.h.

◆ SetThreshold()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetThreshold ( double  value)
inline

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.

Definition at line 495 of file PutMetricAlarmRequest.h.

◆ SetThresholdMetricId()

template<typename ThresholdMetricIdT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetThresholdMetricId ( ThresholdMetricIdT &&  value)
inline

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.

Definition at line 667 of file PutMetricAlarmRequest.h.

◆ SetTreatMissingData()

template<typename TreatMissingDataT = Aws::String>
void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetTreatMissingData ( TreatMissingDataT &&  value)
inline

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.

This parameter is not applicable to PromQL alarms.

Definition at line 543 of file PutMetricAlarmRequest.h.

◆ SetUnit()

void Aws::CloudWatch::Model::PutMetricAlarmRequest::SetUnit ( StandardUnit  value)
inline

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.

Definition at line 438 of file PutMetricAlarmRequest.h.

◆ StatisticHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::StatisticHasBeenSet ( ) const
inline

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.

Definition at line 313 of file PutMetricAlarmRequest.h.

◆ TagsHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::TagsHasBeenSet ( ) const
inline

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.

To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions.

Definition at line 637 of file PutMetricAlarmRequest.h.

◆ ThresholdHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::ThresholdHasBeenSet ( ) const
inline

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.

Definition at line 494 of file PutMetricAlarmRequest.h.

◆ ThresholdMetricIdHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::ThresholdMetricIdHasBeenSet ( ) const
inline

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.

Definition at line 665 of file PutMetricAlarmRequest.h.

◆ TreatMissingDataHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::TreatMissingDataHasBeenSet ( ) const
inline

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.

This parameter is not applicable to PromQL alarms.

Definition at line 541 of file PutMetricAlarmRequest.h.

◆ UnitHasBeenSet()

bool Aws::CloudWatch::Model::PutMetricAlarmRequest::UnitHasBeenSet ( ) const
inline

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.

Definition at line 437 of file PutMetricAlarmRequest.h.

◆ WithActionsEnabled()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithActionsEnabled ( bool  value)
inline

Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.

Definition at line 90 of file PutMetricAlarmRequest.h.

◆ WithAlarmActions()

template<typename AlarmActionsT = Aws::Vector<Aws::String>>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithAlarmActions ( AlarmActionsT &&  value)
inline

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

Start a Amazon Q Developer operational investigation

arn:aws:aiops:region:account-id:investigation-group:investigation-group-id

Definition at line 193 of file PutMetricAlarmRequest.h.

◆ WithAlarmDescription()

template<typename AlarmDescriptionT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithAlarmDescription ( AlarmDescriptionT &&  value)
inline

The description for the alarm.

Definition at line 73 of file PutMetricAlarmRequest.h.

◆ WithAlarmName()

template<typename AlarmNameT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithAlarmName ( AlarmNameT &&  value)
inline

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

Definition at line 55 of file PutMetricAlarmRequest.h.

◆ WithComparisonOperator()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithComparisonOperator ( ComparisonOperator  value)
inline

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.

Definition at line 519 of file PutMetricAlarmRequest.h.

◆ WithDatapointsToAlarm()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithDatapointsToAlarm ( int  value)
inline

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.

Definition at line 481 of file PutMetricAlarmRequest.h.

◆ WithDimensions()

template<typename DimensionsT = Aws::Vector<Dimension>>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithDimensions ( DimensionsT &&  value)
inline

The dimensions for the metric specified in MetricName.

Definition at line 370 of file PutMetricAlarmRequest.h.

◆ WithEvaluateLowSampleCountPercentile()

template<typename EvaluateLowSampleCountPercentileT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithEvaluateLowSampleCountPercentile ( EvaluateLowSampleCountPercentileT &&  value)
inline

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

Definition at line 574 of file PutMetricAlarmRequest.h.

◆ WithEvaluationCriteria()

template<typename EvaluationCriteriaT = EvaluationCriteria>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithEvaluationCriteria ( EvaluationCriteriaT &&  value)
inline

The evaluation criteria for the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

If you use the EvaluationCriteria parameter, you cannot include the Namespace, MetricName, Dimensions, Period, Unit, Statistic, ExtendedStatistic, Metrics, Threshold, ComparisonOperator, ThresholdMetricId, EvaluationPeriods, or DatapointsToAlarm parameters of PutMetricAlarm in the same operation. Instead, all evaluation parameters are defined within this structure.

For an example of how to use this parameter, see the PromQL alarm example on this page.

Definition at line 701 of file PutMetricAlarmRequest.h.

◆ WithEvaluationInterval()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithEvaluationInterval ( int  value)
inline

The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.

This parameter is required for alarms that use EvaluationCriteria, and cannot be specified for alarms configured with MetricName or Metrics.

Definition at line 720 of file PutMetricAlarmRequest.h.

◆ WithEvaluationPeriods()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithEvaluationPeriods ( int  value)
inline

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.

Definition at line 461 of file PutMetricAlarmRequest.h.

◆ WithExtendedStatistic()

template<typename ExtendedStatisticT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithExtendedStatistic ( ExtendedStatisticT &&  value)
inline

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.

Definition at line 352 of file PutMetricAlarmRequest.h.

◆ WithInsufficientDataActions()

template<typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithInsufficientDataActions ( InsufficientDataActionsT &&  value)
inline

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

Definition at line 247 of file PutMetricAlarmRequest.h.

◆ WithMetricName()

template<typename MetricNameT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithMetricName ( MetricNameT &&  value)
inline

The name for the metric associated with the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 279 of file PutMetricAlarmRequest.h.

◆ WithMetrics()

template<typename MetricsT = Aws::Vector<MetricDataQuery>>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithMetrics ( MetricsT &&  value)
inline

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, a Metrics array, or an EvaluationCriteria.

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.

Definition at line 607 of file PutMetricAlarmRequest.h.

◆ WithNamespace()

template<typename NamespaceT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithNamespace ( NamespaceT &&  value)
inline

The namespace for the metric associated specified in MetricName.

Definition at line 298 of file PutMetricAlarmRequest.h.

◆ WithOKActions()

template<typename OKActionsT = Aws::Vector<Aws::String>>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithOKActions ( OKActionsT &&  value)
inline

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

Definition at line 137 of file PutMetricAlarmRequest.h.

◆ WithPeriod()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithPeriod ( int  value)
inline

The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 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, 20, or 30 only for metrics that are stored by a PutMetricData call with a StorageResolution of 1. If you specify a period of 10, 20, 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, 20, 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 seven days, so Period multiplied by EvaluationPeriods can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).

Definition at line 411 of file PutMetricAlarmRequest.h.

◆ WithStatistic()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithStatistic ( Statistic  value)
inline

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.

Definition at line 318 of file PutMetricAlarmRequest.h.

◆ WithTags()

template<typename TagsT = Aws::Vector<Tag>>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithTags ( TagsT &&  value)
inline

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.

To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions.

Definition at line 644 of file PutMetricAlarmRequest.h.

◆ WithThreshold()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithThreshold ( double  value)
inline

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.

Definition at line 499 of file PutMetricAlarmRequest.h.

◆ WithThresholdMetricId()

template<typename ThresholdMetricIdT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithThresholdMetricId ( ThresholdMetricIdT &&  value)
inline

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.

Definition at line 672 of file PutMetricAlarmRequest.h.

◆ WithTreatMissingData()

template<typename TreatMissingDataT = Aws::String>
PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithTreatMissingData ( TreatMissingDataT &&  value)
inline

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.

This parameter is not applicable to PromQL alarms.

Definition at line 548 of file PutMetricAlarmRequest.h.

◆ WithUnit()

PutMetricAlarmRequest & Aws::CloudWatch::Model::PutMetricAlarmRequest::WithUnit ( StandardUnit  value)
inline

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.

Definition at line 442 of file PutMetricAlarmRequest.h.


The documentation for this class was generated from the following file: