Class: Yao::Resources::Router
- Inherits:
-
Base
- Object
- Base
- Yao::Resources::Router
show all
- Defined in:
- lib/yao/resources/router.rb
Instance Attribute Summary
#api_version, #service
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #updated
#admin=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #list, #resources_path, #resources_path=, #return_single_on_querying=, #update, #with_resources_path
Class Method Details
.add_interface(id, param) ⇒ Object
16
17
18
|
# File 'lib/yao/resources/router.rb', line 16
def add_interface(id, param)
PUT(['routers', id, 'add_router_interface.json'].join('/'), param.to_json)
end
|
.get_by_name(name) ⇒ Object
Also known as:
find_by_name
24
25
26
|
# File 'lib/yao/resources/router.rb', line 24
def get_by_name(name)
self.list(name: name)
end
|
.remove_interface(id, param) ⇒ Object
20
21
22
|
# File 'lib/yao/resources/router.rb', line 20
def remove_interface(id, param)
PUT(['routers', id, 'remove_router_interface.json'].join('/'), param.to_json)
end
|
Instance Method Details
#interfaces ⇒ Object
11
12
13
|
# File 'lib/yao/resources/router.rb', line 11
def interfaces
Yao::Port.list(device_id: id)
end
|