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);
}
}
Aggregations