Amazon.CloudWatch.AmazonCloudWatchClient.SetAlarmState C# (CSharp) Метод

SetAlarmState() публичный Метод

Temporarily sets the state of an alarm for testing purposes. When the updated state 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 state to ALARM sends an Amazon SNS message. The alarm returns to its actual state (often within seconds). Because the alarm state change happens very quickly, it is typically only visible in the alarm's History tab in the Amazon CloudWatch console or through DescribeAlarmHistory.
/// Data was not syntactically valid JSON. /// /// The named resource does not exist. ///
public SetAlarmState ( SetAlarmStateRequest request ) : Amazon.CloudWatch.Model.SetAlarmStateResponse
request Amazon.CloudWatch.Model.SetAlarmStateRequest Container for the necessary parameters to execute the SetAlarmState service method.
Результат Amazon.CloudWatch.Model.SetAlarmStateResponse
        public SetAlarmStateResponse SetAlarmState(SetAlarmStateRequest request)
        {
            var marshaller = new SetAlarmStateRequestMarshaller();
            var unmarshaller = SetAlarmStateResponseUnmarshaller.Instance;

            return Invoke<SetAlarmStateRequest,SetAlarmStateResponse>(request, marshaller, unmarshaller);
        }

Usage Example

Пример #1
0
    public static void CWSetAlarmState()
    {
      #region CWSetAlarmState
      var client = new AmazonCloudWatchClient();

      var request = new SetAlarmStateRequest
      {
        AlarmName = "Offline Instances",
        StateReason = "Too many instances are offline.",
        StateValue = StateValue.ALARM
      };

      client.SetAlarmState(request);
      #endregion
    }