use of com.amazonaws.services.cloudwatch.model.DeleteAlarmsRequest in project aws-doc-sdk-examples by awsdocs.
the class DeleteAlarm method main.
public static void main(String[] args) {
final String USAGE = "To run this example, supply an alarm name\n" + "Ex: DeleteAlarm <alarm-name>\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String alarm_name = args[0];
final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient();
DeleteAlarmsRequest request = new DeleteAlarmsRequest().withAlarmNames(alarm_name);
DeleteAlarmsResult response = cw.deleteAlarms(request);
System.out.printf("Successfully deleted alarm %s", alarm_name);
}
Aggregations