Sha256: a31791f19025981ad044523048092f537efd9e58b6a9785f8a9f73b1fb643342

Contents?: true

Size: 1.06 KB

Versions: 36

Compression:

Stored size: 1.06 KB

Contents

module Fog
  module Rackspace
    module Servers
      class Real

        # List private server addresses
        #
        # ==== Parameters
        # * server_id<~Integer> - Id of server to list addresses for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'private'<~Array> - Public ip addresses
        def list_private_addresses(server_id)
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => "servers/#{server_id}/ips/private.json"
          )
        end

      end

      class Mock

        def list_private_addresses(server_id)
          response = Excon::Response.new
          if server = list_servers_detail.body['servers'].detect { |server| server['id'] == server_id }
            response.status = [200, 203][rand(1)]
            response.body = { 'private' => server['addresses']['private'] }
            response
          else
            raise Fog::Rackspace::Servers::NotFound
          end
        end

      end
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.28 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.27 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.26 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.25 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.24 lib/fog/rackspace/requests/servers/list_private_addresses.rb
tecnh-fog-0.2.23.vpc lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.23 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.22 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.21 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.20 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.19 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.18 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.17 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.16 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.15 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.14 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.13 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.12 lib/fog/rackspace/requests/servers/list_private_addresses.rb
fog-0.2.11 lib/fog/rackspace/requests/servers/list_private_addresses.rb