Search in sources :

Example 1 with DeleteAlarmsResult

use of com.amazonaws.services.cloudwatch.model.DeleteAlarmsResult 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);
}
Also used : AmazonCloudWatch(com.amazonaws.services.cloudwatch.AmazonCloudWatch) DeleteAlarmsRequest(com.amazonaws.services.cloudwatch.model.DeleteAlarmsRequest) DeleteAlarmsResult(com.amazonaws.services.cloudwatch.model.DeleteAlarmsResult)

Aggregations

AmazonCloudWatch (com.amazonaws.services.cloudwatch.AmazonCloudWatch)1 DeleteAlarmsRequest (com.amazonaws.services.cloudwatch.model.DeleteAlarmsRequest)1 DeleteAlarmsResult (com.amazonaws.services.cloudwatch.model.DeleteAlarmsResult)1