Sha256: 47dbe57a4e1af1551d33a2f7a69cec1fff6f931aba3fc61439d197319acefe7a
Contents?: true
Size: 1.39 KB
Versions: 3
Compression:
Stored size: 1.39 KB
Contents
module Fog module Compute class RackspaceV2 class Real # Lists all networks and addresses associated with a specified server. # @param [String] server_id # @return [Excon::Response] response: # * body [Hash]: # * addresses [Hash] - key is the network name and the value are an array of addresses allocated for that network # @raise [Fog::Rackspace::Errors::NotFound] - HTTP 404 # @raise [Fog::Rackspace::Errors::BadRequest] - HTTP 400 # @raise [Fog::Rackspace::Errors::InternalServerError] - HTTP 500 # @raise [Fog::Rackspace::Errors::ServiceError] def list_addresses(server_id) request( :method => 'GET', :expects => 200, :path => "/servers/#{server_id}/ips" ) end end class Mock def list_addresses(server_id) raise Fog::Compute::RackspaceV2::NotFound.new if server_id == 0 response = Excon::Response.new response.status = 200 response.body = { "addresses" => { "public"=>[{"version"=>6, "addr"=>"2001:4800:7811:0513:0fe1:75e8:ff04:760b"}, {"version"=>4, "addr"=>"166.78.18.176"}], "private"=>[{"version"=>4, "addr"=>"10.181.129.68"}] } } response end end end end end
Version data entries
3 entries across 3 versions & 2 rubygems