From 329fa2a51f6628a3f8a5a53418d8b545ff1a5e7b Mon Sep 17 00:00:00 2001 From: Alex4386 Date: Tue, 9 Feb 2021 04:49:21 +0900 Subject: [PATCH] fix: guest router configuration --- API/v1/GuestMetrics/__init__.py | 6 ++++++ API/v1/GuestMetrics/info.py | 4 ++-- API/v1/__init__.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 API/v1/GuestMetrics/__init__.py diff --git a/API/v1/GuestMetrics/__init__.py b/API/v1/GuestMetrics/__init__.py new file mode 100644 index 0000000..e33cbef --- /dev/null +++ b/API/v1/GuestMetrics/__init__.py @@ -0,0 +1,6 @@ +from fastapi import APIRouter + +from API.v1.GuestMetrics.info import router as _info_router + +guest_router = APIRouter() +guest_router.include_router(_info_router, tags=["guest"]) diff --git a/API/v1/GuestMetrics/info.py b/API/v1/GuestMetrics/info.py index 9b7e995..294d191 100644 --- a/API/v1/GuestMetrics/info.py +++ b/API/v1/GuestMetrics/info.py @@ -10,10 +10,10 @@ from API.v1.GuestMetrics.serialize import serialize from app.settings import Settings -guest_router = APIRouter() +router = APIRouter() -@guest_router.get("/{cluster_id}/guest/{guest_uuid}", tags=["guest"]) +@router.get("/{cluster_id}/guest/{guest_uuid}", tags=["guest"]) async def guest_get_by_uuid( cluster_id: str = Path(default=None, title="cluster_id", description="Cluster ID"), guest_uuid: str = Path(default=None, title="guest_uuid", description="Guest UUID"), diff --git a/API/v1/__init__.py b/API/v1/__init__.py index 4f252fa..bbcead0 100644 --- a/API/v1/__init__.py +++ b/API/v1/__init__.py @@ -2,7 +2,7 @@ from XenGarden.session import create_session from API.v1.Console import console_router -from API.v1.GuestMetrics.info import guest_router +from API.v1.GuestMetrics import guest_router from API.v1.Host import host_router from API.v1.root import root_router from API.v1.SR import sr_router