Class: Yao::Resources::Router

Inherits:
Base
  • Object
show all
Includes:
TenantAssociationable
Defined in:
lib/yao/resources/router.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#service

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TenantAssociationable

included, #tenant

Methods inherited from Base

#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #to_hash, #updated

Methods included from RestfullyAccessible

#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update

Constructor Details

This class inherits a constructor from Yao::Resources::Base

Class Method Details

.add_interface(id, param) ⇒ Object



18
19
20
# File 'lib/yao/resources/router.rb', line 18

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



26
27
28
# File 'lib/yao/resources/router.rb', line 26

def get_by_name(name)
  self.list(name: name)
end

.remove_interface(id, param) ⇒ Object



22
23
24
# File 'lib/yao/resources/router.rb', line 22

def remove_interface(id, param)
  PUT(['routers', id, 'remove_router_interface.json'].join('/'), param.to_json)
end

Instance Method Details

#interfacesObject



13
14
15
# File 'lib/yao/resources/router.rb', line 13

def interfaces
  Yao::Port.list(device_id: id)
end