Class: Fog::OpenStack::Network::FloatingIp
- Defined in:
- lib/fog/openstack/network/models/floating_ip.rb
Instance Attribute Summary
Attributes inherited from 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 Model
Constructor Details
#initialize(attributes) ⇒ FloatingIp
Returns a new instance of FloatingIp.
16 17 18 19 |
# File 'lib/fog/openstack/network/models/floating_ip.rb', line 16 def initialize(attributes) @connection = attributes[:connection] super end |
Instance Method Details
#associate(port_id, fixed_ip_address = nil) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/fog/openstack/network/models/floating_ip.rb', line 39 def associate(port_id, fixed_ip_address = nil) requires :id merge_attributes(service.associate_floating_ip( id, port_id, (fixed_ip_address) ).body['floatingip']) end |
#create ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/fog/openstack/network/models/floating_ip.rb', line 21 def create requires :floating_network_id merge_attributes(service.create_floating_ip(floating_network_id, attributes).body['floatingip']) self end |
#destroy ⇒ Object
33 34 35 36 37 |
# File 'lib/fog/openstack/network/models/floating_ip.rb', line 33 def destroy requires :id service.delete_floating_ip(id) true end |
#disassociate(fixed_ip_address = nil) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/fog/openstack/network/models/floating_ip.rb', line 48 def disassociate(fixed_ip_address = nil) requires :id merge_attributes(service.disassociate_floating_ip( id, (fixed_ip_address) ).body['floatingip']) end |
#update ⇒ Object
29 30 31 |
# File 'lib/fog/openstack/network/models/floating_ip.rb', line 29 def update self end |