summaryrefslogtreecommitdiff
path: root/src/services/api/graphql/recipes/session.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-05-16 16:16:59 -0500
committerJohn Estabrook <jestabro@vyos.io>2022-07-24 08:44:58 -0500
commitf9bd803ffe8ae5b8b353bf53c4c7471323935e24 (patch)
treef58a004a52a5059fab4424f96c817a25f313b617 /src/services/api/graphql/recipes/session.py
parentb882e997e18c0d63aa7a4507df9b71c81c1970d1 (diff)
downloadvyos-1x-f9bd803ffe8ae5b8b353bf53c4c7471323935e24.tar.gz
vyos-1x-f9bd803ffe8ae5b8b353bf53c4c7471323935e24.zip
graphql: T4413: add support for a system status query
Diffstat (limited to 'src/services/api/graphql/recipes/session.py')
-rw-r--r--src/services/api/graphql/recipes/session.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/services/api/graphql/recipes/session.py b/src/services/api/graphql/recipes/session.py
index 1f844ff70..c436de08a 100644
--- a/src/services/api/graphql/recipes/session.py
+++ b/src/services/api/graphql/recipes/session.py
@@ -136,3 +136,17 @@ class Session:
raise error
return res
+
+ def system_status(self):
+ import api.graphql.recipes.queries.system_status as system_status
+
+ session = self._session
+ data = self._data
+
+ status = {}
+ status['host_name'] = session.show(['host', 'name']).strip()
+ status['version'] = system_status.get_system_version()
+ status['uptime'] = system_status.get_system_uptime()
+ status['ram'] = system_status.get_system_ram_usage()
+
+ return status