Sha256: a12f0afc021e948b3da6fa5994925cd860ac975717f7d1038a0f5870cd71a9a5

Contents?: true

Size: 1.48 KB

Versions: 13

Compression:

Stored size: 1.48 KB

Contents

module Fog
  module DNS
    class Dynect
      class Real

        # Get one or more node lists
        #
        # ==== Parameters
        # * zone<~String> - zone to lookup node lists for
        # * options<~Hash>
        #   * fqdn<~String> - fully qualified domain name of node to lookup

        def get_node_list(zone, options = {})
          request(
            :expects  => 200,
            :method   => :get,
            :path     => ['NodeList', zone, options['fqdn']].compact.join('/')
          )
        end
      end

      class Mock
        def get_node_list(zone, options = {})
          raise Fog::DNS::Dynect::NotFound unless zone = self.data[:zones][zone]

          response = Excon::Response.new
          response.status = 200

          data = [zone[:zone]]

          if fqdn = options[:fqdn]
            data = data | zone[:records].collect { |type, records| records.select { |record| record[:fqdn] == fqdn } }.flatten.compact
          else
            data = data | zone[:records].collect { |type, records| records.collect { |record| record[:fqdn] } }.flatten
          end

          response.body = {
            "status" => "success",
            "data" => data,
            "job_id" => Fog::Dynect::Mock.job_id,
            "msgs" => [{
              "INFO" => "get_tree: Here is your zone tree",
              "SOURCE" => "BLL",
              "ERR_CD" => nil,
              "LVL" => "INFO"
            }]
          }

          response
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb
fog-1.1.2 lib/fog/dynect/requests/dns/get_node_list.rb
fog_tractical-1.1.4 lib/fog/dynect/requests/dns/get_node_list.rb
fog_tractical-1.1.3 lib/fog/dynect/requests/dns/get_node_list.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb
fog-1.1.1 lib/fog/dynect/requests/dns/get_node_list.rb
fog-1.1.0 lib/fog/dynect/requests/dns/get_node_list.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb
tag-fog-1.0.1 lib/fog/dynect/requests/dns/get_node_list.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/dynect/requests/dns/get_node_list.rb
fog-1.0.0 lib/fog/dynect/requests/dns/get_node_list.rb