Sha256: 521850a465991a91c53b207075ae1d542b34f0af13f947395d3c884140c55885

Contents?: true

Size: 1.18 KB

Versions: 78

Compression:

Stored size: 1.18 KB

Contents

module Fog
  module Network
    class OpenStack
      class Real
        def get_floating_ip(floating_ip_id)
          request(
            :expects => [200],
            :method  => 'GET',
            :path    => "floatingips/#{floating_ip_id}"
          )
        end
      end

      class Mock
        def get_floating_ip(floating_ip_id)
          response = Excon::Response.new
          if data = self.data[:floating_ips][floating_ip_id]
            response.status = 200
            response.body = {
              "floatingip" => {
                "id"                  => "00000000-0000-0000-0000-000000000000",
                # changed
                # "floating_ip_id" => floating_ip_id,
                "port_id"             => data["port_id"],
                "tenant_id"           => data["tenant_id"],
                "fixed_ip_address"    => data["fixed_ip_address"],
                "router_id"           => "00000000-0000-0000-0000-000000000000",
                "floating_ip_address" => data["floating_ip_address"],
              }
            }
            response
          else
            raise Fog::Network::OpenStack::NotFound
          end
        end
      end
    end
  end
end

Version data entries

78 entries across 76 versions & 7 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.10 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.1.30 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.1.29 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.9 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.1.28 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.8 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.7 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.6 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.5 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.4 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.3 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.2 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.3.0 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.2.4 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.2.3 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.2.2 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.2.1 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-openstack-0.2.0 lib/fog/network/openstack/requests/get_floating_ip.rb
fog-zj-0.1.28 lib/fog/network/openstack/requests/get_floating_ip.rb