aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/VPPUtil.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/VPPUtil.py')
-rw-r--r--resources/libraries/python/VPPUtil.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py
index c735494282..a7ec44c974 100644
--- a/resources/libraries/python/VPPUtil.py
+++ b/resources/libraries/python/VPPUtil.py
@@ -361,3 +361,26 @@ class VPPUtil:
logger.trace(f"show threads:\n{threads_data}")
return threads_data
+
+ @staticmethod
+ def vpp_add_graph_node_next(node, graph_node_name, graph_next_name):
+ """Set the next node for a given node.
+
+ :param node: Node to run command on.
+ :param graph_node_name: Graph node to add the next node on.
+ :param graph_next_name: Graph node to add as the next node.
+ :type node: dict
+ :type graph_node_name: str
+ :type graph_next_name: str
+ :returns: The index of the next node.
+ :rtype: int
+ """
+ cmd = u"add_node_next"
+ args = dict(
+ node_name=graph_node_name,
+ next_name=graph_next_name
+ )
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd, **args).get_reply()
+
+ return reply[u"next_index"]