class OpenStack::Nova::Compute::FloatingIp
An OpenStack
Floating Ip
Attributes¶ ↑
-
ip
- Floating IP(v4/v6) address -
fixed_ip
- Fixed IP(v4/V6) address -
pool
- The id of the pool this IP belongs to -
instance_id
- Identifier of server this IPis assigned to (if any)
Public Class Methods
find_all_by_pool(pool)
click to toggle source
List of addresses for a given pool
Attributes¶ ↑
-
pool
- an instance ofOpenStack::Nova::Compute::FloatingIpPool
or a pool id
# File lib/open_stack/nova/compute/floating_ip.rb, line 53 def self.find_all_by_pool(pool) pool_id = pool.is_a?(OpenStack::Nova::Compute::FloatingIpPool) ? pool.id : pool all.reject! { |floating_ip| floating_ip.pool != pool_id } end
Public Instance Methods
assign!(server)
click to toggle source
Assign the IP to a server
Attributes:¶ ↑
-
server
- An instance ofOpenStack::Nova::Compute::Server
(or a server id) to assign the floating IP to
# File lib/open_stack/nova/compute/floating_ip.rb, line 69 def assign!(server) server_instance = server.is_a?(OpenStack::Nova::Compute::Server) ? server : Server.find(server) @instance = server_instance self.instance_id = server_instance.id server_instance.add_floating_ip(self) end
instance()
click to toggle source
The OpenStack::Nova::Compute::Server
instance this address belongs to (if any)
# File lib/open_stack/nova/compute/floating_ip.rb, line 59 def instance if instance_id @instance ||= Server.find(instance_id) end end