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:
parent
57c86a0030
commit
94f23bf340
1 changed files with 14 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue