Files
WebApi/webapi/execution.py
T
alberto 4793cf01f0 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.
2026-11-28 06:54:00 -06:00

24 lines
717 B
Python

"""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