Sha256: b93ae1d83be48d1f5dd62648bf953f86ccc244c30704212cf47d49dc5e8206f8

Contents?: true

Size: 1.06 KB

Versions: 17

Compression:

Stored size: 1.06 KB

Contents

module Fog
  class Vcloud
    module Terremark
      class Ecloud

        class Real
          basic_request :get_public_ip
        end

        class Mock
          #
          #Based off of:
          #http://support.theenterprisecloud.com/kb/default.asp?id=567&Lang=1&SID=
          #

          def get_public_ip(public_ip_uri)
            public_ip_uri = ensure_unparsed(public_ip_uri)
            if ip = mock_data[:organizations].map { |org| org[:vdcs] }.flatten.map { |vdc| vdc[:public_ips] }.flatten.detect { |ip| ip[:href] == public_ip_uri }
              xml = Builder::XmlMarkup.new
              mock_it 200,
                xml.PublicIp(:xmlns => "urn:tmrk:eCloudExtensions-2.0", :"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance") {
                  xml.Id(ip[:id])
                  xml.Href(ip[:href])
                  xml.Name(ip[:name])
                }, { 'Content-Type' => 'application/vnd.tmrk.ecloud.publicIp+xml' }
            else
              mock_error 200, "401 Unauthorized"
            end
          end

        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fog-0.3.16 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.15 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.14 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.13 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.12 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.11 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.10 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.9 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.8 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.7 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.6 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.5 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.4 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.3 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.2 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.1 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb
fog-0.3.0 lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb