summaryrefslogtreecommitdiff
path: root/modules/daemon.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-08-25 14:13:21 +0200
committerBotond Hende <nettingman@gmail.com>2024-08-25 14:13:21 +0200
commitea2da15f2b04e3b4febf2230d4fbb0e2d6147dfc (patch)
tree51cbf662ab104e1b8c3bdde8b7c4f20542146006 /modules/daemon.py
parent0a748763535dd184926969cfdc3d439a1b8bc9e9 (diff)
fastapi testing
Diffstat (limited to 'modules/daemon.py')
-rw-r--r--modules/daemon.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/daemon.py b/modules/daemon.py
index a78e70b..085a7f6 100644
--- a/modules/daemon.py
+++ b/modules/daemon.py
@@ -1,10 +1,12 @@
import openapi_client
+from fastapi import FastAPI
from pprint import pprint
-class Daemon():
+fast_api = FastAPI()
+class Daemon:
def __init__(self, agent_symbol, token):
- config = openapi_client.Configuration(access_token = token)
+ config = openapi_client.Configuration(access_token=token)
self.api_client = openapi_client.ApiClient(config)
self.agents_api = openapi_client.AgentsApi(self.api_client)
@@ -13,6 +15,10 @@ class Daemon():
self.agent_symbol = agent_symbol
+ @fast_api.get("/")
+ def foo(self):
+ return "hello"
+
def run(self):
try:
api_response = self.agents_api.get_agent(self.agent_symbol)