summaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-12-06 03:11:09 -0800
committerMatus Fabian <matfabia@cisco.com>2018-12-18 13:36:39 +0000
commitb686508c4edff42dac2ab140318de8aacb2ac18b (patch)
tree07cd05a8720548497bcecf1f8959fbbe9b9d6276 /test/vpp_papi_provider.py
parent003d5da298b2cd1e20400fb5fdcefce752ca616e (diff)
NAT44: nat44_add_del_lb_static_mapping enhancements (VPP-1514)
Change-Id: I5419e06592b0402e911e132796368800321f355a Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 0a33c1eb2ac..4ab4380692e 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -1668,6 +1668,39 @@ class VppPapiProvider(object):
'local_num': local_num,
'locals': locals})
+ def nat44_lb_static_mapping_add_del_local(
+ self,
+ external_addr,
+ external_port,
+ local_addr,
+ local_port,
+ protocol,
+ probability,
+ vrf_id=0,
+ is_add=1):
+ """Add/delete NAT44 load-balancing static mapping rule backend
+
+ :param external_addr: external IPv4 address of the servic
+ :param external_port: external L4 port number of the service
+ :param local_addr: IPv4 address of the internal node
+ :param local_port: L4 port number of the internal node
+ :param protocol: IP protocol number
+ :param probability: probability of the internal node
+ :param vrf_id: VRF id of the internal node
+ :param is_add: 1 if add, 0 if delete
+ """
+ return self.api(
+ self.papi.nat44_lb_static_mapping_add_del_local,
+ {'is_add': is_add,
+ 'external_addr': external_addr,
+ 'external_port': external_port,
+ 'local': {
+ 'addr': local_addr,
+ 'port': local_port,
+ 'probability': probability,
+ 'vrf_id': vrf_id},
+ 'protocol': protocol})
+
def nat44_lb_static_mapping_dump(self):
"""Dump NAT44 load balancing static mappings