Class: Fog::Network::OpenStack::FloatingIp
- Inherits:
-
OpenStack::Model
- Object
- Model
- OpenStack::Model
- Fog::Network::OpenStack::FloatingIp
- Defined in:
- lib/fog/openstack/models/network/floating_ip.rb
Instance Attribute Summary
Attributes inherited from OpenStack::Model
Instance Method Summary collapse
- #associate(port_id, fixed_ip_address = nil) ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #disassociate(fixed_ip_address = nil) ⇒ Object
-
#initialize(attributes) ⇒ FloatingIp
constructor
A new instance of FloatingIp.
- #update ⇒ Object
Methods inherited from OpenStack::Model
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 45 46 47 48 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 38 def associate(port_id, fixed_ip_address = nil) requires :id = if !fixed_ip_address.nil? { 'fixed_ip_address': fixed_ip_address } else {} end merge_attributes(service.associate_floating_ip(self.id, port_id, ).body['floatingip']) end |
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#disassociate(fixed_ip_address = nil) ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 50 def disassociate(fixed_ip_address = nil) requires :id = if !fixed_ip_address.nil? { 'fixed_ip_address': fixed_ip_address } else {} end merge_attributes(service.disassociate_floating_ip(self.id, ).body['floatingip']) end |
#update ⇒ Object
28 29 30 |
# File 'lib/fog/openstack/models/network/floating_ip.rb', line 28 def update self end |