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/update_domain.rb
2013-10-30 19:02:30 -04:00

33 lines
No EOL
799 B
Ruby

module Fog
module HP
class DNS
class Real
def update_domain(domain_id, options)
request(
:body => Fog::JSON.encode(options),
:expects => 200,
:method => 'PUT',
:path => "domains/#{domain_id}"
)
end
end
class Mock
def update_domain(domain_id, options)
response = Excon::Response.new
if domain = list_domains.body['domains'].detect { |_| _['id'] == domain_id }
if options['name']
domain['name'] = options['name']
end
response.status = 200
response.body = domain
response
else
raise Fog::HP::DNS::NotFound
end
end
end
end
end
end