Update README and documentation; refactor frontend components for improved structure and resilience
This commit is contained in:
46
services/service-adapters/routes/general.py
Normal file
46
services/service-adapters/routes/general.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from fastapi import APIRouter
|
||||
from datetime import datetime
|
||||
from models.schemas import RootResponse, HealthResponse, ServiceStatus
|
||||
from services.config import SERVICES
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/",
|
||||
response_model=RootResponse,
|
||||
summary="API Root",
|
||||
description="Get basic API information",
|
||||
tags=["General"])
|
||||
async def root():
|
||||
"""Get basic API information and version"""
|
||||
return RootResponse(
|
||||
message="LabFusion Service Adapters API",
|
||||
version="1.0.0"
|
||||
)
|
||||
|
||||
@router.get("/health",
|
||||
response_model=HealthResponse,
|
||||
summary="Health Check",
|
||||
description="Check service health status",
|
||||
tags=["General"])
|
||||
async def health_check():
|
||||
"""Check the health status of the service adapters"""
|
||||
return HealthResponse(
|
||||
status="healthy",
|
||||
timestamp=datetime.now().isoformat()
|
||||
)
|
||||
|
||||
@router.get("/services",
|
||||
response_model=dict,
|
||||
summary="Get Service Status",
|
||||
description="Get status of all configured external services",
|
||||
tags=["Services"])
|
||||
async def get_services():
|
||||
"""Get status of all configured external services (Home Assistant, Frigate, Immich, n8n)"""
|
||||
service_status = {}
|
||||
for service_name, config in SERVICES.items():
|
||||
service_status[service_name] = ServiceStatus(
|
||||
enabled=config["enabled"],
|
||||
url=config["url"],
|
||||
status="unknown" # Would check actual service status
|
||||
)
|
||||
return service_status
|
||||
Reference in New Issue
Block a user