Class: Fog::HP::Network::Router
- Defined in:
- lib/fog/hp/models/network/router.rb
Instance Attribute Summary
Attributes inherited from Model
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
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#add_interface(subnet_id = nil, port_id = nil, options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/fog/hp/models/network/router.rb', line 22 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
16 17 18 19 20 |
# File 'lib/fog/hp/models/network/router.rb', line 16 def destroy requires :id service.delete_router(id) true end |
#ready? ⇒ Boolean
42 43 44 |
# File 'lib/fog/hp/models/network/router.rb', line 42 def ready? self.status == 'ACTIVE' end |
#remove_interface(subnet_id = nil, port_id = nil, options = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/hp/models/network/router.rb', line 32 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
46 47 48 |
# File 'lib/fog/hp/models/network/router.rb', line 46 def save identity ? update : create end |