1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/hp/requests/compute/get_address.rb
Paul Thornthwaite 2e0b7e545a Standardise empty lines throughout codebase
Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
2014-05-26 14:20:02 +01:00

41 lines
1.2 KiB
Ruby

module Fog
module Compute
class HP
class Real
# Get details about an existing floating IP address
#
# ==== Parameters
# * 'address_id'<~Integer> - Id of floating IP address get details for
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'floating_ip'<~Hash> -
# * 'id'<~Integer> - Id of the address
# * 'ip'<~String> - Floating IP of the address
# * 'instance_id'<~String> - Id of the associated server instance
# * 'fixed_ip'<~String> - Fixed IP of the address
def get_address(address_id)
request(
:expects => [200],
:method => 'GET',
:path => "os-floating-ips/#{address_id}"
)
end
end
class Mock
def get_address(address_id)
response = Excon::Response.new
if address = self.data[:addresses][address_id]
response.status = 200
response.body = { 'floating_ip' => address }
response
else
raise Fog::Compute::HP::NotFound
end
end
end
end
end
end