Sha256: d8f4f955f176a2ff5d245479f25d2f9a9cd714ae648da867eef5437500df6877

Contents?: true

Size: 1009 Bytes

Versions: 7

Compression:

Stored size: 1009 Bytes

Contents

module Fog
  module Ecloud
    class Compute

      class Real
        basic_request :get_public_ips
      end

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

        def get_public_ips(public_ips_uri)
          public_ips_uri = ensure_unparsed(public_ips_uri)

          if public_ip_collection = mock_data.public_ip_collection_from_href(public_ips_uri)
            xml = Builder::XmlMarkup.new
            mock_it 200,
              xml.PublicIPAddresses {
                public_ip_collection.items.each do |ip|
                  xml.PublicIPAddress {
                    xml.Id ip.object_id
                    xml.Href ip.href
                    xml.Name ip.name
                  }
                end
              }, { 'Content-Type' => 'application/vnd.tmrk.ecloud.publicIpsList+xml'}
          else
            mock_error 200, "401 Unauthorized"
          end
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/compute/requests/ecloud/get_public_ips.rb
fog-0.8.1 lib/fog/compute/requests/ecloud/get_public_ips.rb
fog-0.8.0 lib/fog/compute/requests/ecloud/get_public_ips.rb
fog-0.7.2 lib/fog/compute/requests/ecloud/get_public_ips.rb
fog-0.7.1 lib/fog/compute/requests/ecloud/get_public_ips.rb
fog-0.7.0 lib/fog/compute/requests/ecloud/get_public_ips.rb
fog-0.6.0 lib/fog/compute/requests/ecloud/get_public_ips.rb