Add system health API
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""System Health Center API."""
|
||||
|
||||
try:
|
||||
from fastapi import APIRouter
|
||||
except Exception:
|
||||
APIRouter = None
|
||||
|
||||
from .system_health_center import SystemHealthCenter
|
||||
|
||||
|
||||
center = SystemHealthCenter()
|
||||
|
||||
|
||||
def get_system_health_overview():
|
||||
return center.build()
|
||||
|
||||
|
||||
def build_router():
|
||||
if APIRouter is None:
|
||||
return None
|
||||
router = APIRouter(prefix="/admin/ai-evolution/system-health", tags=["system-health"])
|
||||
|
||||
@router.get("/overview", operation_id="getSystemHealthOverview")
|
||||
def overview():
|
||||
return get_system_health_overview()
|
||||
|
||||
return router
|
||||
|
||||
|
||||
router = build_router()
|
||||
|
||||
__all__ = ["router", "get_system_health_overview"]
|
||||
Reference in New Issue
Block a user