mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00

Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
25 lines
542 B
Ruby
25 lines
542 B
Ruby
require 'fog/core/collection'
|
|
require 'fog/hp/models/compute/address'
|
|
|
|
module Fog
|
|
module Compute
|
|
class HP
|
|
class Addresses < Fog::Collection
|
|
model Fog::Compute::HP::Address
|
|
|
|
def all
|
|
data = service.list_addresses.body['floating_ips']
|
|
load(data)
|
|
end
|
|
|
|
def get(address_id)
|
|
if address = service.get_address(address_id).body['floating_ip']
|
|
new(address)
|
|
end
|
|
rescue Fog::Compute::HP::NotFound
|
|
nil
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|