aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/Policer.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2024-04-11 18:24:03 +0200
committerVratko Polak <vrpolak@cisco.com>2024-04-15 12:58:43 +0200
commit6c2ca55d7ad00605976d96b14d83786a35f383c2 (patch)
treeecb2e1e8ce8ad1e393ed1184d9f3539d0d928d64 /resources/libraries/python/Policer.py
parent872481a0f65472e8d40f7503f9fc7e5766c428eb (diff)
feat(api): Use newest API messages after rls2402
+ gtpu_add_del_tunnel_v2 + Add comments on used values and unused fields. + ipsec_sad_entry_add_v2 + Explicitly pass current default values. + ipsec_sa_v5_dump + policer_add + The old is_add argument removed, it was never false. + sr_policy_add_v2 + Add comments about currently unused fields. + Support also older VP builds with wrong reply. + rdma_create_v4 + Add comments about unused fields. Change-Id: I3d5bc345c4cf099661626770c4d86bc230643cca Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/Policer.py')
-rw-r--r--resources/libraries/python/Policer.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/resources/libraries/python/Policer.py b/resources/libraries/python/Policer.py
index 6d3bf86462..28ed0b0aa9 100644
--- a/resources/libraries/python/Policer.py
+++ b/resources/libraries/python/Policer.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -72,7 +72,7 @@ class Policer:
def policer_set_configuration(
node, policer_name, cir, eir, cbs, ebs, rate_type, round_type,
policer_type, conform_action_type, exceed_action_type,
- violate_action_type, color_aware, is_add=True, conform_dscp=None,
+ violate_action_type, color_aware, conform_dscp=None,
exceed_dscp=None, violate_dscp=None):
"""Configure policer on VPP node.
@@ -89,7 +89,6 @@ class Policer:
:param exceed_action_type: Exceed action type.
:param violate_action_type: Violate action type.
:param color_aware: Color-blind (cb) or color-aware (ca).
- :param is_add: Add policer if True, else delete.
:param conform_dscp: DSCP for conform mark_and_transmit action.
:param exceed_dscp: DSCP for exceed mark_and_transmit action.
:param violate_dscp: DSCP for vilate mark_and_transmit action.
@@ -106,7 +105,6 @@ class Policer:
:type exceed_action_type: str
:type violate_action_type: str
:type color_aware: str
- :type is_add: bool
:type conform_dscp: str
:type exceed_dscp: str
:type violate_dscp: str
@@ -130,10 +128,8 @@ class Policer:
else 0
)
- cmd = u"policer_add_del"
- args = dict(
- is_add=is_add,
- name=str(policer_name),
+ cmd = u"policer_add"
+ infos = dict(
cir=int(cir),
eir=int(eir),
cb=int(cbs),
@@ -148,6 +144,10 @@ class Policer:
violate_action=violate_action,
color_aware=bool(color_aware == u"'ca'")
)
+ args = dict(
+ name=str(policer_name),
+ infos=infos,
+ )
err_msg = f"Failed to configure policer {policer_name} " \
f"on host {node['host']}"