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:
@@ -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
|
||||
Reference in New Issue
Block a user