Sha256: ce33f4e0cad9e768f9bfe1665d69186cb9f7f959f9161ba8464f4bab32e2cbd9

Contents?: true

Size: 1006 Bytes

Versions: 14

Compression:

Stored size: 1006 Bytes

Contents

module Fog
  module DNS
    class Google
      ##
      # Fetches the representation of an existing Managed Zone.
      #
      # @see https://developers.google.com/cloud-dns/api/v1/managedZones/get
      class Real
        def get_managed_zone(name_or_id)
          api_method = @dns.managed_zones.get
          parameters = {
            "project" => @project,
            "managedZone" => name_or_id
          }

          request(api_method, parameters)
        end
      end

      class Mock
        def get_managed_zone(name_or_id)
          if data[:managed_zones].key?(name_or_id)
            data = self.data[:managed_zones][name_or_id]
          else
            data = self.data[:managed_zones].values.detect { |zone| zone["name"] = name_or_id }
          end

          unless data
            raise Fog::Errors::NotFound, "The 'parameters.managedZone' resource named '#{name_or_id}' does not exist."
          end

          build_excon_response(data)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.5.5 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.5.4 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.5.3 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.5.2 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.5.1 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.5.0 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.4.2 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.4.1 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.4.0 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.3.2 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.3.1 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.3.0 lib/fog/dns/google/requests/get_managed_zone.rb
fog-google-0.2.0 lib/fog/dns/google/requests/get_managed_zone.rb