From 0590e539b5daba77f23602c83fb6f6586af1eb45 Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Sun, 8 Nov 2020 01:16:04 +0530 Subject: [PATCH] Updated lfcli_base for webconsole --- py-json/LANforge/lfcli_base.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index e5a1c280..5bd53d78 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -8,7 +8,7 @@ from pprint import pprint import LANforge.LFUtils from LANforge.LFUtils import * import argparse - +import LANforge.LFRequest class LFCliBase: # do not use `super(LFCLiBase,self).__init__(self, host, port, _debug) @@ -256,4 +256,14 @@ class LFCliBase: return parser + # use this function to add an event You can see these events when watching websocket_client at 8081 port + def add_event(self, message=None, event_id="new", name="custom", priority=1, debug_=False): + data = { + "event_id": event_id, + "details": message, + "priority": priority, + "name": name + } + self.json_post("/cli-json/add_event", data, debug_=debug_) + # ~class