1
0
Fork 0
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:
Dylan Egan 2011-09-01 16:11:14 -07:00
parent 3cb55c46ac
commit d02adbd6f2
2 changed files with 11 additions and 1 deletions

View file

@ -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]}" },

View file

@ -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,