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

adding #all! to Fog::DNS::Rackspace::Records to load in all records for a zone (max 500 with Rackspace)

This commit is contained in:
Ben Hundley 2014-04-12 16:33:10 -05:00
parent 57c86a0030
commit 94f23bf340

View file

@ -17,6 +17,20 @@ module Fog
load(data.body['records'])
end
def all!
requires :zone
data = []
total_entries = nil
begin
resp = service.list_records(zone.id, :offset => data.size).body
total_entries ||= resp['totalEntries']
data += resp['records']
end while data.size < total_entries
load(data)
end
def get(record_id)
requires :zone
data = service.list_record_details(zone.identity, record_id).body