Class: Fog::Compute::HPV2::Addresses

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/hp/models/compute_v2/addresses.rb

Instance Method Summary collapse

Instance Method Details

#allObject


10
11
12
13
# File 'lib/fog/hp/models/compute_v2/addresses.rb', line 10

def all
  data = service.list_addresses.body['floating_ips']
  load(data)
end

#get(address_id) ⇒ Object


15
16
17
18
19
20
21
# File 'lib/fog/hp/models/compute_v2/addresses.rb', line 15

def get(address_id)
  if address = service.get_address(address_id).body['floating_ip']
    new(address)
  end
rescue Fog::Compute::HPV2::NotFound
  nil
end