Class: Fog::Network::OpenStack::Router
- Inherits:
-
Model
- Object
- Model
- Fog::Network::OpenStack::Router
- Defined in:
- lib/fog/openstack/models/network/router.rb
Overview
The Layer-3 Networking Extensions (router)
A logical entity for forwarding packets across internal subnets and NATting them on external networks through an appropriate external gateway.
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ Router
constructor
A new instance of Router.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Router
Returns a new instance of Router.
22 23 24 25 26 |
# File 'lib/fog/openstack/models/network/router.rb', line 22 def initialize(attributes) # Old 'connection' is renamed as service and should be used instead prepare_service_value(attributes) super end |
Instance Method Details
#create ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/fog/openstack/models/network/router.rb', line 33 def create requires :name response = service.create_router(self.name, ) merge_attributes(response.body['router']) self end |
#destroy ⇒ Object
49 50 51 52 53 |
# File 'lib/fog/openstack/models/network/router.rb', line 49 def destroy requires :id service.delete_router(self.id) true end |
#save ⇒ Object
28 29 30 31 |
# File 'lib/fog/openstack/models/network/router.rb', line 28 def save requires :name identity ? update : create end |
#update ⇒ Object
42 43 44 45 46 47 |
# File 'lib/fog/openstack/models/network/router.rb', line 42 def update requires :id response = service.update_router(self.id, ) merge_attributes(response.body['router']) self end |