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

#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(self.floating_network_id,

                                            self.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(self.id)
  true
end

#updateObject



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

def update
  self
end