Class: Fog::Network::OpenStack::FloatingIp
- Inherits:
-
Model
- Object
- Model
- Fog::Network::OpenStack::FloatingIp
- Defined in:
- lib/fog/openstack/models/network/floating_ip.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ FloatingIp
constructor
A new instance of FloatingIp.
- #save ⇒ Object
- #update ⇒ Object
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
#create ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 25 def create requires :floating_network_id merge_attributes(service.create_floating_ip(self.floating_network_id, self.attributes).body['floatingip']) self end |
#destroy ⇒ Object
37 38 39 40 41 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 37 def destroy requires :id service.delete_floating_ip(self.id) true end |
#save ⇒ Object
20 21 22 23 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 20 def save requires :floating_network_id identity ? update : create end |
#update ⇒ Object
33 34 35 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 33 def update self end |