Class: Fog::Compute::OpenStack::Addresses

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/compute/openstack/models/addresses.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object


10
11
12
# File 'lib/fog/compute/openstack/models/addresses.rb', line 10

def all(options = {})
  load_response(service.list_all_addresses(options), 'floating_ips')
end

#get(address_id) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/fog/compute/openstack/models/addresses.rb', line 14

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

#get_address_poolsObject


22
23
24
# File 'lib/fog/compute/openstack/models/addresses.rb', line 22

def get_address_pools
  service.list_address_pools.body['floating_ip_pools']
end