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/models/compute/addresses.rb

30 lines
546 B
Ruby
Raw Normal View History

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
2012-12-22 18:26:21 -05:00
data = service.list_addresses.body['floating_ips']
load(data)
end
def get(address_id)
2012-12-22 18:26:21 -05:00
if address = service.get_address(address_id).body['floating_ip']
new(address)
end
rescue Fog::Compute::HP::NotFound
nil
end
end
end
end
end