1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

added support for both update and replace for dynect put_record request

This commit is contained in:
Josh Blancett 2013-09-25 14:46:12 -04:00
parent ff080a7760
commit dfe0043405

View file

@ -14,11 +14,15 @@ module Fog
def put_record(type, zone, fqdn, rdata, options = {})
options.merge!('rdata' => rdata)
type.to_s.upcase!
options = {"#{type}Records" => [options]} unless options['record_id']
path = ["#{type}Record", zone, fqdn].join('/')
path += "/#{options.delete('record_id')}" if options['record_id']
request(
:body => Fog::JSON.encode(options),
:expects => 200,
:method => :put,
:path => ["#{type.to_s.upcase}Record", zone, fqdn].join('/')
:path => path
)
end
end