dagu/api/v2/api.yaml
Yota Hamada d4b8484ca8
feat(all): implement builtin user management feature (#1463)
* **New Features**
* Built-in RBAC auth with JWT login, token handling, and user lifecycle
APIs (list/create/view/update/delete, reset/change password).
* **UI**
* Login flow, protected routes, Users management page,
change/reset-password modals, user menu and role-aware navigation.
* **Behavior**
* v1 routes disabled when auth enabled; runtime config exposes authMode
and usersDir; client persists auth token.
* **Documentation**
  * Added builtin auth docs and new env/config options.
* **Tests**
* Extensive tests for auth service, file-backed store, and API handlers.
2025-12-09 18:09:11 +09:00

3433 lines
104 KiB
YAML

# yaml-language-server: $schema=oapi_20241018_mod.json
openapi: "3.0.0"
info:
version: "2.0.0"
title: "Dagu"
contact:
name: "Yota Hamada"
url: "https://github.com/yottahmd"
description: API for controlling and monitoring Dagu server.
license:
name: "GPL-3.0"
url: "https://github.com/dagu-org/dagu/blob/main/LICENSE.md"
servers:
- url: "{schema}://{host}/api/v2"
description: "Dagu API server"
variables:
schema:
default: http
enum: [http, https]
host:
default: localhost
description: "Host name of the server"
tags:
- name: "dags"
description: "Operations for managing and creating DAG definitions"
- name: "dag-runs"
description: "Operations for retrieving historical data and logs of DAG-run executions"
- name: "system"
description: "System operations for monitoring and managing the Dagu server"
- name: "monitoring"
description: "Prometheus-compatible metrics for monitoring Dagu operations"
- name: "queues"
description: "Operations for managing and monitoring execution queues"
- name: "auth"
description: "Authentication operations (login, logout, token management)"
- name: "users"
description: "User management operations (CRUD, password management)"
paths:
/health:
get:
summary: "Check server health status"
description: "Returns health information about the Dagu server"
operationId: "getHealthStatus"
tags:
- "system"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
default:
description: "Unexpected error"
# ============================================================================
# Authentication Endpoints
# ============================================================================
/auth/login:
post:
summary: "Authenticate user and obtain JWT token"
description: "Authenticates a user with username and password, returns a JWT token on success"
operationId: "login"
tags:
- "auth"
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/LoginRequest"
responses:
"200":
description: "Authentication successful"
content:
application/json:
schema:
$ref: "#/components/schemas/LoginResponse"
"401":
description: "Invalid credentials"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/auth/me:
get:
summary: "Get current authenticated user"
description: "Returns information about the currently authenticated user"
operationId: "getCurrentUser"
tags:
- "auth"
responses:
"200":
description: "Current user information"
content:
application/json:
schema:
$ref: "#/components/schemas/UserResponse"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/auth/change-password:
post:
summary: "Change current user's password"
description: "Allows the authenticated user to change their own password"
operationId: "changePassword"
tags:
- "auth"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ChangePasswordRequest"
responses:
"200":
description: "Password changed successfully"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
"400":
description: "Invalid request (e.g., weak password)"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: "Not authenticated or wrong current password"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
# ============================================================================
# User Management Endpoints (Admin only)
# ============================================================================
/users:
get:
summary: "List all users"
description: "Returns a list of all users. Requires admin role."
operationId: "listUsers"
tags:
- "users"
responses:
"200":
description: "List of users"
content:
application/json:
schema:
$ref: "#/components/schemas/UsersListResponse"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: "Forbidden - requires admin role"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
summary: "Create a new user"
description: "Creates a new user account. Requires admin role."
operationId: "createUser"
tags:
- "users"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateUserRequest"
responses:
"201":
description: "User created successfully"
content:
application/json:
schema:
$ref: "#/components/schemas/UserResponse"
"400":
description: "Invalid request (e.g., weak password, invalid role)"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: "Forbidden - requires admin role"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: "Conflict - username already exists"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/users/{userId}:
get:
summary: "Get user by ID"
description: "Returns a specific user by their ID. Requires admin role."
operationId: "getUser"
tags:
- "users"
parameters:
- $ref: "#/components/parameters/UserId"
responses:
"200":
description: "User details"
content:
application/json:
schema:
$ref: "#/components/schemas/UserResponse"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: "Forbidden - requires admin role"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "User not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
patch:
summary: "Update user"
description: "Updates a user's information. Requires admin role."
operationId: "updateUser"
tags:
- "users"
parameters:
- $ref: "#/components/parameters/UserId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateUserRequest"
responses:
"200":
description: "User updated successfully"
content:
application/json:
schema:
$ref: "#/components/schemas/UserResponse"
"400":
description: "Invalid request"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: "Forbidden - requires admin role"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "User not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: "Conflict - username already exists"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
summary: "Delete user"
description: "Deletes a user account. Requires admin role. Cannot delete yourself."
operationId: "deleteUser"
tags:
- "users"
parameters:
- $ref: "#/components/parameters/UserId"
responses:
"204":
description: "User deleted successfully"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: "Forbidden - requires admin role or cannot delete self"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "User not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/users/{userId}/reset-password:
post:
summary: "Reset user's password"
description: "Resets a user's password to a new value. Requires admin role."
operationId: "resetUserPassword"
tags:
- "users"
parameters:
- $ref: "#/components/parameters/UserId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ResetPasswordRequest"
responses:
"200":
description: "Password reset successfully"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
"400":
description: "Invalid request (e.g., weak password)"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: "Not authenticated"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: "Forbidden - requires admin role"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "User not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Unexpected error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/workers:
get:
summary: "List distributed workers"
description: "Retrieves information about distributed workers connected to the coordinator"
operationId: "getWorkers"
tags:
- "system"
parameters:
- $ref: "#/components/parameters/RemoteNode"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/WorkersListResponse"
"503":
description: "Coordinator service unavailable"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags:
get:
summary: "List all available DAGs"
description: "Retrieves DAG definitions with optional filtering by name and tags"
operationId: "listDAGs"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/PerPage"
- $ref: "#/components/parameters/RemoteNode"
- name: "name"
in: "query"
required: false
schema:
type: "string"
description: "Filter DAGs by name"
- name: "tag"
in: "query"
required: false
schema:
type: "string"
description: "Filter DAGs by tag"
- name: "sort"
in: "query"
required: false
schema:
type: "string"
enum: ["name", "nextRun"]
default: "name"
description: |
Field to sort by:
- `name`: Sort alphabetically by DAG name (case-insensitive)
- `nextRun`: Sort by next scheduled run time. DAGs with earlier next run times appear first in ascending order. DAGs without schedules appear last.
- name: "order"
in: "query"
required: false
schema:
type: "string"
enum: ["asc", "desc"]
default: "asc"
description: "Sort order (ascending or descending)"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dags:
type: array
description: "List of DAG definitions with their status and metadata"
items:
$ref: "#/components/schemas/DAGFile"
errors:
type: array
description: "List of errors encountered during the request"
items:
type: string
pagination:
$ref: "#/components/schemas/Pagination"
required:
- dags
- errors
- pagination
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
summary: "Create a new DAG definition"
description: "Creates a new empty DAG file with the specified name"
operationId: "createNewDAG"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
$ref: "#/components/schemas/DAGName"
spec:
type: string
description: "Optional DAG spec in YAML format to initialize the DAG. If provided, the spec will be validated before creation."
required:
- name
responses:
"201":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: "Name of the newly created DAG"
required:
- name
"400":
description: "Invalid DAG spec"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/validate:
post:
summary: "Validate a DAG specification"
description: |
Validates a DAG YAML specification without persisting any changes.
Returns a list of validation errors. When the spec can be partially parsed,
the response may also include parsed DAG details built with error-tolerant loading.
operationId: "validateDAGSpec"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
spec:
type: string
description: "DAG specification in YAML format"
name:
type: string
description: "Optional name to use when the spec omits a name"
required:
- spec
responses:
"200":
description: "Validation result"
content:
application/json:
schema:
type: object
properties:
valid:
type: boolean
description: "True if the spec is valid (no errors)"
dag:
$ref: "#/components/schemas/DAGDetails"
errors:
type: array
description: "List of validation errors"
items:
type: string
required:
- valid
- errors
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}:
get:
summary: "Retrieve comprehensive DAG information"
description: "Fetches detailed information about a specific DAG definition"
operationId: "getDAGDetails"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
description: "Response object for getting details of a DAG"
properties:
dag:
$ref: "#/components/schemas/DAGDetails"
localDags:
type: array
description: "List of local DAGs that are part of this DAG"
items:
$ref: "#/components/schemas/LocalDag"
latestDAGRun:
$ref: "#/components/schemas/DAGRunDetails"
suspended:
type: boolean
description: "Whether the DAG is suspended"
errors:
type: array
description: "List of errors encountered during the request"
items:
type: string
required:
- latestDAGRun
- suspended
- localDags
- errors
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
summary: "Delete an existing DAG"
description: "Permanently removes a DAG definition from the system"
operationId: "deleteDAG"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
responses:
"204":
description: "DAG successfully deleted"
"404":
description: "DAG not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/start:
post:
summary: "Create and execute a DAG-run from DAG"
description: "Creates a DAG-run from the DAG definition and starts its execution with optional parameters"
operationId: "executeDAG"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
params:
type: string
description: "Parameters to pass to the DAG-run in JSON format"
dagRunId:
type: string
description: "Optional ID for the DAG-run, if not provided a new one will be generated"
dagName:
type: string
description: "Optional DAG name override to use for the created dag-run"
singleton:
type: boolean
description: "If true, prevent starting if DAG is already running (returns 409 conflict)"
default: false
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "ID of the created DAG-run"
required:
- dagRunId
"409":
description: "DAG is already running (singleton mode)"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/enqueue:
post:
summary: "Enqueue a DAG-run from DAG"
description: "Creates a DAG-run from the DAG definition and adds it to the queue for execution"
operationId: "enqueueDAGDAGRun"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
params:
type: string
description: "Parameters to pass to the DAG-run in JSON format"
dagRunId:
type: string
description: "Optional ID for the DAG-run, if not provided a new one will be generated"
dagName:
type: string
description: "Optional DAG name override to use for the queued dag-run"
queue:
type: string
description: "Override the DAG-level queue definition"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "ID of the created DAG-run"
required:
- dagRunId
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/dag-runs:
get:
summary: "Retrieve execution history of a DAG"
description: "Fetches history of DAG-runs created from this DAG definition"
operationId: "getDAGDAGRunHistory"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRuns:
type: array
description: "List of historical DAG-runs created from this DAG"
items:
$ref: "#/components/schemas/DAGRunDetails"
gridData:
type: array
description: "Grid data for visualization"
items:
$ref: "#/components/schemas/DAGGridItem"
required:
- dagRuns
- gridData
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/dag-runs/{dagRunId}:
get:
summary: "Get detailed status of a specific DAG-run"
description: "Retrieves status information about a particular DAG-run created from this DAG"
tags:
- "dags"
operationId: "getDAGDAGRunDetails"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
- $ref: "#/components/parameters/DAGRunId"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRun:
$ref: "#/components/schemas/DAGRunDetails"
required:
- dagRun
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/spec:
get:
summary: "Retrieve DAG specification"
description: "Fetches the YAML specification of a DAG definition"
operationId: "getDAGSpec"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dag:
$ref: "#/components/schemas/DAGDetails"
spec:
type: string
description: "The DAG spec in YAML format"
errors:
type: array
description: "List of errors in the spec"
items:
type: string
required:
- spec
- errors
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
put:
summary: "Update DAG spec"
description: "Modifies the YAML specification of a DAG definition"
operationId: "updateDAGSpec"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
spec:
type: string
description: "The new DAG spec in YAML format"
required:
- spec
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
errors:
type: array
description: "List of errors in the spec"
items:
type: string
required:
- errors
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/suspend:
post:
summary: "Toggle DAG suspension state"
description: "Controls whether the scheduler should create DAG-runs from this DAG according to its defined cron schedule"
operationId: "updateDAGSuspensionState"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
suspend:
type: boolean
description: "Suspend status to set for the DAG"
required:
- suspend
responses:
"200":
description: "A successful response"
"404":
description: "DAG not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/rename:
post:
summary: "Change DAG file ID"
description: "Changes the file ID of the DAG definition"
operationId: "renameDAG"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
newFileName:
type: string
description: "New file name for the DAG"
required:
- newFileName
responses:
"200":
description: "A successful response"
"400":
description: "Invalid request"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "DAG not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/{fileName}/stop-all:
post:
summary: "Stop all running instances of a DAG"
description: "Terminates all currently running DAG-runs for the specified DAG"
operationId: "stopAllDAGRuns"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGFileName"
responses:
"200":
description: "Successfully stopped all running instances"
content:
application/json:
schema:
type: object
properties:
errors:
description: "Errors encountered"
items:
type: string
type: array
required:
- errors
"404":
description: "DAG not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/search:
get:
summary: "Search DAGs"
description: "Performs a full-text search across all DAG definitions"
operationId: "searchDAGs"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- name: "q"
in: "query"
required: true
schema:
type: "string"
description: "A search query string"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
description: "Response object for searching DAGs"
properties:
results:
type: array
description: "Search results matching the query"
items:
$ref: "#/components/schemas/SearchResultItem"
errors:
type: array
description: "Errors encountered during the search"
items:
type: string
required:
- results
- errors
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dags/tags:
get:
summary: "List all available DAG tags"
description: "Retrieves all unique tags used across DAG definitions"
operationId: "getAllDAGTags"
tags:
- "dags"
parameters:
- $ref: "#/components/parameters/RemoteNode"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/ListTagResponse"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs:
get:
summary: "List all DAG-runs"
description: "Retrieves a list of all DAG-runs with optional filtering by name and status"
operationId: "listDAGRuns"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/Status"
- $ref: "#/components/parameters/DateTimeFrom"
- $ref: "#/components/parameters/DateTimeTo"
- $ref: "#/components/parameters/DAGRunIdSearch"
- $ref: "#/components/parameters/RemoteNode"
- name: "name"
in: "query"
required: false
schema:
type: "string"
description: "Filter DAG-runs by name"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRuns:
type: array
description: "List of DAG-runs with their status and metadata"
items:
$ref: "#/components/schemas/DAGRunSummary"
required:
- dagRuns
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
summary: "Create and execute a DAG-run from inline spec"
description: |
Creates a DAG-run directly from a provided DAG specification (YAML) and starts execution.
This endpoint does not require a pre-existing DAG file; the supplied `spec` is parsed and validated
similarly to `/dags/validate`, and the run is executed immediately if valid.
operationId: "executeDAGRunFromSpec"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
spec:
type: string
description: "DAG specification in YAML format"
name:
type: string
description: "Optional name to use when the spec omits a name"
params:
type: string
description: "Parameters to pass to the DAG-run in JSON format"
dagRunId:
type: string
description: "Optional ID for the DAG-run; if omitted, a new one is generated"
singleton:
type: boolean
description: "If true, prevent starting if a DAG with the same name is already running (returns 409)"
default: false
required:
- spec
responses:
"200":
description: "Run created and started"
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "ID of the created DAG-run"
required:
- dagRunId
"400":
description: "Invalid DAG spec or parameters"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: "A DAG with the same name is already running and singleton is enabled"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/enqueue:
post:
summary: "Enqueue a DAG-run from inline spec"
description: |
Creates a DAG-run directly from a provided DAG specification (YAML) and enqueues it for execution.
This endpoint does not require a pre-existing DAG file; the supplied `spec` is parsed and validated
similarly to `/dags/validate`, and the run is persisted to the queue if valid.
operationId: "enqueueDAGRunFromSpec"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
spec:
type: string
description: "DAG specification in YAML format"
name:
type: string
description: "Optional name to use when the spec omits a name"
params:
type: string
description: "Parameters to persist with the queued DAG-run in JSON format"
dagRunId:
type: string
description: "Optional ID for the DAG-run; if omitted a new one will be generated"
queue:
type: string
description: "Override the queue to use for this DAG-run"
required:
- spec
responses:
"200":
description: "DAG-run successfully enqueued"
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "ID of the queued DAG-run"
required:
- dagRunId
"400":
description: "Invalid DAG spec or parameters"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: "A DAG with the same name is already queued beyond maxActiveRuns"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}:
get:
summary: "List all DAG-runs with a specific name"
description: "Retrieves a list of all DAG-runs with optional filtering by name and status"
operationId: "listDAGRunsByName"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/Status"
- $ref: "#/components/parameters/DateTimeFrom"
- $ref: "#/components/parameters/DateTimeTo"
- $ref: "#/components/parameters/DAGRunName"
- $ref: "#/components/parameters/DAGRunIdSearch"
- $ref: "#/components/parameters/RemoteNode"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRuns:
type: array
description: "List of DAG-runs with their status and metadata"
items:
$ref: "#/components/schemas/DAGRunSummary"
required:
- dagRuns
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}:
get:
summary: "Retrieve detailed status of a DAG-run"
description: "Fetches detailed status information about a specific DAG-run. Use 'latest' as the dagRunId to retrieve the most recent DAG-run for the specified DAG name."
operationId: "getDAGRunDetails"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRunDetails:
$ref: "#/components/schemas/DAGRunDetails"
required:
- dagRunDetails
"404":
description: "DAGRun not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/reschedule:
post:
summary: "Reschedule DAG-run with a new run ID"
description: "Launch a fresh DAG-run from a historic execution while reusing its stored parameters."
operationId: "rescheduleDAGRun"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "Explicit run ID for the new DAG-run; if omitted a new ID is generated."
dagName:
type: string
description: "Optional DAG name override for the new run."
responses:
"200":
description: "Successfully scheduled a new DAG-run"
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "ID of the newly created DAG-run."
queued:
type: boolean
description: "Indicates whether the run was queued instead of starting immediately."
required:
- dagRunId
- queued
"400":
description: "Invalid request parameters"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "Historic run not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: "Conflict (run ID already exists or concurrency guard blocks execution)"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/sub-dag-runs:
get:
summary: "Get sub DAG runs with timing info"
description: "Retrieves timing and status information for all sub DAG runs (including repeated executions) of a specific step"
operationId: "getSubDAGRuns"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
subRuns:
type: array
items:
$ref: "#/components/schemas/SubDAGRunDetail"
required:
- subRuns
"404":
description: "DAG run not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/dequeue:
get:
summary: "Dequeue a queued DAG-run"
description: "Dequeue a DAG-run execution that is currently queued"
operationId: "dequeueDAGRun"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
responses:
"200":
description: "A successful response"
"404":
description: "DAGRun not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/log:
get:
summary: "Retrieve full execution log of a DAG-run"
description: "Fetches the execution log for a DAG-run"
operationId: "getDAGRunLog"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- $ref: "#/components/parameters/Tail"
- $ref: "#/components/parameters/Head"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/Log"
"404":
description: "Log file not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/retry:
post:
summary: "Retry DAG-run execution"
description: "Creates a new DAG-run based on a previous execution"
operationId: "retryDAGRun"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
dagRunId:
type: string
description: "ID of the DAG-run to retry"
stepName:
type: string
description: "Optional. If provided, only this step will be retried."
required:
- dagRunId
responses:
"200":
description: "A successful response"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/stop:
post:
summary: "Terminate a running DAG-run"
description: "Forcefully stops a running DAG-run created from this DAG"
operationId: "terminateDAGRun"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
responses:
"200":
description: "A successful response"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/steps/{stepName}/log:
get:
summary: "Retrieve log for a specific step in a DAG-run"
description: "Fetches the log for an individual step in a DAG-run"
operationId: "getDAGRunStepLog"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- $ref: "#/components/parameters/StepName"
- $ref: "#/components/parameters/Tail"
- $ref: "#/components/parameters/Head"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Stream"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/Log"
"404":
description: "Log file not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/steps/{stepName}/status:
patch:
summary: "Manually update a step's execution status"
description: "Changes the status of a specific step within a DAG-run"
operationId: "updateDAGRunStepStatus"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- $ref: "#/components/parameters/StepName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
status:
$ref: "#/components/schemas/NodeStatus"
required:
- status
responses:
"200":
description: "A successful response"
"400":
description: "Invalid request"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "DAGRun or step not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/sub-dag-runs/{subDAGRunId}:
get:
summary: "Retrieve detailed status of a sub DAG-run"
description: "Fetches detailed status information about a specific sub DAG-run"
operationId: "getSubDAGRunDetails"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- name: "subDAGRunId"
in: "path"
required: true
schema:
type: "string"
description: "ID of the sub DAG-run to retrieve details for"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
type: object
properties:
dagRunDetails:
$ref: "#/components/schemas/DAGRunDetails"
required:
- dagRunDetails
"404":
description: "Sub DAG-run not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/sub-dag-runs/{subDAGRunId}/log:
get:
summary: "Retrieve log for a specific sub DAG-run"
description: "Fetches the log for an individual sub DAG-run"
operationId: "getSubDAGRunLog"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- $ref: "#/components/parameters/Tail"
- $ref: "#/components/parameters/Head"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
- name: "subDAGRunId"
in: "path"
required: true
schema:
type: "string"
description: "ID of the sub DAG-run to retrieve the log for"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/Log"
"404":
description: "Log file not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/sub-dag-runs/{subDAGRunId}/steps/{stepName}/log:
get:
summary: "Retrieve log for a specific step in a sub DAG-run"
description: "Fetches the log for an individual step in a sub DAG-run"
operationId: "getSubDAGRunStepLog"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- $ref: "#/components/parameters/Tail"
- $ref: "#/components/parameters/Head"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Stream"
- name: "subDAGRunId"
in: "path"
required: true
schema:
type: "string"
description: "ID of the sub DAG-run to retrieve the log for"
- $ref: "#/components/parameters/StepName"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/Log"
"404":
description: "Log file not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/dag-runs/{name}/{dagRunId}/sub-dag-runs/{subDAGRunId}/steps/{stepName}/status:
patch:
summary: "Manually update a step's execution status in a sub DAG-run"
description: "Changes the status of a specific step within a sub DAG-run"
operationId: "updateSubDAGRunStepStatus"
tags:
- "dag-runs"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- $ref: "#/components/parameters/DAGName"
- $ref: "#/components/parameters/DAGRunId"
- name: "subDAGRunId"
in: "path"
required: true
schema:
type: "string"
description: "ID of the sub DAG-run to update the step status for"
- $ref: "#/components/parameters/StepName"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
status:
$ref: "#/components/schemas/NodeStatus"
required:
- status
responses:
"200":
description: "A successful response"
"400":
description: "Invalid request"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: "DAGRun or step not found"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/queues:
get:
summary: "List all execution queues with active DAG-runs"
description: "Retrieves all queues showing both running and queued DAG-runs, organized by queue/process group"
operationId: "listQueues"
tags:
- "queues"
parameters:
- $ref: "#/components/parameters/RemoteNode"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/QueuesResponse"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/services/resources/history:
get:
summary: "Get resource usage history"
description: "Returns historical data for system resources"
operationId: "getResourceHistory"
tags:
- "system"
parameters:
- $ref: "#/components/parameters/RemoteNode"
- name: duration
in: query
description: "Duration of history to retrieve (e.g., 30m, 1h)"
required: false
schema:
type: string
default: "1h"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/ResourceHistory"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/services/scheduler:
get:
summary: "Get scheduler service status"
description: "Returns status information about all registered scheduler instances"
operationId: "getSchedulerStatus"
tags:
- "system"
parameters:
- $ref: "#/components/parameters/RemoteNode"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/SchedulerStatusResponse"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/services/coordinator:
get:
summary: "Get coordinator service status"
description: "Returns status information about all registered coordinator instances"
operationId: "getCoordinatorStatus"
tags:
- "system"
parameters:
- $ref: "#/components/parameters/RemoteNode"
responses:
"200":
description: "A successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/CoordinatorStatusResponse"
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/metrics:
get:
summary: "Get Prometheus metrics"
description: "Returns Prometheus-compatible metrics for monitoring Dagu operations"
operationId: "getMetrics"
tags:
- "monitoring"
responses:
"200":
description: "Prometheus metrics in text format"
content:
text/plain:
schema:
type: string
example: |
# HELP dagu_info Dagu build information
# TYPE dagu_info gauge
dagu_info{version="1.14.0",build_date="2024-01-01T12:00:00Z",go_version="1.21"} 1
# HELP dagu_uptime_seconds Time since server start
# TYPE dagu_uptime_seconds gauge
dagu_uptime_seconds 3600
# HELP dagu_dag_runs_currently_running Number of currently running DAG runs
# TYPE dagu_dag_runs_currently_running gauge
dagu_dag_runs_currently_running 5
# HELP dagu_dag_runs_queued_total Total number of DAG runs in queue
# TYPE dagu_dag_runs_queued_total gauge
dagu_dag_runs_queued_total 8
# HELP dagu_dag_runs_total Total number of DAG runs by status
# TYPE dagu_dag_runs_total counter
dagu_dag_runs_total{status="success"} 2493
dagu_dag_runs_total{status="error"} 15
dagu_dag_runs_total{status="aborted"} 7
# HELP dagu_dags_total Total number of DAGs
# TYPE dagu_dags_total gauge
dagu_dags_total 45
# HELP dagu_scheduler_running Whether the scheduler is running
# TYPE dagu_scheduler_running gauge
dagu_scheduler_running 1
default:
description: "Generic error response"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
apiToken:
type: http
scheme: bearer
bearerFormat: opaque
parameters:
Page:
name: page
in: query
description: page number of items to fetch (default is 1)
required: false
schema:
type: integer
minimum: 1
default: 1
UserId:
name: userId
in: path
description: unique identifier of the user
required: true
schema:
type: string
minLength: 1
PerPage:
name: perPage
in: query
description: number of items per page (default is 30, max is 100)
required: false
schema:
type: integer
minimum: 1
maximum: 1000
default: 50
DAGFileName:
name: fileName
in: path
description: the name of the DAG file
required: true
schema:
$ref: "#/components/schemas/DAGFileName"
DAGName:
name: name
in: path
description: name of the DAG
required: true
schema:
$ref: "#/components/schemas/DAGName"
StepName:
name: stepName
in: path
description: name of the step
required: true
schema:
type: string
RemoteNode:
name: remoteNode
in: query
description: name of the remote node
required: false
schema:
type: string
default: "local"
DAGRunId:
name: dagRunId
in: path
description: ID of the DAG-run or 'latest' to get the most recent DAG-run
required: true
schema:
$ref: "#/components/schemas/DAGRunId"
DAGRunIdSearch:
name: dagRunId
in: query
description: ID of the DAG-run or 'latest' to get the most recent DAG-run
required: false
schema:
$ref: "#/components/schemas/DAGRunId"
DAGRunName:
name: name
in: path
description: name of the DAG-run
required: true
schema:
type: string
Status:
name: status
in: query
description: status of the DAG-run
required: false
schema:
$ref: "#/components/schemas/Status"
DateTimeFrom:
name: fromDate
in: query
description: start datetime for filtering DAG-runs in ISO 8601 format with timezone
required: false
schema:
$ref: "#/components/schemas/UnixTimestamp"
DateTimeTo:
name: toDate
in: query
description: end datetime for filtering DAG-runs in ISO 8601 format with timezone
required: false
schema:
$ref: "#/components/schemas/UnixTimestamp"
Tail:
name: tail
in: query
description: Number of lines to return from the end of the file
required: false
schema:
type: integer
minimum: 1
Head:
name: head
in: query
description: Number of lines to return from the beginning of the file
required: false
schema:
type: integer
minimum: 1
Offset:
name: offset
in: query
description: Line number to start reading from (1-based)
required: false
schema:
type: integer
minimum: 1
Limit:
name: limit
in: query
description: Maximum number of lines to return
required: false
schema:
type: integer
minimum: 1
maximum: 10000
Stream:
name: stream
in: query
description: "Whether to return stdout or stderr logs"
required: false
schema:
$ref: "#/components/schemas/Stream"
schemas:
Error:
type: object
description: "Generic error response object"
properties:
code:
$ref: "#/components/schemas/ErrorCode"
message:
type: string
description: "Short error message"
details:
type: object
description: "Additional error details"
required:
- code
- message
ErrorCode:
type: string
description: "Error code indicating the type of error"
enum:
- "forbidden"
- "bad_request"
- "not_found"
- "internal_error"
- "unauthorized"
- "bad_gateway"
- "remote_node_error"
- "max_run_reached"
- "not_running"
- "already_exists"
Stream:
type: string
format: string
enum:
- stdout
- stderr
UnixTimestamp:
type: integer
format: "int64"
description: "Unix timestamp in seconds"
example: 1672531199
DAGFileName:
type: string
# only allows alphanumeric characters, underscores, and hyphens
format: "regex"
pattern: "^[a-zA-Z0-9_-]+$"
description: "Name of the DAG file"
DAGName:
type: string
# only allows alphanumeric characters, underscores, and hyphens
format: "regex"
pattern: "^[a-zA-Z0-9_-]+$"
description: "Name of the DAG"
Pagination:
type: object
properties:
totalRecords:
type: integer
description: total number of records
currentPage:
type: integer
description: current page number
totalPages:
type: integer
description: total number of pages
nextPage:
type: integer
description: next page number
prevPage:
type: integer
description: previous page number
required:
- totalRecords
- currentPage
- totalPages
- nextPage
- prevPage
DAGRunId:
type: string
description: "Unique identifier for the DAG-run. The special value 'latest' can be used to reference the most recent DAG-run."
example: "latest"
pattern: "^[a-zA-Z0-9_-]+$"
HealthResponse:
type: object
description: "Response object for the health check endpoint"
properties:
status:
type: string
enum: ["healthy", "unhealthy"]
description: "Overall health status of the server"
version:
type: string
description: "Current version of the server"
uptime:
type: integer
description: "Server uptime in seconds"
timestamp:
type: string
description: "Current server time"
required:
- status
- version
- uptime
- timestamp
DAGFile:
type: object
description: "DAG file with its status information"
properties:
fileName:
type: string
description: "File ID of the DAG file"
dag:
$ref: "#/components/schemas/DAG"
latestDAGRun:
$ref: "#/components/schemas/DAGRunSummary"
suspended:
type: boolean
description: "Whether the DAG is suspended"
errors:
type: array
description: "List of errors encountered during the request"
items:
type: string
required:
- fileName
- dag
- latestDAGRun
- suspended
- errors
DAG:
type: object
description: "Core DAG configuration containing definition and metadata"
properties:
group:
type: string
description: "Logical grouping of related DAGs for organizational purposes"
name:
type: string
description: "Logical name of the DAG"
schedule:
type: array
description: "List of scheduling expressions defining when DAG-runs should be created from this DAG"
items:
$ref: "#/components/schemas/Schedule"
description:
type: string
description: "Human-readable description of the DAG's purpose and behavior"
params:
type: array
description: "List of parameter names that can be passed to DAG-runs created from this DAG"
items:
type: string
defaultParams:
type: string
description: "Default parameter values in JSON format if not specified at DAG-run creation"
tags:
type: array
description: "List of tags for categorizing and filtering DAGs"
items:
type: string
queue:
type: string
description: "Name of the queue this DAG is assigned to. If not specified, the DAG name itself becomes the queue name"
maxActiveRuns:
type: integer
description: "Maximum number of concurrent DAG-runs allowed from this DAG"
runConfig:
$ref: "#/components/schemas/RunConfig"
required:
- name
Schedule:
type: object
description: "Schedule configuration for DAG-run creation"
properties:
expression:
type: string
description: "Cron expression or schedule pattern"
required:
- expression
Status:
type: integer
enum: [0, 1, 2, 3, 4, 5, 6]
x-enum-varnames:
- "NotStarted"
- "Running"
- "Failed"
- "Aborted"
- "Success"
- "Queued"
- "PartialSuccess"
description: |
Numeric status code indicating current DAG-run state:
0: "Not started"
1: "Running"
2: "Failed"
3: "Aborted"
4: "Success"
5: "Queued"
6: "Partial Success"
StatusLabel:
type: string
description: "Human-readable status description for the DAG-run"
enum:
- "not_started"
- "running"
- "failed"
- "aborted"
- "succeeded"
- "queued"
- "partially_succeeded"
NodeStatus:
type: integer
enum: [0, 1, 2, 3, 4, 5, 6]
x-enum-varnames:
- "NotStarted"
- "Running"
- "Failed"
- "Aborted"
- "Success"
- "Skipped"
- "PartialSuccess"
description: |
Numeric status code indicating current node state:
0: "Not started"
1: "Running"
2: "Failed"
3: "Aborted"
4: "Success"
5: "Skipped"
6: "Partial Success"
NodeStatusLabel:
type: string
description: "Human-readable status description for the node"
enum:
- "not_started"
- "running"
- "failed"
- "aborted"
- "succeeded"
- "skipped"
- "partially_succeeded"
SchedulerStatusResponse:
type: object
description: "Response containing status of all scheduler instances"
properties:
schedulers:
type: array
description: "List of all registered scheduler instances"
items:
$ref: "#/components/schemas/SchedulerInstance"
required:
- schedulers
SchedulerInstance:
type: object
description: "Scheduler instance status information"
properties:
instanceId:
type: string
description: "Unique identifier of the scheduler instance"
host:
type: string
description: "Hostname where scheduler is running"
status:
type: string
enum: ["active", "inactive", "unknown"]
description: "Scheduler status (active = holds lock and scheduling)"
startedAt:
type: string
description: "RFC3339 timestamp when scheduler started"
required:
- instanceId
- host
- status
- startedAt
CoordinatorStatusResponse:
type: object
description: "Response containing status of all coordinator instances"
properties:
coordinators:
type: array
description: "List of all registered coordinator instances"
items:
$ref: "#/components/schemas/CoordinatorInstance"
required:
- coordinators
CoordinatorInstance:
type: object
description: "Coordinator instance status information"
properties:
instanceId:
type: string
description: "Unique identifier of the coordinator instance"
host:
type: string
description: "Hostname where coordinator is running"
status:
type: string
enum: ["active", "inactive", "unknown"]
description: "Coordinator status"
startedAt:
type: string
description: "RFC3339 timestamp when coordinator started"
port:
type: integer
description: "Port number the coordinator is listening on"
required:
- instanceId
- host
- status
- startedAt
- port
WorkerHealthStatus:
type: string
description: "Health status of the worker based on heartbeat recency"
enum:
- "healthy"
- "warning"
- "unhealthy"
DAGDetails:
type: object
description: "Detailed DAG configuration information"
properties:
group:
type: string
description: "Logical grouping of related DAGs for organizational purposes"
name:
type: string
description: "Unique identifier for the DAG within its group"
schedule:
type: array
description: "List of scheduling expressions defining when DAG-runs should be created from this DAG"
items:
$ref: "#/components/schemas/Schedule"
description:
type: string
description: "Human-readable description of the DAG's purpose and behavior"
env:
type: array
description: "List of environment variables to set before executing a DAG-run"
items:
type: string
logDir:
type: string
description: "Directory path for storing log files"
handlerOn:
$ref: "#/components/schemas/HandlerOn"
steps:
type: array
description: "List of steps to execute in DAG-runs created from this DAG"
items:
$ref: "#/components/schemas/Step"
delay:
type: integer
description: "Time in seconds to wait before starting a DAG-run"
histRetentionDays:
type: integer
description: "Number of days to retain historical logs"
preconditions:
type: array
description: "Conditions that must be met before a DAG-run can start"
items:
$ref: "#/components/schemas/Condition"
maxActiveRuns:
type: integer
description: "Maximum number of concurrent DAG-runs allowed from this DAG"
queue:
type: string
description: "Name of the queue this DAG is assigned to. If not specified, the DAG name itself becomes the queue name"
maxActiveSteps:
type: integer
description: "Maximum number of concurrent steps allowed in a DAG run"
params:
type: array
description: "List of parameter names that can be passed to DAG-runs created from this DAG"
items:
type: string
defaultParams:
type: string
description: "Default parameter values in JSON format if not specified at DAG-run creation"
tags:
type: array
description: "List of tags for categorizing and filtering DAGs"
items:
type: string
runConfig:
$ref: "#/components/schemas/RunConfig"
required:
- name
RunConfig:
type: object
description: "Configuration for controlling user interactions when starting DAG runs"
properties:
disableParamEdit:
type: boolean
description: "Disable parameter editing when starting the DAG"
default: false
disableRunIdEdit:
type: boolean
description: "Disable custom run ID specification"
default: false
required:
- disableParamEdit
- disableRunIdEdit
LocalDag:
type: object
properties:
name:
type: string
description: "Name of the local DAG"
dag:
$ref: "#/components/schemas/DAGDetails"
errors:
type: array
description: "List of errors encountered while processing the local DAG"
items:
type: string
required:
- name
- errors
HandlerOn:
type: object
description: "Configuration for event handlers in a DAG-run"
properties:
failure:
$ref: "#/components/schemas/Step"
success:
$ref: "#/components/schemas/Step"
cancel:
$ref: "#/components/schemas/Step"
exit:
$ref: "#/components/schemas/Step"
DAGRunSummary:
type: object
description: "Current status of a DAG-run"
properties:
rootDAGRunName:
type: string
description: "Name of the root DAG-run"
rootDAGRunId:
type: string
description: "ID of the root DAG-run"
parentDAGRunName:
type: string
description: "Name of the parent DAG-run"
parentDAGRunId:
type: string
description: "ID of the parent DAG-run"
dagRunId:
$ref: "#/components/schemas/DAGRunId"
name:
$ref: "#/components/schemas/DAGName"
status:
$ref: "#/components/schemas/Status"
statusLabel:
$ref: "#/components/schemas/StatusLabel"
queuedAt:
type: string
description: "RFC 3339 timestamp when the DAG-run was queued"
startedAt:
type: string
description: "RFC 3339 timestamp when the DAG-run started"
finishedAt:
type: string
description: "RFC 3339 timestamp when the DAG-run finished"
log:
type: string
description: "Path to the log file"
params:
type: string
description: "Runtime parameters passed to the DAG-run in JSON format"
required:
- rootDAGRunName
- rootDAGRunId
- dagRunId
- name
- status
- statusLabel
- startedAt
- finishedAt
- log
DAGRunDetails:
type: object
description: "Detailed status of a DAG-run including sub DAG-run nodes"
allOf:
- $ref: "#/components/schemas/DAGRunSummary"
- type: object
description: "Detailed status information for the steps within a DAG-run."
properties:
nodes:
type: array
description: "Status of individual steps within the DAG-run"
items:
$ref: "#/components/schemas/Node"
onExit:
$ref: "#/components/schemas/Node"
onSuccess:
$ref: "#/components/schemas/Node"
onFailure:
$ref: "#/components/schemas/Node"
onCancel:
$ref: "#/components/schemas/Node"
preconditions:
type: array
description: "List of preconditions that must be met before the DAG-run can start"
items:
$ref: "#/components/schemas/Condition"
required:
- nodes
Node:
type: object
description: "Status of an individual step within a DAG-run"
properties:
step:
$ref: "#/components/schemas/Step"
stdout:
type: string
description: "Path to the standard output log file for this step"
stderr:
type: string
description: "Path to the standard error log file for this step"
startedAt:
type: string
description: "RFC3339 timestamp when the step started"
finishedAt:
type: string
description: "RFC3339 timestamp when the step finished"
status:
$ref: "#/components/schemas/NodeStatus"
statusLabel:
$ref: "#/components/schemas/NodeStatusLabel"
retryCount:
type: integer
description: "Number of retry attempts made for this step"
doneCount:
type: integer
description: "Number of successful completions for repeating steps"
subRuns:
type: array
description: "List of sub DAG-runs associated with this step"
items:
$ref: "#/components/schemas/SubDAGRun"
subRunsRepeated:
type: array
description: "List of repeated sub DAG-runs when using repeatPolicy"
items:
$ref: "#/components/schemas/SubDAGRun"
error:
type: string
description: "Error message if the step failed"
required:
- step
- stdout
- stderr
- startedAt
- finishedAt
- status
- statusLabel
- retryCount
- doneCount
SubDAGRun:
type: object
description: "Metadata for a sub DAG-run"
properties:
dagRunId:
$ref: "#/components/schemas/DAGRunId"
params:
type: string
description: "Parameters passed to the sub DAG-run in JSON format"
required:
- dagRunId
SubDAGRunDetail:
type: object
description: "Detailed information for a sub DAG-run including timing and status"
properties:
dagRunId:
type: string
description: "Unique identifier for the sub DAG-run"
params:
type: string
description: "Parameters passed to the sub DAG-run in JSON format"
status:
$ref: "#/components/schemas/Status"
statusLabel:
$ref: "#/components/schemas/StatusLabel"
startedAt:
type: string
description: "RFC 3339 timestamp when the sub DAG-run started"
finishedAt:
type: string
description: "RFC 3339 timestamp when the sub DAG-run finished"
required:
- dagRunId
- status
- statusLabel
- startedAt
Step:
type: object
description: "Individual task definition that performs a specific operation in a DAG-run"
properties:
name:
type: string
description: "Unique identifier for the step within the DAG-run"
id:
type: string
description: "Optional short identifier for the step. Can be used in variable references like ${id.stdout} to access step properties. Must be unique within the DAG if specified"
description:
type: string
description: "Human-readable description of what the step does"
dir:
type: string
description: "Working directory for executing the step's command"
cmdWithArgs:
type: string
description: "Complete command string including arguments to execute"
command:
type: string
description: "Base command to execute without arguments"
script:
type: string
description: "Script content if the step executes a script file"
stdout:
type: string
description: "File path for capturing standard output"
stderr:
type: string
description: "File path for capturing standard error"
output:
type: string
description: "Variable name to store the step's output"
args:
type: array
description: "List of arguments to pass to the command"
items:
type: string
call:
type: string
description: "The name of the DAG to execute as a sub DAG-run"
params:
type: string
description: "Parameters to pass to the sub DAG-run in JSON format"
parallel:
type: object
description: "Configuration for parallel execution of the step"
properties:
items:
description: "Array of items to process in parallel. Can be a static array or a reference to a variable containing an array"
oneOf:
- type: array
items:
type: string
- type: string
maxConcurrent:
type: integer
description: "Maximum number of parallel executions. Default is 10 if not specified"
minimum: 1
depends:
type: array
description: "List of step names that must complete before this step can start"
items:
type: string
repeatPolicy:
$ref: "#/components/schemas/RepeatPolicy"
mailOnError:
type: boolean
description: "Whether to send email notifications on step failure"
preconditions:
type: array
description: "Conditions that must be met before the step can start"
items:
$ref: "#/components/schemas/Condition"
timeoutSec:
type: integer
description: "Maximum execution time for the step in seconds. If set, this timeout takes precedence over the DAG-level timeout for this step."
minimum: 0
required:
- name
SearchResultItem:
type: object
description: "Individual search result item for a DAG"
properties:
name:
type: string
description: "Name of the matching DAG"
dag:
$ref: "#/components/schemas/DAG"
matches:
type: array
description: "Details of where matches were found"
items:
$ref: "#/components/schemas/SearchDAGsMatchItem"
required:
- name
- dag
- matches
SearchDAGsMatchItem:
type: object
description: "Details of a search match within a DAG definition"
properties:
line:
type: string
description: "Matching line content"
lineNumber:
type: integer
description: "Line number where match was found"
startLine:
type: integer
description: "Start line for context"
required:
- line
- lineNumber
- startLine
Log:
type: object
description: "Log information for the execution"
properties:
content:
type: string
description: "Log content"
lineCount:
type: integer
description: "Number of lines returned"
totalLines:
type: integer
description: "Total number of lines in the log file"
hasMore:
type: boolean
description: "Whether there are more lines available"
isEstimate:
type: boolean
description: "Whether the line count is an estimate"
required:
- content
DAGGridItem:
type: object
description: "Grid item for visualizing DAG-run execution history"
properties:
name:
type: string
description: "Name of the step"
history:
type: array
description: "Status of the step ordered by time"
items:
$ref: "#/components/schemas/NodeStatus"
required:
- name
- history
Condition:
type: object
description: "Precondition that must be satisfied before running a step or DAG-run"
properties:
condition:
type: string
description: "Expression or check to evaluate"
expected:
type: string
description: "Expected result of the condition evaluation"
negate:
type: boolean
description: "If true, inverts the condition result (run when condition does NOT match)"
error:
type: string
description: "Error message if the condition is not met"
matched:
type: boolean
description: "Whether the condition was met"
required:
- condition
RepeatMode:
type: string
description: "Repeat execution mode for steps"
enum:
- "while"
- "until"
x-enum-varnames:
- "While"
- "Until"
RepeatPolicy:
type: object
description: "Configuration for step repeat behavior"
properties:
repeat:
$ref: "#/components/schemas/RepeatMode"
interval:
type: integer
description: "Time in seconds to wait between repeat attempts"
limit:
type: integer
description: "Maximum number of times to repeat the step"
backoff:
oneOf:
- type: boolean
description: "When true, uses default multiplier of 2.0"
- type: number
format: float
description: "Custom exponential backoff multiplier"
maxIntervalSec:
type: integer
description: "Maximum interval in seconds (caps exponential growth)"
condition:
$ref: "#/components/schemas/Condition"
exitCode:
type: array
description: "List of exit codes that trigger repeat behavior"
items:
type: integer
ListTagResponse:
type: object
description: "Response object for listing all tags"
properties:
tags:
type: array
description: "List of unique tags"
items:
type: string
errors:
type: array
description: "List of errors encountered during the request"
items:
type: string
required:
- tags
- errors
WorkersListResponse:
type: object
description: "Response object for listing distributed workers"
properties:
workers:
type: array
description: "List of distributed workers"
items:
$ref: "#/components/schemas/Worker"
errors:
type: array
description: "List of errors encountered during the request"
items:
type: string
required:
- workers
- errors
Worker:
type: object
description: "Information about a distributed worker"
properties:
id:
type: string
description: "Unique identifier for the worker"
labels:
type: object
description: "Key-value pairs of labels assigned to the worker"
additionalProperties:
type: string
totalPollers:
type: integer
description: "Total number of pollers configured for this worker"
busyPollers:
type: integer
description: "Number of pollers currently executing tasks"
runningTasks:
type: array
description: "List of tasks currently being executed by this worker"
items:
$ref: "#/components/schemas/RunningTask"
lastHeartbeatAt:
type: string
description: "RFC3339 timestamp of the last heartbeat received from this worker"
healthStatus:
$ref: "#/components/schemas/WorkerHealthStatus"
required:
- id
- labels
- totalPollers
- busyPollers
- runningTasks
- lastHeartbeatAt
- healthStatus
RunningTask:
type: object
description: "Information about a task currently being executed"
properties:
dagRunId:
type: string
description: "ID of the DAG run being executed"
dagName:
type: string
description: "Name of the DAG being executed"
startedAt:
type: string
description: "RFC3339 timestamp when the task started"
rootDagRunName:
type: string
description: "Name of the root DAG run"
rootDagRunId:
type: string
description: "ID of the root DAG run"
parentDagRunName:
type: string
description: "Name of the parent DAG run"
parentDagRunId:
type: string
description: "ID of the parent DAG run"
required:
- dagRunId
- dagName
- startedAt
QueuesResponse:
type: object
description: "Response containing all queues with their active DAG-runs"
properties:
queues:
type: array
description: "List of all queues with their running and queued DAG-runs"
items:
$ref: "#/components/schemas/Queue"
summary:
$ref: "#/components/schemas/QueuesSummary"
required:
- queues
- summary
Queue:
type: object
description: "A queue/process group with its active DAG-runs"
properties:
name:
type: string
description: "Name of the queue (global queue name or DAG name if no queue specified)"
type:
type: string
enum: ["global", "dag-based"]
description: "Type of queue - 'global' if explicitly defined, 'dag-based' if using DAG name"
maxConcurrency:
type: integer
description: "Maximum number of concurrent runs allowed. For 'global' queues, this is the configured maxConcurrency. For 'dag-based' queues, this is the DAG's maxActiveRuns (default 1)"
minimum: 1
running:
type: array
description: "List of currently running DAG-runs"
items:
$ref: "#/components/schemas/DAGRunSummary"
queued:
type: array
description: "List of DAG-runs waiting to execute"
items:
$ref: "#/components/schemas/DAGRunSummary"
required:
- name
- type
- running
- queued
QueuesSummary:
type: object
description: "Summary statistics across all queues"
properties:
totalQueues:
type: integer
description: "Total number of active queues"
minimum: 0
totalRunning:
type: integer
description: "Total DAG-runs currently executing"
minimum: 0
totalQueued:
type: integer
description: "Total DAG-runs waiting in queues"
minimum: 0
totalCapacity:
type: integer
description: "Sum of all queue maxConcurrency values"
minimum: 0
utilizationPercentage:
type: number
format: float
description: "System-wide utilization (totalRunning / totalCapacity * 100)"
minimum: 0.0
maximum: 100.0
required:
- totalQueues
- totalRunning
- totalQueued
- totalCapacity
- utilizationPercentage
ResourceHistory:
type: object
properties:
cpu:
type: array
items:
$ref: "#/components/schemas/MetricPoint"
memory:
type: array
items:
$ref: "#/components/schemas/MetricPoint"
disk:
type: array
items:
$ref: "#/components/schemas/MetricPoint"
load:
type: array
items:
$ref: "#/components/schemas/MetricPoint"
MetricPoint:
type: object
properties:
timestamp:
type: integer
format: int64
description: Unix timestamp
value:
type: number
format: double
required:
- timestamp
- value
# ============================================================================
# Authentication & User Management Schemas
# ============================================================================
UserRole:
type: string
description: "User role determining access permissions. admin: full access including user management, manager: DAG CRUD and execution, operator: DAG execution only, viewer: read-only"
enum:
- admin
- manager
- operator
- viewer
LoginRequest:
type: object
description: "Request body for user login"
properties:
username:
type: string
description: "User's username"
minLength: 1
password:
type: string
description: "User's password"
minLength: 1
required:
- username
- password
LoginResponse:
type: object
description: "Response containing authentication token"
properties:
token:
type: string
description: "JWT authentication token"
expiresAt:
type: string
format: date-time
description: "Token expiration timestamp"
user:
$ref: "#/components/schemas/User"
required:
- token
- expiresAt
- user
ChangePasswordRequest:
type: object
description: "Request body for changing password"
properties:
currentPassword:
type: string
description: "Current password for verification"
minLength: 1
newPassword:
type: string
description: "New password to set"
minLength: 8
required:
- currentPassword
- newPassword
ResetPasswordRequest:
type: object
description: "Request body for admin password reset"
properties:
newPassword:
type: string
description: "New password to set for the user"
minLength: 8
required:
- newPassword
CreateUserRequest:
type: object
description: "Request body for creating a new user"
properties:
username:
type: string
description: "Unique username"
minLength: 1
maxLength: 64
password:
type: string
description: "User's password"
minLength: 8
role:
$ref: "#/components/schemas/UserRole"
required:
- username
- password
- role
UpdateUserRequest:
type: object
description: "Request body for updating a user"
properties:
username:
type: string
description: "New username (must be unique)"
minLength: 1
maxLength: 64
role:
$ref: "#/components/schemas/UserRole"
User:
type: object
description: "User information"
properties:
id:
type: string
description: "Unique user identifier"
username:
type: string
description: "User's username"
role:
$ref: "#/components/schemas/UserRole"
createdAt:
type: string
format: date-time
description: "Account creation timestamp"
updatedAt:
type: string
format: date-time
description: "Last update timestamp"
required:
- id
- username
- role
- createdAt
- updatedAt
UserResponse:
type: object
description: "Response containing user information"
properties:
user:
$ref: "#/components/schemas/User"
required:
- user
UsersListResponse:
type: object
description: "Response containing list of users"
properties:
users:
type: array
items:
$ref: "#/components/schemas/User"
required:
- users
SuccessResponse:
type: object
description: "Generic success response"
properties:
message:
type: string
description: "Success message"
required:
- message
# Apply security requirements globally
security:
- apiToken: []
- basicAuth: []
- {}