Loading src/device/service/drivers/gnmi_openconfig/handlers/NetworkInstanceStaticRoute.py +17 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,23 @@ class NetworkInstanceStaticRouteHandler(_Handler): PATH_TMPL = '/network-instances/network-instance[name={:s}]/protocols' PATH_TMPL += '/protocol[identifier={:s}][name={:s}]/static-routes/static[prefix={:s}]' str_path = PATH_TMPL.format(ni_name, identifier, proto_name, prefix) root_node : libyang.DContainer = yang_handler.get_data_path( '/openconfig-network-instance:network-instances' ) yang_ni_pr_sr_path = root_node.find_path('/'.join([ '', # add slash at the beginning 'openconfig-network-instance:network-instances', 'network-instance[name="{:s}"]'.format(ni_name), 'protocols', 'protocol[identifier="{:s}"][name="{:s}"]'.format(identifier, proto_name), 'static-routes', 'static[prefix="{:s}"]'.format(prefix) ])) if yang_ni_pr_sr_path is not None: yang_ni_pr_sr_path.unlink() yang_ni_pr_sr_path.free() str_data = json.dumps({}) return str_path, str_data Loading Loading
src/device/service/drivers/gnmi_openconfig/handlers/NetworkInstanceStaticRoute.py +17 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,23 @@ class NetworkInstanceStaticRouteHandler(_Handler): PATH_TMPL = '/network-instances/network-instance[name={:s}]/protocols' PATH_TMPL += '/protocol[identifier={:s}][name={:s}]/static-routes/static[prefix={:s}]' str_path = PATH_TMPL.format(ni_name, identifier, proto_name, prefix) root_node : libyang.DContainer = yang_handler.get_data_path( '/openconfig-network-instance:network-instances' ) yang_ni_pr_sr_path = root_node.find_path('/'.join([ '', # add slash at the beginning 'openconfig-network-instance:network-instances', 'network-instance[name="{:s}"]'.format(ni_name), 'protocols', 'protocol[identifier="{:s}"][name="{:s}"]'.format(identifier, proto_name), 'static-routes', 'static[prefix="{:s}"]'.format(prefix) ])) if yang_ni_pr_sr_path is not None: yang_ni_pr_sr_path.unlink() yang_ni_pr_sr_path.free() str_data = json.dumps({}) return str_path, str_data Loading