1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/dns/requests/dynect/get_zone.rb

49 lines
1.1 KiB
Ruby
Raw Normal View History

module Fog
module Dynect
class DNS
class Real
require 'fog/dns/parsers/dynect/zone'
# GET information for the given zone
# ==== Parameters
# * name<~String> - zone name (ie example.com)
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'zone_type'<~String>
# * 'serial_style'<~String>
# * 'serial'<~Integer>
# * 'zone'<~String>
2011-06-17 06:51:37 -04:00
def get_zone(zone_name)
request(
:parser => Fog::Parsers::Dynect::DNS::Zone.new,
:expects => 200,
:method => "GET",
:path => "Zone/#{zone_name}/",
)
end
end
class Mock
2011-06-17 06:51:37 -04:00
def get_zone(zone_name)
response = Excon::Response.new
response.status = 200
response.body = {
"zone" => "example.com",
"serial" => 100,
"zone_type" => "Primary",
"serial_type" => "increment"
}
response
end
end
end
end
end