Class: Fog::HP::Network::FloatingIp
- Inherits:
-
Model
- Object
- Model
- Fog::HP::Network::FloatingIp
- Defined in:
- lib/fog/hp/models/network/floating_ip.rb
Instance Method Summary collapse
- #associate_port(port_id, options = {}) ⇒ Object
- #destroy ⇒ Object
- #disassociate_port(options = {}) ⇒ Object
- #save ⇒ Object
Instance Method Details
#associate_port(port_id, options = {}) ⇒ Object
22 23 24 25 26 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 22 def associate_port(port_id, ={}) requires :id merge_attributes(service.associate_floating_ip(id, port_id, ).body['floatingip']) true end |
#destroy ⇒ Object
16 17 18 19 20 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 16 def destroy requires :id service.delete_floating_ip(id) true end |
#disassociate_port(options = {}) ⇒ Object
28 29 30 31 32 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 28 def disassociate_port(={}) requires :id merge_attributes(service.disassociate_floating_ip(id, ).body['floatingip']) true end |
#save ⇒ Object
34 35 36 37 38 39 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 34 def save requires :floating_network_id raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? merge_attributes(service.create_floating_ip(floating_network_id, attributes).body['floatingip']) true end |