PutMetricAlarm

Description

Creates of updates the alarm and links to the metric.

Request Parameters

  • AlarmName – The name for the alarm. This name must be unique within the project.
    • Required: Yes
    • Type: String
    • Length constraints: from 1 to 255 symbols
  • Period – The period in seconds over which the statistic is applied
    • Required: Yes
    • Type: Int
    • Valid range: Value must be divisible by 60, minimum value is 60
    • Constraints: Time period, that is set via EvaluationPeriods and Period should not exceed one day
  • MetricName – The name of the metric that associated with the alarm
    • Required: Yes
    • Type: String
    • Length constraints: from 1 to 255 symbols
  • Namespace – The namespace of the metric that associated with the alarm
    • Required: Yes
    • Type: String
    • Length constraints: from 1 to 255 symbols
  • ComparisonOperator – The arithmetic operation to use when comparing the specified statistic and threshold
    • Required: Yes
    • Type: String
    • Valid values: GreaterThanThreshold | GreaterThanOrEqualToThreshold | LessThanOrEqualToThreshold | LessThanThreshold
  • Threshold – The value, to which metric values will be compared
    • Required: Yes
    • Type: Double
  • EvaluationPeriods – The number of periods which is compared to the threshold
    • Required: Yes
    • Type: Int
    • Valid range: Minimum value is 1
    • Constraints: Time period, that is set via EvaluationPeriods and Period should not exceed one day
  • Dimensions.member.n – A list of Dimensions objects (see User Guide)
    • Required: Yes
    • Type: Array of Dimension objects
    • Length constraints: from 1 to 10 items
  • Statistic – The statistic for the metric
    • Required: Yes
    • Type: String
    • Valid values: Average | Sum | SampleCount | Maximum | Minimum
  • AlarmActions.member.n – List of actions, which must be executed when this alarm transitions to the alarm state
    • Required: No
    • Type: Array of strings
    • Valid values: “example@mail.com:EMAIL”
    • Length constraints (list): from 0 to 5 items
    • Length constraints (element): from 1 to 1024 symbols
  • InsufficientDataActions.member.n – List of actions, which must be executed when this alarm transitions to the insufficient_data state
    • Required: No
    • Type: Array of strings
    • Valid values: “example@mail.com:EMAIL”
    • Length constraints (list): from 0 to 5 items
    • Length constraints (element): from 1 to 1024 symbols
  • OKActions.member.n – List of actions, which must be executed when this alarm transitions to the ok state
    • Required: No
    • Type: Array of strings
    • Valid values: “example@mail.com:EMAIL”
    • Length constraints (list): from 0 to 5 items
    • Length constraints (element): from 1 to 1024 symbols
  • AlarmDescription – The alarm description
    • Required: No
    • Type: String
    • Length constraints: from 1 to 255 symbols
  • ActionsEnabled – Indicates whether actions should be executed during any changes to the alarm state
    • Required: No
    • Type: Boolean
  • TreatMissingData – This parameter defines how periods without values would be interpreted. There’re four possible options: keep considering them periods without values, ignore such periods, consider them breaching, consider them non-breaching.
    • Required: No
    • Type: String
    • Valid values: missing | ignore | breaching | non_breaching
    • Default value: missing
  • DatapointsToAlarm – Number of datapoints that must be breaching to trigger the alarm
    • Required: No
    • Type: Int
    • Valid range: Minimum value – 1, Maximum value – EvaluationPeriods
    • Default value: EvaluationPeriods
  • Unit – The unit of the metric associated with the alarm
    • Required: No
    • Type: String
    • Valid values: Percent | Bytes | Count

Examples

c2-cw PutMetricAlarm AlarmName <alarm_name> Period <period> MetricName <metric_name> \
                     Namespace <namespace> ComparisonOperator <comparison_operator> \
                     Threshold <threshold> EvaluationPeriods <evaluation_periods> \
                     Dimensions.member.1.Name "InstanceId" \
                     Dimensions.member.1.Value <instance_id> \
                     Statistic <statistic>

c2-cw PutMetricAlarm AlarmName <alarm_name> Period <period> MetricName <metric_name> \
                     Namespace <namespace> ComparisonOperator <comparison_operator> \
                     Threshold <threshold> EvaluationPeriods <evaluation_periods> \
                     Dimensions.member.1.Name "InstanceId" \
                     Dimensions.member.1.Value <instance_id> \
                     Statistic <statistic> OKActions.member.1 <ok_action_1>