Skip to main content

Module routes

Module routes 

Source
Expand description

The /api/v1 endpoints: reads straight from the database, actions as command rows.

A handler’s errors are its OpenAPI responses (ErrorBody with 400 / 404 / 503 / 500); the doc comments are the endpoints’ descriptions in the OpenAPI document, so they carry no # Errors sections.

Structs§

EventsQuery
Which of a trigger’s events.
RequestKey
A command request’s Idempotency-Key header, if sent (B140): the client’s key for this request, so one sent again after its answer was lost is stored once. 1 to MAX_REQUEST_KEY visible ASCII characters (a UUID, say).

Constants§

CONNECTION_TEST_TIMEOUT
The default time a connection test may take (decision 200), unless [webserver] connection_test_timeout says.
DEFAULT_RUNS
How many runs a list returns when the client doesn’t say.
MASTERS_HEARD_WITHIN
How lately a master must have written its row to be shown by default: three of its node heartbeats of 10 s (the webserver passes its own, from node_heartbeat).
MAX_REQUEST_KEY
The longest Idempotency-Key taken.
SAMPLED_INTERVALS
How many sample intervals a running process may go unsampled.
SAMPLED_WITHIN
A process with no sample this long before the samples are asked for has ended: three of the master’s sample intervals of a minute (the webserver passes its own, from sample_interval).

Functions§

cancel_backfill
Cancel a backfill (schedr runs cancel --backfill, decision 402): its queued and running runs; the finished ones stay as they are. Applied by the master; poll the command.
cancel_run
Cancel a run (schedr runs cancel). Applied by the master; poll the command for the decision.
cancel_task
Cancel one task of a run (schedr tasks cancel): stopped if it runs, cancelled at once if it hasn’t started; the tasks downstream of it are cancelled. Applied by the master; poll the command for the decision.
check_connections
Render connections on a worker (schedr connections check, decision 174): each secret they name present or missing, never a value. The command’s result fills in as the workers answer: poll it until no job is running.
create_backfill
Create a backfill (schedr runs backfill, decisions 363, 364, 400-404): a run per fire time of the range with no successful, queued or running run (every one with all), oldest first, behind the other kinds of runs. Applied by the master; the command’s result has the counts and the backfill’s ID (its own).
dag_trigger
A DAG’s trigger: 404 for a DAG without one.
drain_worker
Drain a worker for maintenance (schedr workers drain): no new tasks, its running ones finish; kept across restarts until resumed. Applied by the master; poll the command for the decision.
get_backfill
A backfill, with its runs by state (schedr runs backfill prints its ID).
get_command
A command and the master’s decision about it.
get_dag
One DAG.
get_deployment
The deployment this webserver serves, as nodes (decisions 121-123): this webserver, the masters heard from in the last 30 s (the leader first; standbys too), and every worker, each with its effective configuration as the node masked it (secrets never in clear).
get_log
A part of an attempt’s log, read from the worker that ran it; read on from next to follow a running task. 404 when the attempt has no log (yet), or the worker no longer has it; 503 when the worker is gone or can’t be reached.
get_output
A task’s stored output in a run, with its outcome; 404 while it has none.
get_run
A run with its tasks.
get_run_dag
The DAG a run ran with: its version’s DAG JSON (tasks, dependencies, settings), for its graph.
get_run_resource
One resource of a run, by its name (decision 340).
list_all_runs
Runs of every DAG, newest triggered first (then by ID); filtered by DAG and state, paged with before and before_run (the last listed run’s triggered_at and ID).
list_attempts
The attempts of a run’s task, oldest first.
list_connections
Each DAG root’s connections in its current code (decision 211): name, type, the file defining it, why one can’t be used, and the DAGs and tasks declaring it; never a value. A task declaring a connection no file defines lists it too, refused.
list_dag_backfills
A DAG’s backfills, newest first (the 50 newest), with their runs by state (decision 403).
list_dags
Every DAG not removed.
list_import_errors
The files of each DAG root’s current code that failed to import (decision 66). A DAG defined in such a file keeps its last good version (still listed) but is held: no run is created and manual triggers are refused until the file is fixed (decision 72). A timeout or a runner that died holds nothing: the file is parsed again (72.2). Fixing the file and syncing the root makes the entry go.
list_run_commands
The commands about a run, oldest first: the trigger that made it, and cancelling it or cancelling or retrying its tasks, with the master’s decisions.
list_run_resources
A run’s resources, each with its setup, cleanup, users and state (decision 340).
list_runs
A DAG’s runs, newest first.
list_switched_off_sensors
The wait steps switched off for getting their host killed too many times in a row (decision 338).
list_triggers
Every DAG’s trigger.
list_workers
Every worker the master has seen, gone ones included.
pause_dag
Pause a DAG: the scheduler creates no runs of it (optionally cancelling those in progress). Applied by the master; poll the command for the decision.
restart_trigger
Start a DAG’s trigger again from its bookmark, whatever stopped it. Applied by the master; poll the command for the decision.
resume_worker
Let a drained worker take tasks again (schedr workers resume). Applied by the master; poll the command for the decision.
retry_task
Retry an unschedulable task of an unfinished run (schedr tasks retry). Applied by the master; poll the command for the decision.
skip_trigger_run
Pass the run an @trigger(wait_for=...) is called for and keeps failing on, so its next call gets the next run (decision 353); refused while a call of it runs. Applied by the master; poll the command for the decision.
switch_on_sensor
Switch a wait step back on, forgetting its strikes. Applied by the master; poll the command for the decision.
switch_on_trigger
Switch a DAG’s trigger back on, forgetting its strikes. Applied by the master; poll the command for the decision.
test_connection
Open a connection on a worker and run its check (schedr connections test, decisions 198-200), beside the tasks. The command’s result fills in when the worker answers.
trigger_events
What a DAG’s trigger found, newest received first.
trigger_run
Start a manual run (schedr runs trigger). Applied by the master; poll the command for the decision and the run’s ID.
unpause_dag
Unpause a DAG. Applied by the master; poll the command for the decision.