summaryrefslogtreecommitdiff
path: root/src/services/api/graphql/session
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-09-24 22:48:25 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-09-29 22:21:21 -0500
commitfc9885f859617bab36c971f4eaa56240741f52c4 (patch)
tree7833c8e88191699b88920e02d67904101335cdbb /src/services/api/graphql/session
parent3ad911a20620a67b6a019e86da815e2a25047de7 (diff)
downloadvyos-1x-fc9885f859617bab36c971f4eaa56240741f52c4.tar.gz
vyos-1x-fc9885f859617bab36c971f4eaa56240741f52c4.zip
http-api: T6736: separate REST API and GraphQL API activation
The GraphQL API was implemented as an addition to the existing REST API. As there is no necessary dependency, separate the initialization of the respective endpoints. Factor out the REST Pydantic models and FastAPI routes for symmetry and clarity.
Diffstat (limited to 'src/services/api/graphql/session')
-rw-r--r--src/services/api/graphql/session/session.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/services/api/graphql/session/session.py b/src/services/api/graphql/session/session.py
index 6ae44b9bf..6e2875f3c 100644
--- a/src/services/api/graphql/session/session.py
+++ b/src/services/api/graphql/session/session.py
@@ -138,7 +138,6 @@ class Session:
return res
def show_user_info(self):
- session = self._session
data = self._data
user_info = {}
@@ -151,10 +150,9 @@ class Session:
return user_info
def system_status(self):
- import api.graphql.session.composite.system_status as system_status
+ from api.graphql.session.composite import system_status
session = self._session
- data = self._data
status = {}
status['host_name'] = session.show(['host', 'name']).strip()
@@ -165,7 +163,6 @@ class Session:
return status
def gen_op_query(self):
- session = self._session
data = self._data
name = self._name
op_mode_list = self._op_mode_list
@@ -189,7 +186,6 @@ class Session:
return res
def gen_op_mutation(self):
- session = self._session
data = self._data
name = self._name
op_mode_list = self._op_mode_list