Class: Fog::HP::Network::Router
- Inherits:
-
Model
- Object
- Model
- Fog::HP::Network::Router
- Defined in:
- lib/fog/hp/models/network/router.rb
Instance Method Summary collapse
- #add_interface(subnet_id = nil, port_id = nil, options = {}) ⇒ Object
- #destroy ⇒ Object
- #ready? ⇒ Boolean
- #remove_interface(subnet_id = nil, port_id = nil, options = {}) ⇒ Object
- #save ⇒ Object
Instance Method Details
#add_interface(subnet_id = nil, port_id = nil, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/fog/hp/models/network/router.rb', line 21 def add_interface(subnet_id=nil, port_id=nil, ={}) requires :id begin service.add_router_interface(id, subnet_id, port_id, ).body['router'] true rescue ArgumentError, Fog::HP::Network::NotFound false end end |
#destroy ⇒ Object
15 16 17 18 19 |
# File 'lib/fog/hp/models/network/router.rb', line 15 def destroy requires :id service.delete_router(id) true end |
#ready? ⇒ Boolean
41 42 43 |
# File 'lib/fog/hp/models/network/router.rb', line 41 def ready? self.status == 'ACTIVE' end |
#remove_interface(subnet_id = nil, port_id = nil, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/fog/hp/models/network/router.rb', line 31 def remove_interface(subnet_id=nil, port_id=nil, ={}) requires :id begin service.remove_router_interface(id, subnet_id, port_id, ) true rescue ArgumentError, Fog::HP::Network::NotFound false end end |
#save ⇒ Object
45 46 47 |
# File 'lib/fog/hp/models/network/router.rb', line 45 def save identity ? update : create end |