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.
StateValue
differs from the previous value, the action configured for the appropriate state is
invoked. For example, if your alarm is configured to send an Amazon SNS message when
an alarm is triggered, temporarily changing the alarm's state to ALARM will
send an Amazon SNS message. This is not a permanent change. The next periodic alarm
check (in about a minute) will set the alarm to its actual state. Because the alarm
state change happens very quickly, it is typically only visibile in the alarm's History
tab in the Amazon CloudWatch console or through DescribeAlarmHistory
.
Namespace: Amazon.CloudWatch.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class SetAlarmStateRequest : AmazonCloudWatchRequest IRequestEvents
The SetAlarmStateRequest type exposes the following members
Name | Description | |
---|---|---|
SetAlarmStateRequest() |
Name | Type | Description | |
---|---|---|---|
AlarmName | System.String |
Gets and sets the property AlarmName.
The descriptive name for the alarm. This name must be unique within the user's AWS account. The maximum length is 255 characters. |
|
StateReason | System.String |
Gets and sets the property StateReason.
The reason that this alarm is set to this specific state (in human-readable text format) |
|
StateReasonData | System.String |
Gets and sets the property StateReasonData.
The reason that this alarm is set to this specific state (in machine-readable JSON format) |
|
StateValue | Amazon.CloudWatch.StateValue |
Gets and sets the property StateValue.
The value of the state. |
This example shows how to temporarily set an alarm's state.
var client = new AmazonCloudWatchClient(); var request = new SetAlarmStateRequest { AlarmName = "Offline Instances", StateReason = "Too many instances are offline.", StateValue = StateValue.ALARM }; client.SetAlarmState(request);
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8
.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8