Sha256: 4345bc8596891b5587471e91539126aa915d13771b209b546596f7d04f624c4d
Contents?: true
Size: 1.11 KB
Versions: 48
Compression:
Stored size: 1.11 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'] } else response.status = 404 raise(Excon::Errors.status_error({:expects => 202}, response)) end response end end end end end
Version data entries
48 entries across 48 versions & 1 rubygems