Files
labFusion/services/service-adapters/routes/general.py
glenn schrooyen 8d1755fd52
Some checks failed
API Docs (Node.js Express) / test (16) (push) Failing after 5m29s
API Docs (Node.js Express) / test (18) (push) Failing after 5m25s
API Docs (Node.js Express) / test (20) (push) Failing after 1m4s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 4m52s
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 5m1s
LabFusion CI/CD Pipeline / api-docs (push) Failing after 5m12s
LabFusion CI/CD Pipeline / frontend (push) Failing after 6m39s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 34s
Docker Build and Push / security-scan (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 1m33s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 35s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 5m20s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 5m27s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 5m50s
Docker Build and Push / deploy-staging (push) Has been skipped
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
Refactor API Docs CI workflow to correct ESLint command syntax and enhance Python formatting in CI pipelines; update progress tracking documentation
2025-09-12 17:44:23 +02:00

52 lines
1.4 KiB
Python

from datetime import datetime
from fastapi import APIRouter
from models.schemas import HealthResponse, RootResponse, 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