mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[dynect|dns] support ANY record results.
This commit is contained in:
parent
3cb55c46ac
commit
d02adbd6f2
2 changed files with 11 additions and 1 deletions
|
@ -57,7 +57,11 @@ module Fog
|
|||
}]
|
||||
}
|
||||
else
|
||||
records = zone[:records][type].select { |record| record[:fqdn] == fqdn }
|
||||
records = if type == "ANY"
|
||||
zone[:records].values.flatten.select { |record| record[:fqdn] == fqdn }
|
||||
else
|
||||
zone[:records][type].select { |record| record[:fqdn] == fqdn }
|
||||
end
|
||||
response.body = {
|
||||
"status" => "success",
|
||||
"data" => records.collect { |record| "/REST/#{record[:type]}Record/#{record[:zone][:zone]}/#{record[:fqdn]}/#{record[:record_id]}" },
|
||||
|
|
|
@ -126,6 +126,12 @@ Shindo.tests('Dynect::dns | DNS requests', ['dynect', 'dns']) do
|
|||
data
|
||||
end
|
||||
|
||||
@dns.post_record('CNAME', @domain, @fqdn, {'address' => '1.2.3.4'}, {})
|
||||
|
||||
tests("get_record('ANY', '#{@domain}', '#{@fqdn}')").formats(get_records_format) do
|
||||
@dns.get_record('ANY', @domain, @fqdn)
|
||||
end
|
||||
|
||||
get_record_format = shared_format.merge({
|
||||
'data' => {
|
||||
'zone' => String,
|
||||
|
|
Loading…
Add table
Reference in a new issue