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

Include all snapshots in FOG::AWS::RDS::Snapshots#all

This commit is contained in:
Harry Wilkinson 2013-05-09 18:22:20 -04:00
parent e5e3758918
commit 59e61e8991

View file

@ -23,8 +23,17 @@ module Fog
def all(filters = filters)
self.filters = filters
data = service.describe_db_snapshots(filters).body['DescribeDBSnapshotsResult']['DBSnapshots']
load(data) # data is an array of attribute hashes
# Uses markers to iterate through all paged results and return the entire collection
pages = []
marker = nil
begin
snapshots = service.describe_db_snapshots({:marker => marker}.merge(filters))
marker = snapshots.body['DescribeDBSnapshotsResult']['Marker']
data = snapshots.body['DescribeDBSnapshotsResult']['DBSnapshots']
pages << data # data is an array of attribute hashes
end while marker
load(pages.flatten)
end
def get(identity)