def get_routed_path(ver):
""" Routed Paths, accepts vrf """
onepath = False
depth = '20'
vrf = 'default'
error = version_chk(ver, ['v1.0', 'v1.1', 'v2'])
if error:
return error
if 'onepath' in request.args:
if request.args['onepath'] == "True":
onepath = True
if 'depth' in request.args:
depth = request.args['depth']
if 'vrf' in request.args:
vrf = request.args['vrf']
try:
return jsonify(upgrade_api(nglib.query.path.get_routed_path(request.args['src'], \
request.args['dst'], {"onepath": onepath, "depth": depth, \
"VRF": vrf}), ver))
except ResultError as e:
return jsonify(errors.json_error(e.expression, e.message))
评论列表
文章目录