Class: Fog::Network::OpenStack::FloatingIp

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/openstack/models/network/floating_ip.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#save

Constructor Details

#initialize(attributes) ⇒ FloatingIp

Returns a new instance of FloatingIp.



15
16
17
18
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 15

def initialize(attributes)
  @connection = attributes[:connection]
  super
end

Instance Method Details

#associate(port_id, fixed_ip_address = nil) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 38

def associate(port_id, fixed_ip_address = nil)
  requires :id
  merge_attributes(service.associate_floating_ip(
    id,
    port_id,
    options(fixed_ip_address)).body['floatingip'])
end

#createObject



20
21
22
23
24
25
26
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 20

def create
  requires :floating_network_id
  merge_attributes(service.create_floating_ip(floating_network_id,

                                              attributes).body['floatingip'])
  self
end

#destroyObject



32
33
34
35
36
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 32

def destroy
  requires :id
  service.delete_floating_ip(id)
  true
end

#disassociate(fixed_ip_address = nil) ⇒ Object



46
47
48
49
50
51
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 46

def disassociate(fixed_ip_address = nil)
  requires :id
  merge_attributes(service.disassociate_floating_ip(
    id,
    options(fixed_ip_address)).body['floatingip'])
end

#updateObject



28
29
30
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 28

def update
  self
end