30 lines
849 B
Python
30 lines
849 B
Python
from fastapi import APIRouter
|
|
|
|
from schemas.dashboard import SystemTemplatesUpdateRequest
|
|
|
|
|
|
def build_system_runtime_router(*, system_service) -> APIRouter:
|
|
router = APIRouter()
|
|
|
|
@router.get("/api/system/defaults")
|
|
def get_system_defaults():
|
|
return system_service.get_system_defaults()
|
|
|
|
@router.get("/api/system/templates")
|
|
def get_system_templates():
|
|
return system_service.get_system_templates()
|
|
|
|
@router.put("/api/system/templates")
|
|
def update_system_templates(payload: SystemTemplatesUpdateRequest):
|
|
return system_service.update_system_templates(payload=payload)
|
|
|
|
@router.get("/api/health")
|
|
def get_health():
|
|
return system_service.get_health()
|
|
|
|
@router.get("/api/health/cache")
|
|
def get_cache_health():
|
|
return system_service.get_cache_health()
|
|
|
|
return router
|