mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[zerigo|dns] save or update models
This commit is contained in:
parent
0aed60339e
commit
0fd90a8fa5
2 changed files with 14 additions and 2 deletions
|
@ -36,7 +36,13 @@ module Fog
|
|||
options[:notes] = notes if notes
|
||||
options[:priority] = priority if priority
|
||||
options[:ttl] = ttl if ttl
|
||||
data = connection.create_host(@zone.id, type, ip, options)
|
||||
data = unless identity
|
||||
connection.create_host(@zone.id, type, ip, options)
|
||||
else
|
||||
options[:host_type] = type
|
||||
options[:data] = data
|
||||
connection.update_host(identity, options)
|
||||
end
|
||||
merge_attributes(data.body)
|
||||
true
|
||||
end
|
||||
|
|
|
@ -70,7 +70,13 @@ module Fog
|
|||
# * notes<~String> - notes about the domain
|
||||
# * restrict_axfr<~String> - indicates if AXFR transfers should be restricted to IPs in axfr-ips
|
||||
# * tag_list<~String> - List of all tags associated with this domain
|
||||
data = connection.create_zone(domain, ttl, type, options)
|
||||
data = unless identity
|
||||
connection.create_zone(domain, ttl, type, options)
|
||||
else
|
||||
options[:default_ttl] = ttl
|
||||
options[:ns_type] = type
|
||||
connection.update_zone(identity, options)
|
||||
end
|
||||
merge_attributes(data.body)
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue