From ae35c25f91a40cff89a516b46aff11e0184bc5e4 Mon Sep 17 00:00:00 2001 From: Georg-Stahn Date: Mon, 4 Dec 2023 22:11:00 +0100 Subject: [PATCH] delete response model for at/detach --- pkgs/clan-cli/clan_cli/webui/routers/sql_connect.py | 10 +++++----- pkgs/clan-cli/clan_cli/webui/sql_crud.py | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/webui/routers/sql_connect.py b/pkgs/clan-cli/clan_cli/webui/routers/sql_connect.py index d5b0878..5a9f338 100644 --- a/pkgs/clan-cli/clan_cli/webui/routers/sql_connect.py +++ b/pkgs/clan-cli/clan_cli/webui/routers/sql_connect.py @@ -178,7 +178,7 @@ def get_attached_entities( return entities -@router.get("/api/v1/detach", response_model=Optional[Entity], tags=[Tags.entities]) +@router.get("/api/v1/detach") async def detach( background_tasks: BackgroundTasks, entity_did: str = "did:sov:test:1234", @@ -192,7 +192,7 @@ async def detach( return {"message": "Detaching in the background"} -@router.get("/api/v1/attach", response_model=Optional[Entity], tags=[Tags.entities]) +@router.get("/api/v1/attach") async def attach( background_tasks: BackgroundTasks, entity_did: str = "did:sov:test:1234", @@ -215,9 +215,9 @@ def attach_entity(db: Session, entity_did: str) -> None: response = httpx.get(f"http://{db_entity.ip}", timeout=2) print(response) # test with: - # while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N localhost 5555 ; done - # client test (apt install python3-httpx): - # httpx http://localhost:5555 + # while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | nc -l -N localhost 5555 ; done + # client test (apt install python3-httpx): + # httpx http://localhost:5555 # except not reached set false time.sleep(1) except Exception as e: diff --git a/pkgs/clan-cli/clan_cli/webui/sql_crud.py b/pkgs/clan-cli/clan_cli/webui/sql_crud.py index 1f6cab3..d6119c9 100644 --- a/pkgs/clan-cli/clan_cli/webui/sql_crud.py +++ b/pkgs/clan-cli/clan_cli/webui/sql_crud.py @@ -1,8 +1,7 @@ -from sqlalchemy.sql.expression import true - from typing import List, Optional from sqlalchemy.orm import Session +from sqlalchemy.sql.expression import true from . import schemas, sql_models