Sha256: 954462b8fac1f5bef1b0d4804ea27a4865f464ab5cecc5516878e59ebfec9066

Contents?: true

Size: 1.05 KB

Versions: 25

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module Compute
    class OpenStack
      class Real
        def allocate_address(pool = nil)
          request(
            :body    => Fog::JSON.encode('pool' => pool),
            :expects => [200, 202],
            :method  => 'POST',
            :path    => 'os-floating-ips'
          )
        end
      end

      class Mock
        def allocate_address(_pool = nil)
          response = Excon::Response.new
          response.status = 200
          response.headers = {
            "X-Compute-Request-Id" => "req-d4a21158-a86c-44a6-983a-e25645907f26",
            "Content-Type"         => "application/json",
            "Content-Length"       => "105",
            "Date"                 => Date.new
          }
          response.body = {
            "floating_ip" => {
              "instance_id" => nil,
              "ip"          => "192.168.27.132",
              "fixed_ip"    => nil,
              "id"          => 4,
              "pool"        => "nova"
            }
          }
          response
        end
      end
    end
  end
end

Version data entries

25 entries across 23 versions & 3 rubygems

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