Lanzar la reconstrucción de silver y gold por POST /runs/rebuild
This commit is contained in:
@@ -15,6 +15,16 @@ def dagster() -> DagsterGraphQLClient:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/rebuild")
|
||||||
|
def rebuild_gold(client: DagsterGraphQLClient = Depends(dagster)) -> dict[str, str]:
|
||||||
|
"""Starts rebuilding silver and gold with the deployed code (after an upgrade, before any
|
||||||
|
new data arrives); follow it at /runs. Risk tables keep the last scores."""
|
||||||
|
try:
|
||||||
|
return {"run_id": client.submit_job_execution("rebuild")}
|
||||||
|
except DagsterGraphQLClientError as e:
|
||||||
|
raise HTTPException(502, detail=str(e)) from e
|
||||||
|
|
||||||
|
|
||||||
@router.get("/{run_id}")
|
@router.get("/{run_id}")
|
||||||
def run_status(run_id: str, client: DagsterGraphQLClient = Depends(dagster)) -> dict[str, str]:
|
def run_status(run_id: str, client: DagsterGraphQLClient = Depends(dagster)) -> dict[str, str]:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user