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
23 24 25 26 27 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 23 def associate_port(port_id, ={}) requires :id merge_attributes(service.associate_floating_ip(id, port_id, ).body['floatingip']) true end |
#destroy ⇒ Object
17 18 19 20 21 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 17 def destroy requires :id service.delete_floating_ip(id) true end |
#disassociate_port(options = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 29 def disassociate_port(={}) requires :id merge_attributes(service.disassociate_floating_ip(id, ).body['floatingip']) true end |
#save ⇒ Object
35 36 37 38 39 40 |
# File 'lib/fog/hp/models/network/floating_ip.rb', line 35 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 |