use of software.amazon.awssdk.services.cloudwatch.model.EnableAlarmActionsRequest in project aws-doc-sdk-examples by awsdocs.
the class EnableAlarmActions method enableActions.
// snippet-start:[cloudwatch.java2.enable_alarm_actions.main]
public static void enableActions(CloudWatchClient cw, String alarm) {
try {
EnableAlarmActionsRequest request = EnableAlarmActionsRequest.builder().alarmNames(alarm).build();
cw.enableAlarmActions(request);
System.out.printf("Successfully enabled actions on alarm %s", alarm);
} catch (CloudWatchException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations