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:
parent
ff080a7760
commit
dfe0043405
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue