summaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-11-19 04:25:32 -0800
committerOle Trøan <otroan@employees.org>2018-11-22 06:31:53 +0000
commitb4515b4be4ead1ea5d0af205989cf313272e8770 (patch)
tree8a87c5c74cd8583690bdcf612727a2b4f4136cf2 /test/vpp_papi_provider.py
parent19ca78fbd7567c676beefc2b511dfdcd9f20201a (diff)
Add RFC5424 syslog protocol support (VPP-1139)
Syslog protocol logging transport event messages across network over UDP protocol based on RFC5426. Change-Id: Ica74b40bcc2e6d0fbd41e9bf78e76395fbabab3c Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 8ed870ea0de..f8d0e6ca0f9 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -44,6 +44,17 @@ class QOS_SOURCE:
IP = 3
+class SYSLOG_SEVERITY:
+ EMERG = 0
+ ALERT = 1
+ CRIT = 2
+ ERR = 3
+ WARN = 4
+ NOTICE = 5
+ INFO = 6
+ DBG = 7
+
+
class UnexpectedApiReturnValueError(Exception):
""" exception raised when the API return value is unexpected """
pass
@@ -4026,3 +4037,42 @@ class VppPapiProvider(object):
def svs_dump(self):
return self.api(self.papi.svs_dump, {})
+
+ def syslog_set_sender(
+ self,
+ collector,
+ src,
+ collector_port=514,
+ vrf_id=0,
+ max_msg_size=480):
+ """Set syslog sender configuration
+
+ :param collector: colector IP address
+ :param src: source IP address
+ :param collector_port: collector UDP port (Default value = 514)
+ :param vrf_id: VRF id (Default value = 0)
+ :param max_msg_size: maximum message length (Default value = 480)
+ """
+ return self.api(self.papi.syslog_set_sender,
+ {'collector_address': {
+ 'address': collector},
+ 'src_address': {
+ 'address': src},
+ 'collector_port': collector_port,
+ 'vrf_id': vrf_id,
+ 'max_msg_size': max_msg_size})
+
+ def syslog_get_sender(self):
+ """Return syslog sender configuration"""
+ return self.api(self.papi.syslog_get_sender, {})
+
+ def syslog_set_filter(self, severity):
+ """Set syslog filter parameters
+
+ :param severity: severity filter (specified severity and greater match)
+ """
+ return self.api(self.papi.syslog_set_filter, {'severity': severity})
+
+ def syslog_get_filter(self):
+ """Return syslog filter parameters"""
+ return self.api(self.papi.syslog_get_filter, {})