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

[dynect|dns] Pass zone.records.all options through to get_node_list.

This is useful for the `:fqdn` option:

```
zone.records.all(:fqdn => "foo.bar.com") #=> only records under foo.bar.com
```
This commit is contained in:
Dan Peterson 2012-01-30 11:08:47 -04:00
parent cfd96c6cc5
commit 8e9b86f42a
2 changed files with 4 additions and 3 deletions

View file

@ -11,10 +11,10 @@ module Fog
model Fog::DNS::Dynect::Record
def all
def all(options = {})
requires :zone
data = []
connection.get_node_list(zone.domain).body['data'].each do |fqdn|
connection.get_node_list(zone.domain, options).body['data'].each do |fqdn|
records = connection.get_record('ANY', zone.domain, fqdn).body['data']
# data in format ['/REST/xRecord/domain/fqdn/identity]

View file

@ -11,10 +11,11 @@ module Fog
# * fqdn<~String> - fully qualified domain name of node to lookup
def get_node_list(zone, options = {})
requested_fqdn = options['fqdn'] || options[:fqdn]
request(
:expects => 200,
:method => :get,
:path => ['NodeList', zone, options['fqdn']].compact.join('/')
:path => ['NodeList', zone, requested_fqdn].compact.join('/')
)
end
end