mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
33 lines
No EOL
799 B
Ruby
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 |