Java 类com.amazonaws.services.cloudwatch.model.DeleteAlarmsRequest 实例源码

项目:aws-doc-sdk-examples    文件:DeleteAlarm.java   
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);
    }
项目:aem-orchestrator    文件:AwsHelperServiceTest.java   
@Test
public void testDeleteAlarm() {
    final String alarmName = "testAlarmName";
    awsHelperService.deleteAlarm(alarmName);

    final ArgumentCaptor<DeleteAlarmsRequest> argumentCaptor = ArgumentCaptor.forClass(DeleteAlarmsRequest.class);
    verify(amazonCloudWatch).deleteAlarms(argumentCaptor.capture());
    assertThat(argumentCaptor.getValue().getAlarmNames().get(0), equalTo(alarmName));
}
项目:Tank    文件:CloudwatchInstance.java   
/**
 * 
 * @param email
 * @param jobId
 */
public void removeWatch(String email, String jobId) {
    String alarmName = getAlarmName(email, jobId);
    for (MetricAlarm a : asynchCloudWatchClient.describeAlarms().getMetricAlarms()) {
        if (a.getAlarmName().equalsIgnoreCase(alarmName)) {
            DeleteAlarmsRequest req = new DeleteAlarmsRequest().withAlarmNames(alarmName);
            asynchCloudWatchClient.deleteAlarmsAsync(req);
        }
    }
}
项目:cmn-project    文件:CloudWatch.java   
public void deleteAlarms(List<String> alarmNames) {
    logger.info("delete alarms, alarms={}", alarmNames);
    cloudWatch.deleteAlarms(new DeleteAlarmsRequest().withAlarmNames(alarmNames));
}