Sha256: 0fa8ad3b862413d4a77442c1781885e185fbec4655fd8835dec0c754e37957c0

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

module Fog
  module AWS
    class DNS
      class Real

        require 'fog/dns/parsers/aws/get_hosted_zone'

        # retrieve information about a hosted zone
        #
        # ==== Parameters
        # * zone_id<~String> - The ID of the hosted zone
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'HostedZone'<~Hash>:
        #       * 'Id'<~String> - 
        #       * 'Name'<~String> - 
        #       * 'CallerReference'<~String>
        #       * 'Comment'<~String> - 
        #     * 'NameServers'<~Array>
        #       * 'NameServer'<~String>
        #   * status<~Integer> - 201 when successful
        def get_hosted_zone(zone_id)

          # AWS methods return zone_ids that looks like '/hostedzone/id'.  Let the caller either use 
          # that form or just the actual id (which is what this request needs)
          zone_id = zone_id.sub('/hostedzone/', '')

          request({
            :expects    => 200,
            :parser     => Fog::Parsers::AWS::DNS::GetHostedZone.new,
            :method     => 'GET',
            :path       => "hostedzone/#{zone_id}"
          })

        end

      end

      class Mock

        def get_hosted_zone(zone_id)
          Fog::Mock.not_implemented
        end


      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fog-0.5.1 lib/fog/dns/requests/aws/get_hosted_zone.rb
fog-0.5.0 lib/fog/dns/requests/aws/get_hosted_zone.rb
phpfog-fog-0.4.1.3 lib/fog/dns/requests/aws/get_hosted_zone.rb
phpfog-fog-0.4.1.2 lib/fog/dns/requests/aws/get_hosted_zone.rb
phpfog-fog-0.4.1.1 lib/fog/dns/requests/aws/get_hosted_zone.rb
phpfog-fog-0.4.1 lib/fog/dns/requests/aws/get_hosted_zone.rb
fog-0.4.1 lib/fog/dns/requests/aws/get_hosted_zone.rb