Runs API: a run's state, steps, live progress, info and warnings apart, the failure's own message; cancel; history by job and domain; execution options and health; POST /tea/eegs/analyze

test_runs.py: 17 passed on SQLite and Postgres
(compose test stack). test_conectar.py fails on an identity-merge count, as it does on tea/parity
without this change.
This commit is contained in:
2026-11-28 06:54:00 -06:00
parent 1e878b8942
commit 4793cf01f0
7 changed files with 500 additions and 23 deletions
+23
View File
@@ -0,0 +1,23 @@
"""The execution choices a deployment offers and the health of a chosen cluster."""
from fastapi import APIRouter, HTTPException
from persistance import cluster
from persistance.cluster import Execution, Health, Mode, Options
router = APIRouter(prefix="/execution", tags=["execution"])
@router.get("/options")
def execution_options() -> Options:
return cluster.options()
@router.get("/health")
def execution_health(
mode: Mode | None = None, scheduler: str | None = None, reference: str | None = None
) -> Health:
try:
return cluster.health(Execution(mode=mode, scheduler=scheduler), reference)
except cluster.ExecutionError as e:
raise HTTPException(422, detail=str(e)) from e