private DescribeAlarmsResponse describeAlarms ( ) { DescribeAlarmsResponse ret = new DescribeAlarmsResponse ( ) ; DescribeAlarmsResult result = new DescribeAlarmsResult ( ) ; MetricAlarms metricAlarms = new MetricAlarms ( ) ; MetricAlarm metricAlarm = new MetricAlarm ( ) ; metricAlarm . setAlarmDescription ( "CPU usage exceeds 70 percent" ) ; metricAlarm . setAlarmName ( "AwsMockAlarmCPU" ) ; metricAlarms . getMember ( ) . add ( metricAlarm ) ; metricAlarm = new MetricAlarm ( ) ; metricAlarm . setAlarmDescription ( "Memory usage exceeds 80 percent" ) ; metricAlarm . setAlarmName ( "AwsMockAlarmMemory" ) ; metricAlarms . getMember ( ) . add ( metricAlarm ) ; result . setMetricAlarms ( metricAlarms ) ; ret . setDescribeAlarmsResult ( result ) ; ResponseMetadata responseMetadata = new ResponseMetadata ( ) ; responseMetadata . setRequestId ( UUID . randomUUID ( ) . toString ( ) ) ; ret . setResponseMetadata ( responseMetadata ) ; return ret ; }
Handles describeAlarms request .