Sha256: 6d45e87d27b6cc80997ace54d76c1f15883fe8b6ad623e2109c0bb0d42d2b30c

Contents?: true

Size: 1.07 KB

Versions: 32

Compression:

Stored size: 1.07 KB

Contents

#
# AFAICT this is basically undocumented ATM - 6/18/2010 - freeformz
#

module Fog
  module Compute
    class Ecloud

      class Real
        basic_request :get_network_ip
      end

      class Mock

        def get_network_ip(network_ip_uri)
          if network_ip = mock_data.network_ip_from_href(network_ip_uri)
            builder = Builder::XmlMarkup.new
            xml = network_ip_response(builder, network_ip, ecloud_xmlns)

            mock_it 200, xml, { 'Content-Type' => 'application/vnd.tmrk.ecloud.ip+xml' }
          else
            mock_error 200, "401 Unauthorized"
          end
        end

        def network_ip_response(builder, network_ip, xmlns = {})
          builder.IpAddress(xmlns) do
            builder.Id network_ip.object_id
            builder.Href network_ip.href
            builder.Name network_ip.name

            builder.Status network_ip.status
            if network_ip.used_by
              builder.Server network_ip.used_by.name
            end

            builder.RnatAddress(network_ip.rnat)
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
michiels-fog-1.3.1 lib/fog/ecloud/requests/compute/get_network_ip.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
fog-1.3.1 lib/fog/ecloud/requests/compute/get_network_ip.rb
fog-1.3.0 lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
fog-1.2.0 lib/fog/ecloud/requests/compute/get_network_ip.rb
ktheory-fog-1.1.2 lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
fog-1.1.2 lib/fog/ecloud/requests/compute/get_network_ip.rb
fog_tractical-1.1.4 lib/fog/ecloud/requests/compute/get_network_ip.rb
fog_tractical-1.1.3 lib/fog/ecloud/requests/compute/get_network_ip.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_network_ip.rb
fog-1.1.1 lib/fog/ecloud/requests/compute/get_network_ip.rb
fog-1.1.0 lib/fog/ecloud/requests/compute/get_network_ip.rb