use of com.amazonaws.services.cloudwatch.model.DescribeAlarmsRequest in project aws-doc-sdk-examples by awsdocs.
the class DescribeAlarms method main.
public static void main(String[] args) {
final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient();
boolean done = false;
while (!done) {
DescribeAlarmsRequest request = new DescribeAlarmsRequest();
DescribeAlarmsResult response = cw.describeAlarms(request);
for (MetricAlarm alarm : response.getMetricAlarms()) {
System.out.printf("Retrieved alarm %s", alarm.getAlarmName());
}
request.setNextToken(response.getNextToken());
if (response.getNextToken() == null) {
done = true;
}
}
}
Aggregations