Skip to content

Instantly share code, notes, and snippets.

@dlamblin
Last active April 4, 2020 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlamblin/d072187dffff9a4f75d442e0d52d827d to your computer and use it in GitHub Desktop.
Save dlamblin/d072187dffff9a4f75d442e0d52d827d to your computer and use it in GitHub Desktop.
OpenAPI schemas for The Airflow API, which has been experimental and without a clear schema
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
openapi: 3.0.3
info:
title: "Airflow API (Experimental)"
description: |
Apache Airflow management API
version: '0.1.10.0'
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
contact:
name: Apache Foundation
url: http://www.airflow.apache.org
email: dev@airflow.apache.org
servers:
- url: /api/experimental
description: Airflow Stable API.
paths:
/dags/{dag_id}:
parameters:
- $ref: '#/components/parameters/DAGID'
delete:
summary: Delete a DAG
operationId: deleteDag
tags: [DAG]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/dags/{dag_id}/dag_runs:
parameters:
- $ref: '#/components/parameters/DAGID'
# get:
# summary: Get all DAG Runs
# description: This endpoint supports reading resources across multiple DAGs by specifying
# a "-" as a dag_id.
# operationId: getDagRuns
# tags: [DAGRun]
# parameters:
# - $ref: '#/components/parameters/PageLimit'
# - $ref: '#/components/parameters/PageOffset'
# responses:
# '200':
# description: List of DAG Runs.
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/DAGRunCollection'
# '401':
# $ref: '#/components/responses/Unauthenticated'
post:
summary: Create a DAG Run
operationId: createDagRun
tags: [DAGRun]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DAGRunCreate'
responses:
'200':
description: List of DAG Runs.
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/dags/{dag_id}/tasks/{task_id}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
get:
summary: Get a simplified representation of a task
operationId: getTask
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dags/{dag_id}/dag_runs/{execution_date}/tasks/{task_id}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/ExecutionDate'
- $ref: '#/components/parameters/TaskID'
get:
summary: Get a representation of a task instance
description: Get a representation of a task instance's details. This call's return values
vary drastically depeding on the task's operator type. IE HiveOperator returns hive_cli_hook
and hql fields amoung others which SparkOperator would not return.
E.G. curl "http://$APIHOST/api/experimental/dags/api_test/dag_runs/2019-04-20T00:00:00+00:00/tasks/test_task"
operationId: getTaskInstance
tags: [TaskInstance]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/TaskInstance'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
# curl --header "Content-Type:\ application/json" --data "{}" -X POST "http://$APIHOST/api/experimental/dags/bdp_smoke_test_v1/dag_runs"
# {
# "message": "Created <DagRun bdp_smoke_test_v1 @ 2020-04-04 09:02:30+00:00: manual__2020-04-04T09:02:30+00:00, externally triggered: True>"
# }
/latest_runs:
get:
summary: Get the latest DAG Runs
description: Get the latest DAG Runs formatted for the UI
E.G. curl -X GET "http://$APIHOST/api/experimental/latest_runs"
operationId: getLatestRuns
tags: [DAGRun]
responses:
'200':
description: List of latest DAG runs.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/LatestDAGRunCollection'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/pools:
get:
summary: Get all pools
description: Get all pools.
E.G. curl -X GET "http://$APIHOST/api/experimental/pools"
operationId: getPools
tags: [Pool]
responses:
'200':
description: List of pools.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PoolCollection'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
post:
summary: Create pool
description: Create a pool.
E.G. curl --header "Content-Type:\ application/json"
--data '{"name":"apitest","id":41,"slots":0}'
-X POST "http://$APIHOST/api/experimental/pools"
operationId: createPool
tags: [Pool]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/pools/{pool_name}:
parameters:
- $ref: '#/components/parameters/PoolName'
get:
summary: Get pool
description: Get a pool.
E.G. curl -X GET "http://$APIHOST/api/experimental/pools/apitest"
operationId: getPool
tags: [Pool]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a pool
description: Delete a pool.
curl -X DELETE "http://$APIHOST/api/experimental/pools/apitest"
operationId: deletePool
tags: [Pool]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
components:
# Reusable schemas (data models)
schemas:
# Database entities
Message:
type: object
properties:
message:
type: string
readOnly: true
DAGRunCreate:
type: object
properties:
execution_date:
type: string
format: date-time
readOnly: true
run_id:
type: string
readOnly: true
conf:
type: string
readOnly: true
LatestDAGRun:
type: object
properties:
dag_id:
type: string
readOnly: true
dag_run_url:
type: string
readOnly: true
execution_date:
type: string
format: date-time
readOnly: true
start_date:
type: string
format: date-time
LatestDAGRunCollection:
type: object
properties:
dag_runs:
type: array
items:
$ref: '#/components/schemas/LatestDAGRun'
Pool:
type: object
properties:
id:
type: integer
readOnly: true
name:
type: string
slots:
type: integer
occupied_slots:
type: integer
readOnly: true
used_slots:
type: integer
readOnly: true
queued_slots:
type: integer
readOnly: true
open_slots:
type: integer
readOnly: true
PoolCollection:
type: array
items:
$ref: '#/components/schemas/Pool'
SLAMiss:
type: object
properties:
task_id:
type: string
readOnly: true
dag_id:
type: string
execution_date:
type: string
format: datetime
email_sent:
type: boolean
timestamp:
type: string
format: datetime
description:
type: string
notification_sent:
type: boolean
TaskInstance:
type: object
properties:
task_id:
type: string
readOnly: true
dag_id:
type: string
execution_date:
type: string
format: datetime
start_date:
type: string
format: datetime
end_date:
type: string
format: datetime
duration:
type: number
state:
$ref: '#/components/schemas/TaskState'
try_number:
type: integer
max_tries:
type: integer
hostname:
type: string
unixname:
type: string
job_id:
type: integer
pool:
type: string
pool_slots:
type: integer
queue:
type: string
priority_weight:
type: integer
operator:
type: string
queued_dttm:
type: string
pid:
type: integer
executor_config:
type: string
sla_miss:
$ref: '#/components/schemas/SLAMiss'
#Actual example:
# {
# "adhoc": "False",
# "depends_on_past": "False",
# "email": "['jyulpark@coupang.com']",
# "email_on_failure": "True",
# "email_on_retry": "True",
# "end_date": "None",
# "execution_timeout": "None",
# "executor_config": "{}",
# "hive_cli_conn_id": "hive_cli_default",
# "hiveconf_jinja_translate": "False",
# "hiveconfs": "{}",
# "hook": "None",
# "hql": "\n show databases;\n ",
# "inlets": "[]",
# "lineage_data": "None",
# "mapred_job_name": "None",
# "mapred_queue": "root.deteam",
# "mapred_queue_priority": "None",
# "max_retry_delay": "None",
# "on_demand_portal_spec": "None",
# "on_failure_callback": "None",
# "on_retry_callback": "None",
# "on_success_callback": "None",
# "outlets": "[]",
# "owner": "jyulpark",
# "params": "{}",
# "pool": "None",
# "portal_spec": "None",
# "priority_weight": "1",
# "queue": "default",
# "resources": "{'cpus': {'_name': 'CPU', …}}",
# "retries": "1",
# "retry_delay": "0:05:00",
# "retry_exponential_backoff": "False",
# "run_as": "jyulpark",
# "run_as_user": "None",
# "schema": "default",
# "script_begin_tag": "None",
# "sla": "None",
# "start_date": "2020-04-01 00:00:00+00:00",
# "task_concurrency": "None",
# "task_id": "hive_test",
# "trigger_rule": "all_success",
# "wait_for_downstream": "False",
# "weight_rule": "downstream"
# }
Task:
type: object
properties:
adhoc:
type: boolean
readOnly: true
email:
type: string
readOnly: true
email_on_failure:
type: boolean
readOnly: true
email_on_retry:
type: boolean
readOnly: true
end_date:
type: string
format: 'date-time'
readOnly: true
execution_timeout:
$ref: '#/components/schemas/TimeDelta'
executor_config:
type: string
readOnly: true
class_ref:
$ref: '#/components/schemas/ClassReference'
task_id:
type: string
readOnly: true
owner:
type: string
readOnly: true
start_date:
type: string
format: 'date-time'
readOnly: true
trigger_rule:
$ref: '#/components/schemas/TriggerRule'
extra_links:
type: array
readOnly: true
items:
type: object
properties:
class_ref:
$ref: '#/components/schemas/ClassReference'
depends_on_past:
type: boolean
readOnly: true
wait_for_downstream:
type: boolean
readOnly: true
retries:
type: number
readOnly: true
queue:
type: string
readOnly: true
pool:
type: string
readOnly: true
pool_slots:
type: number
readOnly: true
retry_delay:
$ref: '#/components/schemas/TimeDelta'
retry_exponential_backoff:
type: boolean
readOnly: true
priority_weight:
type: number
readOnly: true
weight_rule:
$ref: '#/components/schemas/WeightRule'
ui_color:
$ref: '#/components/schemas/Color'
ui_fgcolor:
$ref: '#/components/schemas/Color'
template_fields:
type: array
readOnly: true
items:
type: string
sub_dag_id:
type: string
readOnly: true
downstream_task_ids:
type: array
readOnly: true
items:
type: string
TimeDelta:
type: object
properties:
objectType: {type: string}
days: {type: integer}
seconds: {type: integer}
# TODO: Are we sure this shouldn't be microseconds instead?
microsecond: {type: integer}
Color:
type: string
pattern: ^#[a-fA-F0-9]{3,6}$
ClassReference:
type: object
properties:
module_path:
type: string
readOnly: true
class_name:
type: string
readOnly: true
# Generic
Error:
description: >
[RFC7807](https://tools.ietf.org/html/rfc7807) compliant response.
type: object
properties:
type:
type: string
description: >
A URI reference [RFC3986] that identifies the problem type. This specification encourages that,
when dereferenced, it provide human-readable documentation for the problem type.
title:
type: string
description: A short, human-readable summary of the problem type.
status:
type: number
description: The HTTP status code generated by the API server for this occurrence of the problem.
details:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
instance:
type: string
description: >
A URI reference that identifies the specific occurrence of the problem. It may or may
not yield further information if dereferenced.
required:
- type
- title
- status
# Enums
# TODO: If these aren't generated there should at least be a linting test for synchronization
TaskState:
type: string
enum:
- success
- running
- failed
- upstream_failed
- skipped
- up_for_retry
- up_for_reschedule
- queued
- none
- scheduled
TriggerRule:
type: string
enum:
- all_success
- all_failed
- all_done
- one_success
- one_failed
- none_failed
- none_skipped
- dummy
WeightRule:
type: string
enum:
- downstream
- upstream
- absolute
# Reusable path, query, header and cookie parameters
parameters:
DAGID:
in: path
name: dag_id
schema:
type: string
required: true
description: The DAG ID.
TaskID:
in: path
name: task_id
schema:
type: string
required: true
description: The Task ID.
PoolName:
in: path
name: pool_name
schema:
type: string
required: true
description: The Pool Name.
ExecutionDate:
in: path
name: execution_date
schema:
type: string
format: 'date-time'
required: true
description: >
The date-time notation as defined by
[RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6),
E.G. `2017-07-21T17:32:28Z`.
# Reusable responses, such as 401 Unauthenticated or 400 Bad Request
responses:
# 400
'BadRequest':
description: Client specified an invalid argument.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 401
'Unauthenticated':
description: Request not authenticated due to missing, invalid, authentication info.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 403
'PermissionDenied':
description: Client does not have sufficient permission.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 404
'NotFound':
description: A specified resource is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 409
'AlreadyExists':
description: The resource that a client tried to create already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 500
'Unknown':
description: Unknown server error.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
tags:
- name: DAG
- name: DAGRun
- name: Pool
- name: TaskInstance
externalDocs:
url: http://airflow.apache.org/docs/1.10.1/api.html
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
openapi: 3.0.3
info:
title: "Airflow API (Experimental)"
description: Apache Airflow management API.
version: '0.1.10.9'
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
contact:
name: Apache Foundation
url: http://www.airflow.apache.org
email: dev@airflow.apache.org
servers:
- url: /api/Experimental
description: Airflow Stable API.
paths:
# Database entities
/connections:
get:
summary: Get all connection entries
operationId: getConnections
tags: [Connection]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of connection entries.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ConnectionCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
post:
summary: Create a connection entry
operationId: createConnection
tags: [Connection]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Connection'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Connection'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/connections/{connection_id}:
parameters:
- $ref: '#/components/parameters/ConnectionID'
get:
summary: Get a connection entry
operationId: getConnection
tags: [Connection]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Connection'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a connection entry
operationId: patchConnection
tags: [Connection]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Connection'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Connection'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a connection entry
operationId: deleteConnection
tags: [Connection]
responses:
'204':
description: No content
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/dags:
get:
summary: Get all DAGs
operationId: getDags
tags: [DAG]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of DAGs
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/DAGCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
/dags/{dag_id}:
parameters:
- $ref: '#/components/parameters/DAGID'
get:
summary: Get basic information about a DAG
description: Presents only information available in database (DAGModel).
operationId: getDag
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/DAG'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update the specific DAG
operationId: updateDag
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/DAG'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
# TODO: Can DAGs be triggered like /api/experimental/dags/<DAG_ID>/dag_runs (POST)?
/dags/{dag_id}/dagRuns:
parameters:
- $ref: '#/components/parameters/DAGID'
get:
summary: Get all DAG Runs
description: This endpoint supports reading resources across multiple DAGs by specifying
a "-" as a dag_id.
operationId: getDagRuns
tags: [DAGRun]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of DAG Runs.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/DAGRunCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
/dags/{dag_id}/dagRuns/{dag_run_id}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/DAGRunID'
get:
summary: Get a DAG Run
operationId: getDagRun
tags: [DAGRun]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/DAGRun'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a DAG Run
operationId: updateDagRun
tags: [DAGRun]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DAGRun'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/DAGRun'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a DAG Run
operationId: deleteDagRun
tags: [DAGRun]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/eventLogs:
get:
summary: Get all log entries from event log
operationId: getEventLog
tags: [EventLog]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of log entries.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/EventLogCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
post:
summary: Create event log
operationId: createEventLog
tags: [EventLog]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EventLog'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/EventLog'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/eventLogs/{event_log_id}:
parameters:
- $ref: '#/components/parameters/EventLogID'
get:
summary: Get a log entry
operationId: getEventLogEntry
tags: [EventLog]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/EventLog'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a log entry
operationId: updateEventLogEntry
tags: [EventLog]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EventLog'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/EventLog'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a log entry
operationId: deleteEventLogEntry
tags: [EventLog]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/importErrors:
get:
summary: Get all import errors
operationId: getImportErrors
tags: [ImportError]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of import errors.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ImportErrorCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/importErrors/{import_error_id}:
parameters:
- $ref: '#/components/parameters/ImportErrorID'
get:
summary: Get an import error
operationId: getImportError
tags: [ImportError]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/ImportError'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete an import error
operationId: deleteImportError
tags: [ImportError]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/pools:
get:
summary: Get all pools
operationId: getPools
tags: [Pool]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of pools.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PoolCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
post:
summary: Create a pool
operationId: createPool
tags: [Pool]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/pools/{pool_id}:
parameters:
- $ref: '#/components/parameters/PoolID'
get:
summary: Get a pool
operationId: getPool
tags: [Pool]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a pool
operationId: updatePool
tags: [Pool]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Pool'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a pool
operationId: deletePool
tags: [Pool]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/dags/{dag_id}/taskInstances:
parameters:
- $ref: '#/components/parameters/DAGID'
get:
summary: Get list of task instances of DAG
description: This endpoint support reading resources across multiple DAGs by specifying
a "-" as a dag_id.
operationId: getTaskInstances
tags: [Pool]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of task instances.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/TaskInstanceCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/dags/{dag_id}/taskInstances/{task_id}/{execution_date}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
- $ref: '#/components/parameters/ExecutionDate'
get:
summary: Get a task instance
operationId: getTaskInstance
tags: [TaskInstance]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/TaskInstance'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a task instance
operationId: updateTaskInstance
tags: [TaskInstance]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TaskInstance'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/TaskInstance'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete DAG Run
operationId: deleteTaskInstance
tags: [TaskInstance]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/variables:
get:
summary: Get all variables
operationId: getVariables
tags: [Variable]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of variables.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/VariableCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
post:
summary: Create a variable
operationId: createVariable
tags: [Variable]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Variable'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Variable'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/variables/{variable_id}:
parameters:
- $ref: '#/components/parameters/VariableID'
get:
summary: Get a variable by id
operationId: getVariable
description: The collection does not contain data. To get data, you must get a single entity.
tags: [Variable]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Variable'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a variable by id
operationId: updateVariable
tags: [Variable]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Variable'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Variable'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a variable by id
operationId: deleteVariable
tags: [Variable]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/variables/lookup:
parameters:
- $ref: '#/components/parameters/VariableKey'
get:
summary: Get a variable by its key
description: The response contains all fields, including data.
operationId: lookupVariable
tags: [Variable]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Variable'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
- $ref: '#/components/parameters/ExecutionDate'
get:
summary: Get all XCom values
description:
This endpoint supports reading resources across multiple Task Instances by specifying
"-" as `dag_id`, `task_id` and `execution_date`.
operationId: getXComValues
tags: [XCom]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: List of XCom values.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/XComCollection'
- $ref: '#/components/schemas/CollectionInfo'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
# TODO: Would be more consistent: post should add, patch with update_mask should update.
post:
summary: Update XCom entries
operationId: updateXComValues
tags: [XCom]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/XCom'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/XCom'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
/dags/{dag_id}/taskInstances/{task_id}/{execution_date}/xcomValues/{key}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
- $ref: '#/components/parameters/ExecutionDate'
- $ref: '#/components/parameters/XComKey'
get:
summary: Get an XCom entry
operationId: getXComValue
tags: [XCom]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/XCom'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update an XCom entry
operationId: updateXComValue
tags: [XCom]
parameters:
- $ref: '#/components/parameters/UpdateMask'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/XCom'
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/XCom'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete an XCom entry
operationId: deleteXComValue
tags: [XCom]
responses:
'204':
description: No content.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
# Non-database resources
/dags/{dag_id}/taskInstances/{task_id}/{execution_date}/links:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
- $ref: '#/components/parameters/ExecutionDate'
get:
summary: Get extra links for task instance
operationId: getExtraLinks
tags: [TaskInstance]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/ExtraLinkCollection'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dags/{dag_id}/taskInstances/{task_id}/{execution_date}/logs/{task_try_number}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
- $ref: '#/components/parameters/ExecutionDate'
- $ref: '#/components/parameters/TaskTryNumber'
- $ref: '#/components/parameters/NoChunking'
- $ref: '#/components/parameters/ContinuationToken'
get:
summary: Get logs for specific task instance
operationId: getLogs
tags: [TaskInstance]
responses:
'200':
description: Content of logs.
content:
application/json:
schema:
type: object
properties:
continuation_token:
type: string
content:
type: string
text/plain:
schema:
type: string
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dags/{dag_id}/structure:
parameters:
- $ref: '#/components/parameters/DAGID'
get:
summary: Get simplified representation of DAG
operationId: getDagStructure
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/DagStructure'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dags/{dag_id}/tasks:
parameters:
- $ref: '#/components/parameters/DAGID'
get:
summary: Get tasks for a DAG
operationId: getTasks
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/TaskCollection'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dags/{dag_id}/tasks/{task_id}:
parameters:
- $ref: '#/components/parameters/DAGID'
- $ref: '#/components/parameters/TaskID'
get:
summary: Get simplified representation of a task
operationId: getTask
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Task'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/dagSources/{file_token}:
parameters:
- $ref: '#/components/parameters/FileToken'
get:
summary: Get source code using file token
operationId: getDagSource
tags: [DAG]
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: object
properties:
content:
type: string
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
'404':
$ref: '#/components/responses/NotFound'
/config:
get:
summary: Get current configuration
operationId: getConfig
tags: [Config]
parameters:
- $ref: '#/components/parameters/PageLimit'
- $ref: '#/components/parameters/PageOffset'
responses:
'200':
description: Return current configuration.
content:
application/json:
schema:
$ref: '#/components/schemas/Config'
text/plain:
schema:
type: string
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/PermissionDenied'
components:
# Reusable schemas (data models)
schemas:
# Database entities
ConnectionCollectionItem:
type: object
properties:
id:
type: integer
readOnly: true
conn_id:
type: string
conn_type:
type: string
host:
type: string
login:
type: string
schema:
type: string
port:
type: integer
ConnectionCollection:
type: object
properties:
connections:
type: array
items:
$ref: '#/components/schemas/ConnectionCollectionItem'
Connection:
allOf:
- $ref: '#/components/schemas/ConnectionCollectionItem'
- type: object
properties:
password:
type: string
format: password
extra:
type: string
DAG:
type: object
properties:
dag_id:
type: string
readOnly: true
root_dag_id:
type: string
readOnly: true
is_paused:
type: string
is_subdag:
type: string
readOnly: true
is_active:
type: string
readOnly: true
fileloc:
type: string
readOnly: true
owners:
type: string
readOnly: true
description:
type: string
readOnly: true
schedule_interval:
oneOf:
- $ref: '#/components/schemas/ScheduleInterval'
readOnly: true
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
readOnly: true
DAGCollection:
type: object
properties:
dag_model:
type: array
items:
$ref: '#/components/schemas/DAG'
DAGRun:
type: object
properties:
dag_id:
type: string
readOnly: true
execution_date:
type: string
format: date-time
readOnly: true
start_date:
type: string
format: date-time
end_date:
type: string
format: date-time
state:
$ref: '#/components/schemas/TaskState'
run_id:
type: string
external_trigger:
type: boolean
default: true
DAGRunCollection:
type: object
properties:
dag_runs:
type: array
items:
$ref: '#/components/schemas/DAGRun'
EventLog:
type: object
properties:
id:
type: integer
readOnly: true
dttm:
type: string
readOnly: true
dag_id:
type: string
readOnly: true
task_id:
type: string
readOnly: true
event:
type: string
readOnly: true
execution_date:
type: string
readOnly: true
owner:
type: string
readOnly: true
extra:
type: string
readOnly: true
EventLogCollection:
type: object
properties:
event_logs:
type: array
items:
$ref: '#/components/schemas/EventLogCollection'
ImportError:
type: object
properties:
id:
type: integer
readOnly: true
timestamp:
type: string
format: datetime
readOnly: true
filename:
type: string
readOnly: true
stack_trace:
type: string
readOnly: true
ImportErrorCollection:
type: object
properties:
import_errors:
type: array
items:
$ref: '#/components/schemas/ImportError'
Pool:
type: object
properties:
id:
type: integer
readOnly: true
name:
type: string
slots:
type: integer
occupied_slots:
type: integer
readOnly: true
used_slots:
type: integer
readOnly: true
queued_slots:
type: integer
readOnly: true
open_slots:
type: integer
readOnly: true
PoolCollection:
type: object
properties:
pools:
type: array
items:
$ref: '#/components/schemas/Pool'
SLAMiss:
type: object
properties:
task_id:
type: string
readOnly: true
dag_id:
type: string
execution_date:
type: string
format: datetime
email_sent:
type: boolean
timestamp:
type: string
format: datetime
description:
type: string
notification_sent:
type: boolean
SLAMissCollection:
type: object
properties:
sla_misses:
type: array
items:
$ref: '#/components/schemas/SLAMiss'
TaskFail:
type: object
properties:
task_id:
type: string
dag_id:
type: string
execution_date:
type: string
format: datetime
start_date:
type: string
format: datetime
end_date:
type: string
format: datetime
duration:
type: integer
TaskInstance:
type: object
properties:
task_id:
type: string
dag_id:
type: string
execution_date:
type: string
format: datetime
start_date:
type: string
format: datetime
end_date:
type: string
format: datetime
duration:
type: number
state:
$ref: '#/components/schemas/TaskState'
try_number:
type: integer
max_tries:
type: integer
hostname:
type: string
unixname:
type: string
job_id:
type: integer
pool:
type: string
pool_slots:
type: integer
queue:
type: string
priority_weight:
type: integer
operator:
type: string
queued_dttm:
type: string
pid:
type: integer
executor_config:
type: string
sla_miss:
$ref: '#/components/schemas/SLAMiss'
TaskInstanceCollection:
type: object
properties:
task_instances:
type: array
items:
$ref: '#/components/schemas/TaskInstance'
VariableCollectionItem:
# Divided into two schemas for sensitive data protection
type: object
properties:
id:
type: string
key:
type: string
value:
type: string
is_encrypted:
type: boolean
VariableCollection:
type: object
properties:
task_instances:
type: array
items:
$ref: '#/components/schemas/VariableCollectionItem'
# TODO: VariableCollectionItem already has a "value"
Variable:
allOf:
- $ref: '#/components/schemas/VariableCollectionItem'
- type: object
properties:
value:
type: string
XComCollectionItem:
# Divided into two schemas for sensitive data protection
type: object
properties:
key:
type: string
timestamp:
type: string
format: datetime
execution_date:
type: string
format: datetime
task_id:
type: string
dag_id:
type: string
XComCollection:
type: object
properties:
xcom:
type: array
items:
$ref: '#/components/schemas/XComCollectionItem'
XCom:
allOf:
- $ref: '#/components/schemas/XComCollectionItem'
- type: object
properties:
value:
type: string
# Python objects
# Based on
# airflow/serialization/schema.json
# but simplified to make the easier to use and to make backward compatibility easier.
DagStructure:
type: object
properties:
dag_id:
type: string
readOnly: true
timezone:
$ref: '#/components/schemas/Timezone'
schedule_interval:
$ref: '#/components/schemas/ScheduleInterval'
catchup:
type: boolean
readOnly: true
is_subdag:
type: boolean
readOnly: true
fileloc:
type: string
readOnly: true
orientation:
type: string
readOnly: true
description:
type: string
readOnly: true
concurrency:
type: number
readOnly: true
start_date:
type: string
format: 'date-time'
readOnly: true
dag_run_timeout:
$ref: '#/components/schemas/TimeDelta'
doc_md:
type: string
readOnly: true
default_view:
type: string
readOnly: true
tags:
type: array
readOnly: true
items:
$ref: '#/components/schemas/Tag'
DagStructureCollection:
type: object
properties:
dag_structures:
type: array
items:
$ref: '#/components/schemas/DagStructure'
ExtraLink:
type: object
properties:
class_ref:
$ref: '#/components/schemas/ClassReference'
name:
type: string
readOnly: true
href:
type: string
readOnly: true
ExtraLinkCollection:
type: object
properties:
extra_links:
type: array
items:
$ref: '#/components/schemas/ExtraLink'
Task:
type: object
properties:
class_ref:
$ref: '#/components/schemas/ClassReference'
task_id:
type: string
readOnly: true
owner:
type: string
readOnly: true
start_date:
type: string
format: 'date-time'
readOnly: true
end_date:
type: string
format: 'date-time'
readOnly: true
trigger_rule:
$ref: '#/components/schemas/TriggerRule'
extra_links:
type: array
readOnly: true
items:
type: object
properties:
class_ref:
$ref: '#/components/schemas/ClassReference'
depends_on_past:
type: boolean
readOnly: true
wait_for_downstream:
type: boolean
readOnly: true
retries:
type: number
readOnly: true
queue:
type: string
readOnly: true
pool:
type: string
readOnly: true
pool_slots:
type: number
readOnly: true
execution_timeout:
$ref: '#/components/schemas/TimeDelta'
retry_delay:
$ref: '#/components/schemas/TimeDelta'
retry_exponential_backoff:
type: boolean
readOnly: true
priority_weight:
type: number
readOnly: true
weight_rule:
$ref: '#/components/schemas/WeightRule'
ui_color:
$ref: '#/components/schemas/Color'
ui_fgcolor:
$ref: '#/components/schemas/Color'
template_fields:
type: array
readOnly: true
items:
type: string
sub_dag_id:
type: string
readOnly: true
downstream_task_ids:
type: array
readOnly: true
items:
type: string
TaskCollection:
type: object
properties:
task:
type: array
items:
$ref: '#/components/schemas/Task'
# Configuration
ConfigOption:
type: object
properties:
key:
type: string
readOnly: true
value:
type: string
readOnly: true
ConfigSection:
type: object
properties:
name:
type: string
readOnly: true
options:
type: array
items:
$ref: '#/components/schemas/ConfigOption'
Config:
type: object
properties:
sections:
type: array
items:
$ref: '#/components/schemas/ConfigSection'
# Common data type
ScheduleInterval:
oneOf:
- $ref: '#/components/schemas/TimeDelta'
- $ref: '#/components/schemas/RelativeDelta'
- $ref: '#/components/schemas/CronExpression'
discriminator:
propertyName: objectType
TimeDelta:
type: object
properties:
objectType: {type: string}
days: {type: integer}
seconds: {type: integer}
# TODO: Are we sure this shouldn't be microseconds instead?
microsecond: {type: integer}
RelativeDelta:
# TODO: Why we need these fields?
type: object
properties:
objectType: {type: string}
years: {type: integer}
months: {type: integer}
days: {type: integer}
leapdays: {type: integer}
hours: {type: integer}
minutes: {type: integer}
seconds: {type: integer}
microseconds: {type: integer}
year: {type: integer}
month: {type: integer}
day: {type: integer}
hour: {type: integer}
minute: {type: integer}
second: {type: integer}
microsecond: {type: integer}
CronExpression:
type: object
properties:
objectType: {type: string}
value: {type: string}
Timezone:
type: string
Tag:
# Object to maintain extensibility
type: object
properties:
name:
type: string
Color:
type: string
pattern: ^#[a-fA-F0-9]{3,6}$
ClassReference:
type: object
properties:
module_path:
type: string
readOnly: true
class_name:
type: string
readOnly: true
# Generic
Error:
description: >
[RFC7807](https://tools.ietf.org/html/rfc7807) compliant response.
type: object
properties:
type:
type: string
description: >
A URI reference [RFC3986] that identifies the problem type. This specification
encourages that, when dereferenced, it provide human-readable documentation for
the problem type.
title:
type: string
description: A short, human-readable summary of the problem type.
status:
type: number
description: The HTTP status code generated by the API server for this occurrence of
the problem.
details:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
instance:
type: string
description: >
A URI reference that identifies the specific occurrence of the problem. It may or may
not yield further information if dereferenced.
required:
- type
- title
- status
CollectionInfo:
type: object
properties:
total_entries:
type: integer
# Enums
# TODO: If these aren't generated there should at least be a linting test for synchronization
TaskState:
type: string
enum:
- success
- running
- failed
- upstream_failed
- skipped
- up_for_retry
- up_for_reschedule
- queued
- none
- scheduled
DagState:
type: string
enum:
- sucess
- running
- failed
TriggerRule:
type: string
enum:
- all_success
- all_failed
- all_done
- one_success
- one_failed
- none_failed
- none_skipped
- dummy
WeightRule:
type: string
enum:
- downstream
- upstream
- absolute
# Reusable path, query, header and cookie parameters
parameters:
# Pagination parameters
PageOffset:
in: query
name: offset
required: false
schema:
type: integer
minimum: 0
description: The number of items to skip before starting to collect the result set.
PageLimit:
in: query
name: limit
required: false
schema:
type: integer
minimum: 1
default: 100
description: The numbers of items to return.
# Database entity fields
ConnectionID:
in: path
name: connection_id
schema:
type: integer
required: true
description: The Connection ID.
DAGID:
in: path
name: dag_id
schema:
type: integer
required: true
description: The DAG ID.
DAGRunID:
in: path
name: dag_run_id
schema:
type: integer
required: true
description: The DAG Run ID.
TaskID:
in: path
name: task_id
schema:
type: integer
required: true
description: The Task ID.
TaskTryNumber:
in: path
name: task_try_number
schema:
type: integer
required: true
description: The Task Try Number.
EventLogID:
in: path
name: event_log_id
schema:
type: integer
required: true
description: The Event Log ID.
ImportErrorID:
in: path
name: import_error_id
schema:
type: integer
required: true
description: The Import Error ID.
PoolID:
in: path
name: pool_id
schema:
type: integer
required: true
description: The Pool ID.
VariableID:
in: path
name: variable_id
schema:
type: string
required: true
description: The Variable ID.
VariableKey:
in: query
name: variable_key
schema:
type: string
required: true
description: The Variable Key.
ExecutionDate:
in: path
name: execution_date
schema:
type: string
format: 'date-time'
required: true
description: >
The date-time notation as defined by
[RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6),
E.G. `2017-07-21T17:32:28Z`.
# Logs
NoChunking:
in: query
name: full_content
schema:
type: boolean
required: false
description: A full reply will be returned.
By default, only the first fragment will be returned.
ContinuationToken:
in: query
name: token
schema:
type: boolean
required: false
description: >
A token that allows you to continue fetching task logs.
If passed, it will specify the location from which the download should be continued.
XComKey:
in: path
name: key
schema:
type: string
required: true
description: The XCom Key.
# Other parameters
FileToken:
in: path
name: file_token
schema:
type: string
required: true
description: >
The key containing the encrypted path to the file. Encryption and decryption takes place
only on the server side. This prevents the client from reading an non-DAG file.
This also ensures API extensibility, because the format of encrypted data may change.
UpdateMask:
in: query
name: update_mask
schema:
type: array
items:
type: string
description: >
The fields to update on the object (connection, pool etc). If absent or empty, all
modifiable fields are updated. A comma-separated list of fully qualified names of fields.
style: form
explode: false
# Reusable request bodies
requestBodies: {}
# Reusable responses, such as 401 Unauthenticated or 400 Bad Request
responses:
# 400
'BadRequest':
description: Client specified an invalid argument.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 401
'Unauthenticated':
description: Request not authenticated due to missing, invalid, authentication info.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 403
'PermissionDenied':
description: Client does not have sufficient permission.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 404
'NotFound':
description: A specified resource is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 409
'AlreadyExists':
description: The resource that a client tried to create already exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# 500
'Unknown':
description: Unknown server error.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
# Reusable response headers
headers: {}
# Reusable examples
examples: {}
# Reusable links
links: {}
# Reusable callbacks
callbacks: {}
# The API will provide support for plugins to support various authorization mechanisms.
# Detailed information will be available in the plugin specification.
security: []
tags:
- name: Config
- name: Connection
- name: DAG
- name: DAGRun
- name: EventLog
- name: ImportError
- name: Pool
- name: TaskInstance
- name: Variable
- name: XCom
externalDocs:
url: http://airflow.apache.org/docs/1.10.9/api.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment