示例#1
0
文件: jsonrpc.py 项目: rolaya/os-ken
 def _neighbor_create(self, ip_address='192.168.177.32',
                      remote_as=64513):
     bgp_neighbor = {}
     bgp_neighbor[neighbors.IP_ADDRESS] = str(ip_address)
     bgp_neighbor[neighbors.REMOTE_AS] = remote_as
     call('neighbor.create', **bgp_neighbor)
     return {}
示例#2
0
文件: jsonrpc.py 项目: rolaya/os-ken
 def _core_start(self, as_number=64512, router_id='10.0.0.1'):
     common_settings = {}
     common_settings[LOCAL_AS] = as_number
     common_settings[ROUTER_ID] = str(router_id)
     waiter = hub.Event()
     call('core.start', waiter=waiter, **common_settings)
     waiter.wait()
     return {}
示例#3
0
文件: jsonrpc.py 项目: rolaya/os-ken
 def _show_rib(self, family='ipv4'):
     show = {}
     show['params'] = ['rib', family]
     return call('operator.show', **show)
示例#4
0
文件: jsonrpc.py 项目: rolaya/os-ken
 def _neighbors_get(self):
     return call('neighbors.get')
示例#5
0
文件: jsonrpc.py 项目: rolaya/os-ken
 def _prefix_add(self, prefix='10.20.0.0/24'):
     networks = {}
     networks[PREFIX] = str(prefix)
     call('network.add', **networks)
     return {}