Sha256: 19e91e9afc7e36515f0bcdce97a2aee72acb596fce5139b8c05364fb6d91a09c
Contents?: true
Size: 1.17 KB
Versions: 27
Compression:
Stored size: 1.17 KB
Contents
unless Fog.mocking? module Fog module Rackspace class Servers # 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 end end else module Fog module Rackspace class Servers 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
27 entries across 27 versions & 1 rubygems