2011-08-27 18:46:15 -04:00
|
|
|
module Fog
|
|
|
|
module DNS
|
|
|
|
class Rackspace
|
|
|
|
class Real
|
|
|
|
def modify_domain(domain_id, options={})
|
|
|
|
|
2011-08-28 10:53:43 -04:00
|
|
|
validate_path_fragment :domain_id, domain_id
|
|
|
|
|
2011-08-27 18:46:15 -04:00
|
|
|
path = "domains/#{domain_id}"
|
|
|
|
data = {}
|
|
|
|
|
|
|
|
if options.has_key? :ttl
|
|
|
|
data['ttl'] = options[:ttl]
|
|
|
|
end
|
|
|
|
if options.has_key? :comment
|
|
|
|
data['comment'] = options[:comment]
|
|
|
|
end
|
2011-08-27 22:06:46 -04:00
|
|
|
if options.has_key? :email
|
|
|
|
data['emailAddress'] = options[:email]
|
2011-08-27 18:46:15 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
if data.empty?
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
request(
|
|
|
|
:expects => [202, 204],
|
|
|
|
:method => 'PUT',
|
|
|
|
:path => path,
|
2012-04-25 10:31:28 -04:00
|
|
|
:body => Fog::JSON.encode(data)
|
2011-08-27 18:46:15 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|