2010-12-29 16:11:46 -05:00
|
|
|
require 'fog/core/collection'
|
2011-01-14 13:41:12 -05:00
|
|
|
require 'fog/dns/models/aws/zone'
|
2010-12-29 16:11:46 -05:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class DNS
|
|
|
|
|
|
|
|
class Zones < Fog::Collection
|
|
|
|
|
|
|
|
attribute :marker, :aliases => 'Marker'
|
|
|
|
attribute :max_items, :aliases => 'MaxItems'
|
|
|
|
|
|
|
|
model Fog::AWS::DNS::Zone
|
|
|
|
|
|
|
|
def all(options = {})
|
|
|
|
options['marker'] ||= marker
|
|
|
|
options['maxitems'] ||= max_items
|
|
|
|
data = connection.list_hosted_zones(options).body['HostedZones']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(zone_id)
|
|
|
|
data = connection.get_hosted_zone(zone_id).body
|
|
|
|
new(data)
|
2011-05-10 20:11:34 -04:00
|
|
|
rescue Excon::Errors::Forbidden
|
2010-12-29 16:11:46 -05:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|