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/hp/requests/dns/get_domain.rb
2013-10-30 19:02:30 -04:00

39 lines
No EOL
876 B
Ruby

module Fog
module HP
class DNS
# Get details for existing domain
#
# ==== Parameters
# * instance_id<~Integer> - Id of the domain to get
#
# ==== Returns
# * response<~Excon::Response>:
# *TBD
class Real
def get_domain(instance_id)
response = request(
:expects => 200,
:method => 'GET',
:path => "domains/#{instance_id}",
)
response
end
end
class Mock
def get_domain(instance_id)
response = Excon::Response.new
if domain = find_domain(instance_id)
response.status = 200
response.body = {'domain' => domain}
response
else
raise Fog::HP::DNS::NotFound
end
response
end
end
end
end
end