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_servers_hosting_domain.rb

41 lines
944 B
Ruby
Raw Normal View History

2013-05-03 14:31:08 -04:00
module Fog
module HP
class DNS
class Real
# Get servers for existing domain
#
# ==== Parameters
# * instance_id<~Integer> - Id of the domain with servers
#
# ==== Returns
# * response<~Excon::Response>:
# *TBD
def get_servers_hosting_domain(instance_id)
request(
:expects => [200, 203],
:method => 'GET',
:path => "domains/#{instance_id}/servers"
)
end
end
class Mock
def get_servers_hosting_domain(instance_id)
if domain = find_domain(instance_id)
response.status = 200
response.body = {'domain' => domain}
response
else
response.status = 400
raise(Excon::Errors.status_error({:expects => 200}, response))
end
response
end
end
end
end
end