Search in sources :

Example 1 with DisableAlarmActionsRequest

use of software.amazon.awssdk.services.cloudwatch.model.DisableAlarmActionsRequest in project aws-doc-sdk-examples by awsdocs.

the class DisableAlarmActions method disableActions.

// snippet-start:[cloudwatch.java2.disable_alarm_actions.main]
public static void disableActions(CloudWatchClient cw, String alarmName) {
    try {
        DisableAlarmActionsRequest request = DisableAlarmActionsRequest.builder().alarmNames(alarmName).build();
        cw.disableAlarmActions(request);
        System.out.printf("Successfully disabled actions on alarm %s", alarmName);
    } catch (CloudWatchException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : CloudWatchException(software.amazon.awssdk.services.cloudwatch.model.CloudWatchException) DisableAlarmActionsRequest(software.amazon.awssdk.services.cloudwatch.model.DisableAlarmActionsRequest)

Aggregations

CloudWatchException (software.amazon.awssdk.services.cloudwatch.model.CloudWatchException)1 DisableAlarmActionsRequest (software.amazon.awssdk.services.cloudwatch.model.DisableAlarmActionsRequest)1