2010-12-14 00:04:23 -05:00
|
|
|
module Fog
|
2011-06-15 20:25:01 -04:00
|
|
|
module DNS
|
|
|
|
class AWS
|
2010-12-14 00:04:23 -05:00
|
|
|
class Real
|
|
|
|
|
2011-08-24 21:00:45 -04:00
|
|
|
require 'fog/aws/parsers/dns/get_hosted_zone'
|
2010-12-14 00:04:23 -05:00
|
|
|
|
|
|
|
# retrieve information about a hosted zone
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * zone_id<~String> - The ID of the hosted zone
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
# * body<~Hash>:
|
|
|
|
# * 'HostedZone'<~Hash>:
|
2011-12-06 00:24:07 -05:00
|
|
|
# * 'Id'<~String> -
|
|
|
|
# * 'Name'<~String> -
|
2010-12-14 00:04:23 -05:00
|
|
|
# * 'CallerReference'<~String>
|
2011-12-06 00:24:07 -05:00
|
|
|
# * 'Comment'<~String> -
|
2010-12-14 00:04:23 -05:00
|
|
|
# * 'NameServers'<~Array>
|
|
|
|
# * 'NameServer'<~String>
|
|
|
|
# * status<~Integer> - 201 when successful
|
2010-12-17 19:48:38 -05:00
|
|
|
def get_hosted_zone(zone_id)
|
2010-12-14 00:04:23 -05:00
|
|
|
|
2011-12-06 00:24:07 -05:00
|
|
|
# AWS methods return zone_ids that looks like '/hostedzone/id'. Let the caller either use
|
2010-12-14 00:04:23 -05:00
|
|
|
# that form or just the actual id (which is what this request needs)
|
|
|
|
zone_id = zone_id.sub('/hostedzone/', '')
|
|
|
|
|
|
|
|
request({
|
2011-12-06 00:24:07 -05:00
|
|
|
:expects => 200,
|
|
|
|
:parser => Fog::Parsers::DNS::AWS::GetHostedZone.new,
|
|
|
|
:method => 'GET',
|
|
|
|
:path => "hostedzone/#{zone_id}"
|
2010-12-14 00:04:23 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|