1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Properly return all alarms

This commit is contained in:
Trotter Cashion 2013-01-08 11:28:57 -08:00
parent c7f6c692d8
commit db98589b63

View file

@ -12,9 +12,9 @@ module Fog
data = []
next_token = nil
loop do
result = service.describe_alarms('NextToken' => next_token).body['DescribeAlarmsResult']
data += result['MetricAlarms']
next_token = result['NextToken']
body = service.describe_alarms('NextToken' => next_token).body
data += body['DescribeAlarmsResult']['MetricAlarms']
next_token = body['ResponseMetadata']['NextToken']
break if next_token.nil?
end
load(data)