AWSSDKDocSamples.CloudWatch.CloudWatchSamples.CWSetAlarmState C# (CSharp) Method

CWSetAlarmState() public static method

public static CWSetAlarmState ( ) : void
return void
    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
    }