Search in sources :

Example 1 with EnableAlarmActionsRequest

use of com.amazonaws.services.cloudwatch.model.EnableAlarmActionsRequest in project aws-doc-sdk-examples by awsdocs.

the class EnableAlarmActions method main.

public static void main(String[] args) {
    final String USAGE = "To run this example, supply an alarm name\n" + "Ex: EnableAlarmActions <alarm-name>\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String alarm = args[0];
    final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient();
    EnableAlarmActionsRequest request = new EnableAlarmActionsRequest().withAlarmNames(alarm);
    EnableAlarmActionsResult response = cw.enableAlarmActions(request);
    System.out.printf("Successfully enabled actions on alarm %s", alarm);
}
Also used : EnableAlarmActionsRequest(com.amazonaws.services.cloudwatch.model.EnableAlarmActionsRequest) AmazonCloudWatch(com.amazonaws.services.cloudwatch.AmazonCloudWatch) EnableAlarmActionsResult(com.amazonaws.services.cloudwatch.model.EnableAlarmActionsResult)

Aggregations

AmazonCloudWatch (com.amazonaws.services.cloudwatch.AmazonCloudWatch)1 EnableAlarmActionsRequest (com.amazonaws.services.cloudwatch.model.EnableAlarmActionsRequest)1 EnableAlarmActionsResult (com.amazonaws.services.cloudwatch.model.EnableAlarmActionsResult)1