2014-12-30 17:25:09 -05:00
|
|
|
require 'fog/aws/models/dns/zone'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module DNS
|
2015-01-02 12:34:40 -05:00
|
|
|
class AWS
|
2014-12-30 17:25:09 -05:00
|
|
|
class Zones < Fog::Collection
|
|
|
|
attribute :marker, :aliases => 'Marker'
|
|
|
|
attribute :max_items, :aliases => 'MaxItems'
|
|
|
|
|
|
|
|
model Fog::DNS::AWS::Zone
|
|
|
|
|
|
|
|
def all(options = {})
|
|
|
|
options['marker'] ||= marker
|
|
|
|
options['maxitems'] ||= max_items
|
|
|
|
data = service.list_hosted_zones(options).body['HostedZones']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(zone_id)
|
|
|
|
data = service.get_hosted_zone(zone_id).body
|
|
|
|
new(data)
|
2015-02-19 19:20:16 -05:00
|
|
|
rescue Fog::DNS::AWS::NotFound
|
2014-12-30 17:25:09 -05:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|