Merge pull request #4472 from av1nxsh/develop

Add ping support to rest_client.py
This commit is contained in:
Matthias
2021-03-02 12:03:02 +01:00
committed by GitHub

View File

@@ -182,6 +182,16 @@ class FtRestClient():
"""
return self._get("show_config")
def ping(self):
"""simple ping"""
configstatus = self.show_config()
if not configstatus:
return {"status": "not_running"}
elif configstatus['state'] == "running":
return {"status": "pong"}
else:
return {"status": "not_running"}
def logs(self, limit=None):
"""Show latest logs.