diff options
author | Matus Fabian <matfabia@cisco.com> | 2019-02-26 09:05:23 -0800 |
---|---|---|
committer | Matus Fabian <matfabia@cisco.com> | 2019-02-27 00:56:32 -0800 |
commit | 34931eb47124ef78a3aa9575930e848a78c9618b (patch) | |
tree | dec97d4d04e0011fe49b7712d7deba5ef8f0e99c /test/vpp_papi_provider.py | |
parent | 8343ee5665942353e57ee074da62b9d07c1c510b (diff) |
NAT44: active-passive HA (VPP-1571)
session synchronization so that we can build a plain active-passive HA NAT pair
Change-Id: I21db200491081ca46b7af3e82afc677c1985abf4
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r-- | test/vpp_papi_provider.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py index 249288b4f7f..f6069e3d049 100644 --- a/test/vpp_papi_provider.py +++ b/test/vpp_papi_provider.py @@ -2201,6 +2201,50 @@ class VppPapiProvider(object): """ return self.api(self.papi.nat66_static_mapping_dump, {}) + def nat_ha_set_listener(self, addr, port, path_mtu=512): + """Set HA listener (local settings) + + :param addr: local IP4 address + :param port: local UDP port number + :param path_mtu: path MTU (Default value = 512) + """ + return self.api(self.papi.nat_ha_set_listener, + {'ip_address': addr, + 'port': port, + 'path_mtu': path_mtu}) + + def nat_ha_get_listener(self): + """Get HA listener/local configuration""" + return self.api(self.papi.nat_ha_get_listener, {}) + + def nat_ha_set_failover(self, addr, port, refresh=10): + """Set HA failover (remote settings) + + :param addr: failover IP4 address + :param port: failvoer UDP port number + :param refresh: number of seconds after which to send session refresh + """ + return self.api(self.papi.nat_ha_set_failover, + {'ip_address': addr, + 'port': port, + 'session_refresh_interval': refresh}) + + def nat_ha_get_failover(self): + """Get HA failover/remote settings reply""" + return self.api(self.papi.nat_ha_get_failover, {}) + + def nat_ha_flush(self): + """Flush the current HA data""" + return self.api(self.papi.nat_ha_flush, {}) + + def nat_ha_resync(self, want_resync_event=1): + """Resync HA (resend existing sessions to new failover) + :param want_resync_event: if non-zero resync completed event sent + """ + return self.api(self.papi.nat_ha_resync, + {'want_resync_event': want_resync_event, + 'pid': os.getpid()}) + def control_ping(self): self.api(self.papi.control_ping) |