AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Represents an alarm.

Inheritance Hierarchy

System.Object
  Amazon.CloudWatch.Model.MetricAlarm

Namespace: Amazon.CloudWatch.Model
Assembly: AWSSDK.CloudWatch.dll
Version: 3.x.y.z

Syntax

C#
public class MetricAlarm

The MetricAlarm type exposes the following members

Constructors

NameDescription
Public Method MetricAlarm()

Properties

NameTypeDescription
Public Property ActionsEnabled System.Boolean

Gets and sets the property ActionsEnabled.

Indicates whether actions should be executed during any changes to the alarm state.

Public Property AlarmActions System.Collections.Generic.List<System.String>

Gets and sets the property AlarmActions.

The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).

Public Property AlarmArn System.String

Gets and sets the property AlarmArn.

The Amazon Resource Name (ARN) of the alarm.

Public Property AlarmConfigurationUpdatedTimestamp System.DateTime

Gets and sets the property AlarmConfigurationUpdatedTimestamp.

The time stamp of the last update to the alarm configuration.

Public Property AlarmDescription System.String

Gets and sets the property AlarmDescription.

The description of the alarm.

Public Property AlarmName System.String

Gets and sets the property AlarmName.

The name of the alarm.

Public Property ComparisonOperator Amazon.CloudWatch.ComparisonOperator

Gets and sets the property ComparisonOperator.

The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.

Public Property Dimensions System.Collections.Generic.List<Amazon.CloudWatch.Model.Dimension>

Gets and sets the property Dimensions.

The dimensions for the metric associated with the alarm.

Public Property EvaluateLowSampleCountPercentile System.String

Gets and sets the property EvaluateLowSampleCountPercentile.

Used only for alarms based on percentiles. If ignore, the alarm state does not change during periods with too few data points to be statistically significant. If evaluate or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.

Public Property EvaluationPeriods System.Int32

Gets and sets the property EvaluationPeriods.

The number of periods over which data is compared to the specified threshold.

Public Property ExtendedStatistic System.String

Gets and sets the property ExtendedStatistic.

The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.

Public Property InsufficientDataActions System.Collections.Generic.List<System.String>

Gets and sets the property InsufficientDataActions.

The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

Public Property MetricName System.String

Gets and sets the property MetricName.

The name of the metric associated with the alarm.

Public Property Namespace System.String

Gets and sets the property Namespace.

The namespace of the metric associated with the alarm.

Public Property OKActions System.Collections.Generic.List<System.String>

Gets and sets the property OKActions.

The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).

Public Property Period System.Int32

Gets and sets the property Period.

The period, in seconds, over which the statistic is applied.

Public Property StateReason System.String

Gets and sets the property StateReason.

An explanation for the alarm state, in text format.

Public Property StateReasonData System.String

Gets and sets the property StateReasonData.

An explanation for the alarm state, in JSON format.

Public Property StateUpdatedTimestamp System.DateTime

Gets and sets the property StateUpdatedTimestamp.

The time stamp of the last update to the alarm state.

Public Property StateValue Amazon.CloudWatch.StateValue

Gets and sets the property StateValue.

The state value for the alarm.

Public Property Statistic Amazon.CloudWatch.Statistic

Gets and sets the property Statistic.

The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use ExtendedStatistic.

Public Property Threshold System.Double

Gets and sets the property Threshold.

The value to compare with the specified statistic.

Public Property TreatMissingData System.String

Gets and sets the property TreatMissingData.

Sets how this alarm is to handle missing data points. If this parameter is omitted, the default behavior of missing is used.

Public Property Unit Amazon.CloudWatch.StandardUnit

Gets and sets the property Unit.

The unit of the metric associated with the alarm.

Examples

This example shows how to get information about an alarm.

Get alarm information example

var client = new AmazonCloudWatchClient();

var request = new DescribeAlarmsRequest
{
  AlarmNames = new List() 
    { "awseb-e-b36EXAMPLE-stack-CloudwatchAlarmLow-1KAKH4EXAMPLE" },
  MaxRecords = 1,
  StateValue = StateValue.ALARM
};

var response = new DescribeAlarmsResponse();

do
{
  response = client.DescribeAlarms(request);

  foreach (var alarm in response.MetricAlarms)
  {
    Console.WriteLine(alarm.AlarmName);
    Console.WriteLine(alarm.AlarmDescription);
    Console.WriteLine(alarm.MetricName + " " +
        alarm.ComparisonOperator + " " + alarm.Threshold);
    Console.WriteLine();
  }

  request.NextToken = response.NextToken;

} while (!string.IsNullOrEmpty(response.NextToken));
      

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms