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