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
commit f00c4fc27b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,6 +182,16 @@ class FtRestClient():
""" """
return self._get("show_config") 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): def logs(self, limit=None):
"""Show latest logs. """Show latest logs.