2010-12-29 13:11:46 -08:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 20:00:45 -05:00
|
|
|
require 'fog/aws/models/dns/zone'
|
2010-12-29 13:11:46 -08:00
|
|
|
|
|
|
|
module Fog
|
2011-06-15 17:25:01 -07:00
|
|
|
module DNS
|
|
|
|
class AWS
|
2010-12-29 13:11:46 -08:00
|
|
|
|
|
|
|
class Zones < Fog::Collection
|
|
|
|
|
|
|
|
attribute :marker, :aliases => 'Marker'
|
|
|
|
attribute :max_items, :aliases => 'MaxItems'
|
|
|
|
|
2011-06-15 17:25:01 -07:00
|
|
|
model Fog::DNS::AWS::Zone
|
2010-12-29 13:11:46 -08:00
|
|
|
|
|
|
|
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 17:11:34 -07:00
|
|
|
rescue Excon::Errors::Forbidden
|
2010-12-29 13:11:46 -08:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|