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§
- Events
Query - Which of a trigger’s events.
- Request
Key - A command request’s
Idempotency-Keyheader, if sent (B140): the client’s key for this request, so one sent again after its answer was lost is stored once. 1 toMAX_REQUEST_KEYvisible ASCII characters (a UUID, say).
Constants§
- CONNECTION_
TEST_ TIMEOUT - The default time a connection test may take (decision 200), unless
[webserver] connection_test_timeoutsays. - 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-Keytaken. - 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 isrunning. - 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 withall), 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:
404for 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 backfillprints 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
nextto 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
beforeandbefore_run(the last listed run’striggered_atand 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
unschedulabletask 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.