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

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

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/compute/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/openstack/compute/models/addresses.rb', line 14

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

#get_address_poolsObject



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

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