This is an automated email from the ASF dual-hosted git repository. eladkal pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push: new e8f62e8ee5 Add DagModel attributes before dumping DagDetailSchema for get_dag_details API endpoint (#34947) e8f62e8ee5 is described below commit e8f62e8ee56519459d8282dadb1d8c198ea5b9f5 Author: Ryan Hatter <25823361+rnh...@users.noreply.github.com> AuthorDate: Fri Nov 24 04:47:33 2023 -0500 Add DagModel attributes before dumping DagDetailSchema for get_dag_details API endpoint (#34947) * Add DagModel attributes before dumping DagDetailSchema * fix tests * fix tests * missed an f-string :( * apply dag attributes to dag model instead of other way around * pass session to --- airflow/api_connexion/endpoints/dag_endpoint.py | 10 +- airflow/api_connexion/openapi/v1.yaml | 1946 ++++++++++---------- airflow/api_connexion/schemas/dag_schema.py | 2 +- airflow/models/dag.py | 4 + airflow/www/static/js/types/api-generated.ts | 2 +- tests/api_connexion/endpoints/test_dag_endpoint.py | 251 ++- tests/api_connexion/schemas/test_dag_schema.py | 1 + 7 files changed, 1135 insertions(+), 1081 deletions(-) diff --git a/airflow/api_connexion/endpoints/dag_endpoint.py b/airflow/api_connexion/endpoints/dag_endpoint.py index 21a61a0ddd..3486244b39 100644 --- a/airflow/api_connexion/endpoints/dag_endpoint.py +++ b/airflow/api_connexion/endpoints/dag_endpoint.py @@ -61,12 +61,18 @@ def get_dag(*, dag_id: str, session: Session = NEW_SESSION) -> APIResponse: @security.requires_access_dag("GET") -def get_dag_details(*, dag_id: str) -> APIResponse: +@provide_session +def get_dag_details(*, dag_id: str, session: Session = NEW_SESSION) -> APIResponse: """Get details of DAG.""" dag: DAG = get_airflow_app().dag_bag.get_dag(dag_id) if not dag: raise NotFound("DAG not found", detail=f"The DAG with dag_id: {dag_id} was not found") - return dag_detail_schema.dump(dag) + dag_model: DagModel = session.get(DagModel, dag_id) + for key, value in dag.__dict__.items(): + if not key.startswith("_") and not hasattr(dag_model, key): + setattr(dag_model, key, value) + + return dag_detail_schema.dump(dag_model) @security.requires_access_dag("GET") diff --git a/airflow/api_connexion/openapi/v1.yaml b/airflow/api_connexion/openapi/v1.yaml index e4ae9c776f..11b716368a 100644 --- a/airflow/api_connexion/openapi/v1.yaml +++ b/airflow/api_connexion/openapi/v1.yaml @@ -231,7 +231,7 @@ info: This means that the server encountered an unexpected condition that prevented it from fulfilling the request. - version: '2.8.0.dev0' + version: "2.8.0.dev0" license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -253,20 +253,20 @@ paths: operationId: get_connections tags: [Connection] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/ConnectionCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/ConnectionCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" post: summary: Create a connection @@ -278,24 +278,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Connection' + $ref: "#/components/schemas/Connection" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Connection' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $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' + - $ref: "#/components/parameters/ConnectionID" get: summary: Get a connection @@ -303,18 +303,18 @@ paths: operationId: get_connection tags: [Connection] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Connection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/Connection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: summary: Update a connection @@ -322,29 +322,29 @@ paths: operationId: patch_connection tags: [Connection] parameters: - - $ref: '#/components/parameters/UpdateMask' + - $ref: "#/components/parameters/UpdateMask" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/Connection' + $ref: "#/components/schemas/Connection" responses: - '200': + "200": description: Success. 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' + $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 @@ -352,16 +352,16 @@ paths: operationId: delete_connection tags: [Connection] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /connections/test: post: @@ -387,40 +387,40 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Connection' + $ref: "#/components/schemas/Connection" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/ConnectionTest' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/ConnectionTest" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags: get: summary: List DAGs description: > - List DAGs in the database. + List DAGs in the database. - `dag_id_pattern` can be set to match dags of a specific pattern + `dag_id_pattern` can be set to match dags of a specific pattern x-openapi-router-controller: airflow.api_connexion.endpoints.dag_endpoint operationId: get_dags tags: [DAG] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' - - $ref: '#/components/parameters/FilterTags' - - $ref: '#/components/parameters/OnlyActive' - - $ref: '#/components/parameters/Paused' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" + - $ref: "#/components/parameters/FilterTags" + - $ref: "#/components/parameters/OnlyActive" + - $ref: "#/components/parameters/Paused" - name: dag_id_pattern in: query schema: @@ -429,31 +429,31 @@ paths: description: | If set, only return DAGs with dag_ids matching this pattern. responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAGCollection' - '401': - $ref: '#/components/responses/Unauthenticated' + $ref: "#/components/schemas/DAGCollection" + "401": + $ref: "#/components/responses/Unauthenticated" patch: summary: Update DAGs description: > - Update DAGs of a given dag_id_pattern using UpdateMask. + Update DAGs of a given dag_id_pattern using UpdateMask. - This endpoint allows specifying `~` as the dag_id_pattern to update all DAGs. + This endpoint allows specifying `~` as the dag_id_pattern to update all DAGs. - *New in version 2.3.0* + *New in version 2.3.0* x-openapi-router-controller: airflow.api_connexion.endpoints.dag_endpoint operationId: patch_dags parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/FilterTags' - - $ref: '#/components/parameters/UpdateMask' - - $ref: '#/components/parameters/OnlyActive' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/FilterTags" + - $ref: "#/components/parameters/UpdateMask" + - $ref: "#/components/parameters/OnlyActive" - name: dag_id_pattern in: query schema: @@ -467,26 +467,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DAG' + $ref: "#/components/schemas/DAG" example: is_paused: true responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAGCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DAGCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}: parameters: - - $ref: '#/components/parameters/DAGID' + - $ref: "#/components/parameters/DAGID" get: summary: Get basic information about a DAG @@ -498,47 +498,47 @@ paths: operationId: get_dag tags: [DAG] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAG' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DAG" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: summary: Update a DAG x-openapi-router-controller: airflow.api_connexion.endpoints.dag_endpoint operationId: patch_dag parameters: - - $ref: '#/components/parameters/UpdateMask' + - $ref: "#/components/parameters/UpdateMask" tags: [DAG] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/DAG' + $ref: "#/components/schemas/DAG" example: is_paused: true responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAG' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DAG" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" delete: summary: Delete a DAG @@ -551,22 +551,22 @@ paths: operationId: delete_dag tags: [DAG] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/AlreadyExists' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" + "409": + $ref: "#/components/responses/AlreadyExists" /dags/{dag_id}/clearTaskInstances: parameters: - - $ref: '#/components/parameters/DAGID' + - $ref: "#/components/parameters/DAGID" post: summary: Clear a set of task instances @@ -581,27 +581,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ClearTaskInstances' + $ref: "#/components/schemas/ClearTaskInstances" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceReferenceCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/TaskInstanceReferenceCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" patch: summary: Update the TaskInstance note. @@ -618,30 +618,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SetTaskInstanceNote' + $ref: "#/components/schemas/SetTaskInstanceNote" responses: - '200': + "200": description: Success. 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' - - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote: - parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' - - $ref: '#/components/parameters/MapIndex' + $ref: "#/components/schemas/TaskInstance" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" + + ? /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote + : parameters: + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" + - $ref: "#/components/parameters/MapIndex" patch: summary: Update the TaskInstance note. @@ -658,27 +658,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SetTaskInstanceNote' + $ref: "#/components/schemas/SetTaskInstanceNote" responses: - '200': + "200": description: Success. 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' + $ref: "#/components/schemas/TaskInstance" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/updateTaskInstancesState: parameters: - - $ref: '#/components/parameters/DAGID' + - $ref: "#/components/parameters/DAGID" post: summary: Set a state of task instances @@ -693,25 +693,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateTaskInstancesState' + $ref: "#/components/schemas/UpdateTaskInstancesState" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceReferenceCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/TaskInstanceReferenceCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns: parameters: - - $ref: '#/components/parameters/DAGID' + - $ref: "#/components/parameters/DAGID" get: summary: List DAG runs @@ -721,27 +721,27 @@ paths: operationId: get_dag_runs tags: [DAGRun] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/FilterExecutionDateGTE' - - $ref: '#/components/parameters/FilterExecutionDateLTE' - - $ref: '#/components/parameters/FilterStartDateGTE' - - $ref: '#/components/parameters/FilterStartDateLTE' - - $ref: '#/components/parameters/FilterEndDateGTE' - - $ref: '#/components/parameters/FilterEndDateLTE' - - $ref: '#/components/parameters/FilterUpdatedAtGTE' - - $ref: '#/components/parameters/FilterUpdatedAtLTE' - - $ref: '#/components/parameters/FilterState' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/FilterExecutionDateGTE" + - $ref: "#/components/parameters/FilterExecutionDateLTE" + - $ref: "#/components/parameters/FilterStartDateGTE" + - $ref: "#/components/parameters/FilterStartDateLTE" + - $ref: "#/components/parameters/FilterEndDateGTE" + - $ref: "#/components/parameters/FilterEndDateLTE" + - $ref: "#/components/parameters/FilterUpdatedAtGTE" + - $ref: "#/components/parameters/FilterUpdatedAtLTE" + - $ref: "#/components/parameters/FilterState" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: List of DAG runs. content: application/json: schema: - $ref: '#/components/schemas/DAGRunCollection' - '401': - $ref: '#/components/responses/Unauthenticated' + $ref: "#/components/schemas/DAGRunCollection" + "401": + $ref: "#/components/responses/Unauthenticated" post: summary: Trigger a new DAG run. @@ -756,24 +756,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DAGRun' + $ref: "#/components/schemas/DAGRun" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAGRun' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '409': - $ref: '#/components/responses/AlreadyExists' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DAGRun" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "409": + $ref: "#/components/responses/AlreadyExists" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/~/dagRuns/list: post: @@ -789,25 +789,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListDagRunsForm' + $ref: "#/components/schemas/ListDagRunsForm" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAGRunCollection' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/DAGRunCollection" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /dags/{dag_id}/dagRuns/{dag_run_id}: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" get: summary: Get a DAG run @@ -815,18 +815,18 @@ paths: operationId: get_dag_run tags: [DAGRun] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAGRun' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DAGRun" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" delete: summary: Delete a DAG run @@ -834,16 +834,16 @@ paths: operationId: delete_dag_run tags: [DAGRun] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: summary: Modify a DAG run @@ -859,28 +859,28 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateDagRunState' + $ref: "#/components/schemas/UpdateDagRunState" responses: - '200': + "200": description: Success. 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' + $ref: "#/components/schemas/DAGRun" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/clear: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" post: summary: Clear a DAG run @@ -896,30 +896,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ClearDagRun' + $ref: "#/components/schemas/ClearDagRun" responses: - '200': + "200": description: Success. content: application/json: schema: anyOf: - - $ref: '#/components/schemas/DAGRun' - - $ref: '#/components/schemas/TaskInstanceCollection' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + - $ref: "#/components/schemas/DAGRun" + - $ref: "#/components/schemas/TaskInstanceCollection" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" get: summary: Get dataset events for a DAG run description: | @@ -930,23 +930,23 @@ paths: operationId: get_upstream_dataset_events tags: [DAGRun, Dataset] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DatasetEventCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DatasetEventCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/setNote: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" patch: summary: Update the DagRun note. description: | @@ -962,57 +962,56 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SetDagRunNote' + $ref: "#/components/schemas/SetDagRunNote" responses: - '200': + "200": description: Success. 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' + $ref: "#/components/schemas/DAGRun" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /eventLogs: get: summary: List log entries - description: - List log entries from event log. + description: List log entries from event log. x-openapi-router-controller: airflow.api_connexion.endpoints.event_log_endpoint operationId: get_event_logs tags: [EventLog] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' - - $ref: '#/components/parameters/FilterDAGID' - - $ref: '#/components/parameters/FilterTaskID' - - $ref: '#/components/parameters/Event' - - $ref: '#/components/parameters/Owner' - - $ref: '#/components/parameters/Before' - - $ref: '#/components/parameters/After' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" + - $ref: "#/components/parameters/FilterDAGID" + - $ref: "#/components/parameters/FilterTaskID" + - $ref: "#/components/parameters/Event" + - $ref: "#/components/parameters/Owner" + - $ref: "#/components/parameters/Before" + - $ref: "#/components/parameters/After" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/EventLogCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/EventLogCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /eventLogs/{event_log_id}: parameters: - - $ref: '#/components/parameters/EventLogID' + - $ref: "#/components/parameters/EventLogID" get: summary: Get a log entry @@ -1020,18 +1019,18 @@ paths: operationId: get_event_log tags: [EventLog] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/EventLog' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/EventLog" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /importErrors: get: @@ -1040,43 +1039,43 @@ paths: operationId: get_import_errors tags: [ImportError] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/ImportErrorCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/ImportErrorCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /importErrors/{import_error_id}: parameters: - - $ref: '#/components/parameters/ImportErrorID' + - $ref: "#/components/parameters/ImportErrorID" get: summary: Get an import error x-openapi-router-controller: airflow.api_connexion.endpoints.import_error_endpoint operationId: get_import_error tags: [ImportError] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/ImportError' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/ImportError" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /pools: get: @@ -1085,20 +1084,20 @@ paths: operationId: get_pools tags: [Pool] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: List of pools. content: application/json: schema: - $ref: '#/components/schemas/PoolCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/PoolCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" post: summary: Create a pool @@ -1110,24 +1109,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Pool' + $ref: "#/components/schemas/Pool" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Pool' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $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' + - $ref: "#/components/parameters/PoolName" get: summary: Get a pool @@ -1135,18 +1134,18 @@ paths: operationId: get_pool tags: [Pool] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Pool' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/Pool" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: summary: Update a pool @@ -1154,31 +1153,31 @@ paths: operationId: patch_pool tags: [Pool] parameters: - - $ref: '#/components/parameters/UpdateMask' + - $ref: "#/components/parameters/UpdateMask" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/Pool' + $ref: "#/components/schemas/Pool" responses: - '200': + "200": description: Success. 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' - '409': - $ref: '#/components/responses/AlreadyExists' + $ref: "#/components/schemas/Pool" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" + "409": + $ref: "#/components/responses/AlreadyExists" delete: summary: Delete a pool @@ -1186,16 +1185,16 @@ paths: operationId: delete_pool tags: [Pool] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /providers: get: @@ -1208,36 +1207,36 @@ paths: operationId: get_providers tags: [Provider] responses: - '200': + "200": description: List of providers. content: application/json: schema: allOf: - - $ref: '#/components/schemas/ProviderCollection' - - $ref: '#/components/schemas/CollectionInfo' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + - $ref: "#/components/schemas/ProviderCollection" + - $ref: "#/components/schemas/CollectionInfo" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/FilterExecutionDateGTE' - - $ref: '#/components/parameters/FilterExecutionDateLTE' - - $ref: '#/components/parameters/FilterStartDateGTE' - - $ref: '#/components/parameters/FilterStartDateLTE' - - $ref: '#/components/parameters/FilterEndDateGTE' - - $ref: '#/components/parameters/FilterEndDateLTE' - - $ref: '#/components/parameters/FilterUpdatedAtGTE' - - $ref: '#/components/parameters/FilterUpdatedAtLTE' - - $ref: '#/components/parameters/FilterDurationGTE' - - $ref: '#/components/parameters/FilterDurationLTE' - - $ref: '#/components/parameters/FilterState' - - $ref: '#/components/parameters/FilterPool' - - $ref: '#/components/parameters/FilterQueue' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/FilterExecutionDateGTE" + - $ref: "#/components/parameters/FilterExecutionDateLTE" + - $ref: "#/components/parameters/FilterStartDateGTE" + - $ref: "#/components/parameters/FilterStartDateLTE" + - $ref: "#/components/parameters/FilterEndDateGTE" + - $ref: "#/components/parameters/FilterEndDateLTE" + - $ref: "#/components/parameters/FilterUpdatedAtGTE" + - $ref: "#/components/parameters/FilterUpdatedAtLTE" + - $ref: "#/components/parameters/FilterDurationGTE" + - $ref: "#/components/parameters/FilterDurationLTE" + - $ref: "#/components/parameters/FilterState" + - $ref: "#/components/parameters/FilterPool" + - $ref: "#/components/parameters/FilterQueue" get: summary: List task instances description: > @@ -1247,25 +1246,25 @@ paths: operationId: get_task_instances tags: [TaskInstance] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/TaskInstanceCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" get: summary: Get a task instance @@ -1273,18 +1272,18 @@ paths: operationId: get_task_instance tags: [TaskInstance] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstance' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/TaskInstance" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: summary: Updates the state of a task instance @@ -1301,28 +1300,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateTaskInstance' + $ref: "#/components/schemas/UpdateTaskInstance" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceReference' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' - + $ref: "#/components/schemas/TaskInstanceReference" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' - - $ref: '#/components/parameters/MapIndex' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" + - $ref: "#/components/parameters/MapIndex" get: summary: Get a mapped task instance @@ -1334,54 +1332,53 @@ paths: operationId: get_mapped_task_instance tags: [TaskInstance] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstance' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/TaskInstance" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: - summary: Updates the state of a mapped task instance - description: > - Updates the state for single mapped task instance. + summary: Updates the state of a mapped task instance + description: > + Updates the state for single mapped task instance. - *New in version 2.5.0* - x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - operationId: patch_mapped_task_instance - tags: [TaskInstance] - requestBody: - description: Parameters of action + *New in version 2.5.0* + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + operationId: patch_mapped_task_instance + tags: [TaskInstance] + requestBody: + description: Parameters of action + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateTaskInstance" + responses: + "200": + description: Success. content: application/json: schema: - $ref: '#/components/schemas/UpdateTaskInstance' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/TaskInstanceReference' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' - + $ref: "#/components/schemas/TaskInstanceReference" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" get: summary: List mapped task instances @@ -1393,35 +1390,35 @@ paths: operationId: get_mapped_task_instances tags: [TaskInstance] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/FilterExecutionDateGTE' - - $ref: '#/components/parameters/FilterExecutionDateLTE' - - $ref: '#/components/parameters/FilterStartDateGTE' - - $ref: '#/components/parameters/FilterStartDateLTE' - - $ref: '#/components/parameters/FilterEndDateGTE' - - $ref: '#/components/parameters/FilterEndDateLTE' - - $ref: '#/components/parameters/FilterUpdatedAtGTE' - - $ref: '#/components/parameters/FilterUpdatedAtLTE' - - $ref: '#/components/parameters/FilterDurationGTE' - - $ref: '#/components/parameters/FilterDurationLTE' - - $ref: '#/components/parameters/FilterState' - - $ref: '#/components/parameters/FilterPool' - - $ref: '#/components/parameters/FilterQueue' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/FilterExecutionDateGTE" + - $ref: "#/components/parameters/FilterExecutionDateLTE" + - $ref: "#/components/parameters/FilterStartDateGTE" + - $ref: "#/components/parameters/FilterStartDateLTE" + - $ref: "#/components/parameters/FilterEndDateGTE" + - $ref: "#/components/parameters/FilterEndDateLTE" + - $ref: "#/components/parameters/FilterUpdatedAtGTE" + - $ref: "#/components/parameters/FilterUpdatedAtLTE" + - $ref: "#/components/parameters/FilterDurationGTE" + - $ref: "#/components/parameters/FilterDurationLTE" + - $ref: "#/components/parameters/FilterState" + - $ref: "#/components/parameters/FilterPool" + - $ref: "#/components/parameters/FilterQueue" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/TaskInstanceCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/~/dagRuns/~/taskInstances/list: post: @@ -1439,21 +1436,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListTaskInstanceForm' + $ref: "#/components/schemas/ListTaskInstanceForm" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/TaskInstanceCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /variables: get: @@ -1463,20 +1460,20 @@ paths: operationId: get_variables tags: [Variable] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/VariableCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/VariableCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" post: summary: Create a variable @@ -1488,24 +1485,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Variable' + $ref: "#/components/schemas/Variable" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Variable' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/Variable" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /variables/{variable_key}: parameters: - - $ref: '#/components/parameters/VariableKey' + - $ref: "#/components/parameters/VariableKey" get: summary: Get a variable @@ -1514,18 +1511,18 @@ paths: operationId: get_variable tags: [Variable] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Variable' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/Variable" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: summary: Update a variable @@ -1534,29 +1531,29 @@ paths: operationId: patch_variable tags: [Variable] parameters: - - $ref: '#/components/parameters/UpdateMask' + - $ref: "#/components/parameters/UpdateMask" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/Variable' + $ref: "#/components/schemas/Variable" responses: - '200': + "200": description: Success. 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' + $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 @@ -1564,22 +1561,22 @@ paths: operationId: delete_variable tags: [Variable] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" get: summary: List XCom entries @@ -1591,28 +1588,28 @@ paths: operationId: get_xcom_entries tags: [XCom] parameters: - - $ref: '#/components/parameters/FilterMapIndex' - - $ref: '#/components/parameters/FilterXcomKey' - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' + - $ref: "#/components/parameters/FilterMapIndex" + - $ref: "#/components/parameters/FilterXcomKey" + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/XComCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}: - parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' - - $ref: '#/components/parameters/XComKey' + $ref: "#/components/schemas/XComCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + + ? /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key} + : parameters: + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" + - $ref: "#/components/parameters/XComKey" get: summary: Get an XCom entry @@ -1620,7 +1617,7 @@ paths: operationId: get_xcom_entry tags: [XCom] parameters: - - $ref: '#/components/parameters/FilterMapIndex' + - $ref: "#/components/parameters/FilterMapIndex" - in: query name: deserialize schema: @@ -1638,25 +1635,25 @@ paths: *New in version 2.4.0* responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/XCom' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/XCom" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" # Non-database resources /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" get: summary: List extra links @@ -1666,28 +1663,28 @@ paths: operationId: get_extra_links tags: [TaskInstance] responses: - '200': + "200": description: Success. 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}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number}: - parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/DAGRunID' - - $ref: '#/components/parameters/TaskID' - - $ref: '#/components/parameters/TaskTryNumber' - - $ref: '#/components/parameters/FullContent' - - $ref: '#/components/parameters/FilterMapIndex' - - $ref: '#/components/parameters/ContinuationToken' + $ref: "#/components/schemas/ExtraLinkCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" + + ? /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number} + : parameters: + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/DAGRunID" + - $ref: "#/components/parameters/TaskID" + - $ref: "#/components/parameters/TaskTryNumber" + - $ref: "#/components/parameters/FullContent" + - $ref: "#/components/parameters/FilterMapIndex" + - $ref: "#/components/parameters/ContinuationToken" get: summary: Get logs @@ -1723,7 +1720,7 @@ paths: operationId: get_log tags: [TaskInstance] responses: - '200': + "200": description: Success. content: application/json: @@ -1737,19 +1734,18 @@ paths: 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' - + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/details: parameters: - - $ref: '#/components/parameters/DAGID' + - $ref: "#/components/parameters/DAGID" get: summary: Get a simplified representation of DAG @@ -1760,23 +1756,23 @@ paths: If possible, consider using GET /dags/{dag_id}. tags: [DAG] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DAGDetail' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DAGDetail" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /dags/{dag_id}/tasks: parameters: - - $ref: '#/components/parameters/DAGID' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/OrderBy" get: summary: Get tasks for DAG @@ -1784,23 +1780,23 @@ paths: operationId: get_tasks tags: [DAG] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/TaskCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $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' + - $ref: "#/components/parameters/DAGID" + - $ref: "#/components/parameters/TaskID" get: summary: Get simplified representation of a task @@ -1808,22 +1804,22 @@ paths: operationId: get_task tags: [DAG] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Task' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $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' + - $ref: "#/components/parameters/FileToken" get: summary: Get a source code @@ -1833,7 +1829,7 @@ paths: operationId: get_dag_source tags: [DAG] responses: - '200': + "200": description: Success. content: application/json: @@ -1846,14 +1842,14 @@ paths: schema: type: string - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' - '406': - $ref: '#/components/responses/NotAcceptable' + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" + "406": + $ref: "#/components/responses/NotAcceptable" /dagWarnings: get: @@ -1874,21 +1870,21 @@ paths: type: string required: false description: If set, only return DAG warnings with this type. - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DagWarningCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/DagWarningCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /datasets: get: @@ -1897,9 +1893,9 @@ paths: operationId: get_datasets tags: [Dataset] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" - name: uri_pattern in: query schema: @@ -1908,20 +1904,20 @@ paths: description: | If set, only return datasets with uris matching this pattern. responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DatasetCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/DatasetCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /datasets/{uri}: parameters: - - $ref: '#/components/parameters/DatasetURI' + - $ref: "#/components/parameters/DatasetURI" get: summary: Get a dataset description: Get a dataset by uri. @@ -1929,29 +1925,29 @@ paths: operationId: get_dataset tags: [Dataset] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Dataset' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/Dataset" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /datasets/events: parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' - - $ref: '#/components/parameters/FilterDatasetID' - - $ref: '#/components/parameters/FilterSourceDAGID' - - $ref: '#/components/parameters/FilterSourceTaskID' - - $ref: '#/components/parameters/FilterSourceRunID' - - $ref: '#/components/parameters/FilterSourceMapIndex' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" + - $ref: "#/components/parameters/FilterDatasetID" + - $ref: "#/components/parameters/FilterSourceDAGID" + - $ref: "#/components/parameters/FilterSourceTaskID" + - $ref: "#/components/parameters/FilterSourceRunID" + - $ref: "#/components/parameters/FilterSourceMapIndex" get: summary: Get dataset events description: Get dataset events @@ -1959,18 +1955,18 @@ paths: operationId: get_dataset_events tags: [Dataset] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/DatasetEventCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/DatasetEventCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /config: get: @@ -1986,12 +1982,12 @@ paths: required: false description: If given, only return config of this section. responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Config' + $ref: "#/components/schemas/Config" example: sections: - name: core @@ -2015,12 +2011,12 @@ paths: smtp_host = localhost smtp_mail_from = airf...@example.com - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /config/section/{section}/option/{option}: get: @@ -2040,12 +2036,12 @@ paths: type: string required: true responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Config' + $ref: "#/components/schemas/Config" example: sections: - name: core @@ -2059,13 +2055,12 @@ paths: [core] dags_folder = /home/user/my-dags-folder - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' - + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /health: get: @@ -2077,12 +2072,12 @@ paths: operationId: get_health tags: [Monitoring] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/HealthInfo' + $ref: "#/components/schemas/HealthInfo" /version: get: @@ -2091,12 +2086,12 @@ paths: operationId: get_version tags: [Monitoring] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/VersionInfo' + $ref: "#/components/schemas/VersionInfo" /plugins: get: @@ -2109,21 +2104,21 @@ paths: operationId: get_plugins tags: [Plugin] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" responses: - '200': + "200": description: Success content: application/json: schema: - $ref: '#/components/schemas/PluginCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/PluginCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /roles: get: @@ -2137,20 +2132,20 @@ paths: operationId: get_roles tags: [Role] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/RoleCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/RoleCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" post: deprecated: true @@ -2167,24 +2162,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Role' + $ref: "#/components/schemas/Role" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Role' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/Role" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /roles/{role_name}: parameters: - - $ref: '#/components/parameters/RoleName' + - $ref: "#/components/parameters/RoleName" get: deprecated: true @@ -2197,18 +2192,18 @@ paths: operationId: get_role tags: [Role] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Role' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/Role" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: deprecated: true @@ -2221,29 +2216,29 @@ paths: operationId: patch_role tags: [Role] parameters: - - $ref: '#/components/parameters/UpdateMask' + - $ref: "#/components/parameters/UpdateMask" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/Role' + $ref: "#/components/schemas/Role" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/Role' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/Role" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" delete: deprecated: true @@ -2256,16 +2251,16 @@ paths: operationId: delete_role tags: [Role] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" /permissions: get: @@ -2279,19 +2274,19 @@ paths: operationId: get_permissions tags: [Permission] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/ActionCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/ActionCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" /users: get: @@ -2305,20 +2300,20 @@ paths: operationId: get_users tags: [User] parameters: - - $ref: '#/components/parameters/PageLimit' - - $ref: '#/components/parameters/PageOffset' - - $ref: '#/components/parameters/OrderBy' + - $ref: "#/components/parameters/PageLimit" + - $ref: "#/components/parameters/PageOffset" + - $ref: "#/components/parameters/OrderBy" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/UserCollection' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' + $ref: "#/components/schemas/UserCollection" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" post: deprecated: true @@ -2335,26 +2330,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/User' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '409': - $ref: '#/components/responses/AlreadyExists' + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "409": + $ref: "#/components/responses/AlreadyExists" /users/{username}: parameters: - - $ref: '#/components/parameters/Username' + - $ref: "#/components/parameters/Username" get: deprecated: true summary: Get a user @@ -2366,18 +2361,18 @@ paths: operationId: get_user tags: [User] responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/UserCollectionItem' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/UserCollectionItem" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" patch: deprecated: true @@ -2390,28 +2385,28 @@ paths: operationId: patch_user tags: [User] parameters: - - $ref: '#/components/parameters/UpdateMask' + - $ref: "#/components/parameters/UpdateMask" requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" responses: - '200': + "200": description: Success. content: application/json: schema: - $ref: '#/components/schemas/UserCollectionItem' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + $ref: "#/components/schemas/UserCollectionItem" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" delete: deprecated: true @@ -2424,16 +2419,16 @@ paths: operationId: delete_user tags: [User] responses: - '204': + "204": description: Success. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthenticated' - '403': - $ref: '#/components/responses/PermissionDenied' - '404': - $ref: '#/components/responses/NotFound' + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthenticated" + "403": + $ref: "#/components/responses/PermissionDenied" + "404": + $ref: "#/components/responses/NotFound" components: # Reusable schemas (data models) @@ -2524,7 +2519,7 @@ components: *New in version 2.1.0* allOf: - - $ref: '#/components/schemas/UserCollectionItem' + - $ref: "#/components/schemas/UserCollectionItem" - type: object properties: password: @@ -2543,8 +2538,8 @@ components: users: type: array items: - $ref: '#/components/schemas/UserCollectionItem' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/UserCollectionItem" + - $ref: "#/components/schemas/CollectionInfo" ConnectionCollectionItem: description: > @@ -2593,13 +2588,13 @@ components: connections: type: array items: - $ref: '#/components/schemas/ConnectionCollectionItem' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/ConnectionCollectionItem" + - $ref: "#/components/schemas/CollectionInfo" Connection: description: Full representation of the connection. allOf: - - $ref: '#/components/schemas/ConnectionCollectionItem' + - $ref: "#/components/schemas/ConnectionCollectionItem" - type: object properties: password: @@ -2733,7 +2728,7 @@ components: User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. schedule_interval: - $ref: '#/components/schemas/ScheduleInterval' + $ref: "#/components/schemas/ScheduleInterval" timetable_description: type: string readOnly: true @@ -2747,7 +2742,7 @@ components: type: array nullable: true items: - $ref: '#/components/schemas/Tag' + $ref: "#/components/schemas/Tag" readOnly: true max_active_tasks: type: integer @@ -2830,8 +2825,8 @@ components: dags: type: array items: - $ref: '#/components/schemas/DAG' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/DAG" + - $ref: "#/components/schemas/CollectionInfo" DAGRun: type: object @@ -2918,7 +2913,7 @@ components: - scheduled - dataset_triggered state: - $ref: '#/components/schemas/DagState' + $ref: "#/components/schemas/DagState" external_trigger: type: boolean readOnly: true @@ -2964,8 +2959,8 @@ components: dag_runs: type: array items: - $ref: '#/components/schemas/DAGRun' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/DAGRun" + - $ref: "#/components/schemas/CollectionInfo" DagWarning: type: object @@ -2999,8 +2994,8 @@ components: import_errors: type: array items: - $ref: '#/components/schemas/DagWarning' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/DagWarning" + - $ref: "#/components/schemas/CollectionInfo" SetDagRunNote: type: object @@ -3066,8 +3061,8 @@ components: event_logs: type: array items: - $ref: '#/components/schemas/EventLog' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/EventLog" + - $ref: "#/components/schemas/CollectionInfo" ImportError: type: object @@ -3102,35 +3097,35 @@ components: import_errors: type: array items: - $ref: '#/components/schemas/ImportError' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/ImportError" + - $ref: "#/components/schemas/CollectionInfo" HealthInfo: type: object description: Instance status information. properties: metadatabase: - $ref: '#/components/schemas/MetadatabaseStatus' + $ref: "#/components/schemas/MetadatabaseStatus" scheduler: - $ref: '#/components/schemas/SchedulerStatus' + $ref: "#/components/schemas/SchedulerStatus" triggerer: - $ref: '#/components/schemas/TriggererStatus' + $ref: "#/components/schemas/TriggererStatus" dag_processor: - $ref: '#/components/schemas/DagProcessorStatus' + $ref: "#/components/schemas/DagProcessorStatus" MetadatabaseStatus: type: object description: The status of the metadatabase. properties: status: - $ref: '#/components/schemas/HealthStatus' + $ref: "#/components/schemas/HealthStatus" SchedulerStatus: type: object description: The status and the latest scheduler heartbeat. properties: status: - $ref: '#/components/schemas/HealthStatus' + $ref: "#/components/schemas/HealthStatus" latest_scheduler_heartbeat: description: The time the scheduler last did a heartbeat. type: string @@ -3146,7 +3141,7 @@ components: *New in version 2.6.2* properties: status: - $ref: '#/components/schemas/HealthStatus' + $ref: "#/components/schemas/HealthStatus" latest_triggerer_heartbeat: description: The time the triggerer last did a heartbeat. type: string @@ -3162,7 +3157,7 @@ components: *New in version 2.6.3* properties: status: - $ref: '#/components/schemas/HealthStatus' + $ref: "#/components/schemas/HealthStatus" latest_dag_processor_heartbeat: description: The time the dag processor last did a heartbeat. type: string @@ -3234,9 +3229,8 @@ components: pools: type: array items: - $ref: '#/components/schemas/Pool' - - $ref: '#/components/schemas/CollectionInfo' - + $ref: "#/components/schemas/Pool" + - $ref: "#/components/schemas/CollectionInfo" Provider: description: | @@ -3265,7 +3259,7 @@ components: providers: type: array items: - $ref: '#/components/schemas/Provider' + $ref: "#/components/schemas/Provider" SLAMiss: type: object @@ -3374,7 +3368,7 @@ components: type: number nullable: true state: - $ref: '#/components/schemas/TaskState' + $ref: "#/components/schemas/TaskState" try_number: type: integer map_index: @@ -3409,7 +3403,7 @@ components: executor_config: type: string sla_miss: - $ref: '#/components/schemas/SLAMiss' + $ref: "#/components/schemas/SLAMiss" rendered_fields: description: | JSON object describing rendered fields. @@ -3417,9 +3411,9 @@ components: *New in version 2.3.0* type: object trigger: - $ref: '#/components/schemas/Trigger' + $ref: "#/components/schemas/Trigger" triggerer_job: - $ref: '#/components/schemas/Job' + $ref: "#/components/schemas/Job" note: type: string description: | @@ -3440,8 +3434,8 @@ components: task_instances: type: array items: - $ref: '#/components/schemas/TaskInstance' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/TaskInstance" + - $ref: "#/components/schemas/CollectionInfo" TaskInstanceReference: type: object @@ -3469,11 +3463,10 @@ components: task_instances: type: array items: - $ref: '#/components/schemas/TaskInstanceReference' + $ref: "#/components/schemas/TaskInstanceReference" VariableCollectionItem: - description: - XCom entry collection item. + description: XCom entry collection item. The value field are only available when retrieving a single object due to the sensitivity of this data. @@ -3502,13 +3495,13 @@ components: variables: type: array items: - $ref: '#/components/schemas/VariableCollectionItem' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/VariableCollectionItem" + - $ref: "#/components/schemas/CollectionInfo" Variable: description: Full representation of Variable allOf: - - $ref: '#/components/schemas/VariableCollectionItem' + - $ref: "#/components/schemas/VariableCollectionItem" - type: object properties: value: @@ -3549,13 +3542,13 @@ components: xcom_entries: type: array items: - $ref: '#/components/schemas/XComCollectionItem' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/XComCollectionItem" + - $ref: "#/components/schemas/CollectionInfo" XCom: description: Full representations of XCom entry. allOf: - - $ref: '#/components/schemas/XComCollectionItem' + - $ref: "#/components/schemas/XComCollectionItem" - type: object properties: value: @@ -3573,11 +3566,11 @@ components: For details see: [airflow.models.dag.DAG](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/dag/index.html#airflow.models.dag.DAG) allOf: - - $ref: '#/components/schemas/DAG' + - $ref: "#/components/schemas/DAG" - type: object properties: timezone: - $ref: '#/components/schemas/Timezone' + $ref: "#/components/schemas/Timezone" catchup: type: boolean readOnly: true @@ -3589,7 +3582,7 @@ components: readOnly: true start_date: type: string - format: 'date-time' + format: "date-time" readOnly: true nullable: true description: | @@ -3597,7 +3590,7 @@ components: *Changed in version 2.0.1*: Field becomes nullable. dag_run_timeout: - $ref: '#/components/schemas/TimeDelta' + $ref: "#/components/schemas/TimeDelta" doc_md: type: string readOnly: true @@ -3605,6 +3598,7 @@ components: default_view: type: string readOnly: true + nullable: true params: type: object readOnly: true @@ -3614,7 +3608,7 @@ components: *New in version 2.0.1* end_date: type: string - format: 'date-time' + format: "date-time" readOnly: true nullable: true description: | @@ -3660,7 +3654,7 @@ components: description: Additional links containing additional information about the task. properties: class_ref: - $ref: '#/components/schemas/ClassReference' + $ref: "#/components/schemas/ClassReference" name: type: string readOnly: true @@ -3675,7 +3669,7 @@ components: extra_links: type: array items: - $ref: '#/components/schemas/ExtraLink' + $ref: "#/components/schemas/ExtraLink" Task: type: object @@ -3684,7 +3678,7 @@ components: [airflow.models.baseoperator.BaseOperator](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/baseoperator/index.html#airflow.models.baseoperator.BaseOperator) properties: class_ref: - $ref: '#/components/schemas/ClassReference' + $ref: "#/components/schemas/ClassReference" task_id: type: string readOnly: true @@ -3693,15 +3687,15 @@ components: readOnly: true start_date: type: string - format: 'date-time' + format: "date-time" readOnly: true end_date: type: string - format: 'date-time' + format: "date-time" readOnly: true nullable: true trigger_rule: - $ref: '#/components/schemas/TriggerRule' + $ref: "#/components/schemas/TriggerRule" extra_links: type: array readOnly: true @@ -3709,7 +3703,7 @@ components: type: object properties: class_ref: - $ref: '#/components/schemas/ClassReference' + $ref: "#/components/schemas/ClassReference" depends_on_past: type: boolean readOnly: true @@ -3733,9 +3727,9 @@ components: type: number readOnly: true execution_timeout: - $ref: '#/components/schemas/TimeDelta' + $ref: "#/components/schemas/TimeDelta" retry_delay: - $ref: '#/components/schemas/TimeDelta' + $ref: "#/components/schemas/TimeDelta" retry_exponential_backoff: type: boolean readOnly: true @@ -3743,18 +3737,18 @@ components: type: number readOnly: true weight_rule: - $ref: '#/components/schemas/WeightRule' + $ref: "#/components/schemas/WeightRule" ui_color: - $ref: '#/components/schemas/Color' + $ref: "#/components/schemas/Color" ui_fgcolor: - $ref: '#/components/schemas/Color' + $ref: "#/components/schemas/Color" template_fields: type: array readOnly: true items: type: string sub_dag: - $ref: '#/components/schemas/DAG' + $ref: "#/components/schemas/DAG" downstream_task_ids: type: array readOnly: true @@ -3768,7 +3762,7 @@ components: tasks: type: array items: - $ref: '#/components/schemas/Task' + $ref: "#/components/schemas/Task" # Plugin PluginCollectionItem: @@ -3861,8 +3855,8 @@ components: plugins: type: array items: - $ref: '#/components/schemas/PluginCollectionItem' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/PluginCollectionItem" + - $ref: "#/components/schemas/CollectionInfo" Role: description: | @@ -3881,7 +3875,7 @@ components: actions: type: array items: - $ref: '#/components/schemas/ActionResource' + $ref: "#/components/schemas/ActionResource" RoleCollection: description: | @@ -3895,8 +3889,8 @@ components: roles: type: array items: - $ref: '#/components/schemas/Role' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/Role" + - $ref: "#/components/schemas/CollectionInfo" Action: description: | @@ -3922,8 +3916,8 @@ components: actions: type: array items: - $ref: '#/components/schemas/Action' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/Action" + - $ref: "#/components/schemas/CollectionInfo" Resource: description: | @@ -3946,11 +3940,11 @@ components: properties: action: type: object - $ref: '#/components/schemas/Action' + $ref: "#/components/schemas/Action" description: The permission action resource: type: object - $ref: '#/components/schemas/Resource' + $ref: "#/components/schemas/Resource" description: The permission resource Dataset: @@ -3980,14 +3974,13 @@ components: description: The dataset update time nullable: false consuming_dags: - type: array - items: - $ref: '#/components/schemas/DagScheduleDatasetReference' + type: array + items: + $ref: "#/components/schemas/DagScheduleDatasetReference" producing_tasks: - type: array - items: - $ref: '#/components/schemas/TaskOutletDatasetReference' - + type: array + items: + $ref: "#/components/schemas/TaskOutletDatasetReference" TaskOutletDatasetReference: description: | @@ -4045,8 +4038,8 @@ components: datasets: type: array items: - $ref: '#/components/schemas/Dataset' - - $ref: '#/components/schemas/CollectionInfo' + $ref: "#/components/schemas/Dataset" + - $ref: "#/components/schemas/CollectionInfo" DatasetEvent: description: | @@ -4083,9 +4076,9 @@ components: description: The task map index that updated the dataset. nullable: true created_dagruns: - type: array - items: - $ref: '#/components/schemas/BasicDAGRun' + type: array + items: + $ref: "#/components/schemas/BasicDAGRun" timestamp: type: string description: The dataset event creation time @@ -4139,7 +4132,7 @@ components: readOnly: true nullable: true state: - $ref: '#/components/schemas/DagState' + $ref: "#/components/schemas/DagState" DatasetEventCollection: description: | @@ -4153,9 +4146,8 @@ components: dataset_events: type: array items: - $ref: '#/components/schemas/DatasetEvent' - - $ref: '#/components/schemas/CollectionInfo' - + $ref: "#/components/schemas/DatasetEvent" + - $ref: "#/components/schemas/CollectionInfo" # Configuration ConfigOption: @@ -4179,7 +4171,7 @@ components: options: type: array items: - $ref: '#/components/schemas/ConfigOption' + $ref: "#/components/schemas/ConfigOption" Config: type: object @@ -4188,7 +4180,7 @@ components: sections: type: array items: - $ref: '#/components/schemas/ConfigSection' + $ref: "#/components/schemas/ConfigSection" VersionInfo: type: object @@ -4267,7 +4259,7 @@ components: dag_run_id: type: string - description: The DagRun ID for this task instance + description: The DagRun ID for this task instance nullable: true include_upstream: @@ -4333,7 +4325,7 @@ components: type: boolean new_state: - $ref: '#/components/schemas/UpdateTaskState' + $ref: "#/components/schemas/UpdateTaskState" UpdateTaskInstance: type: object @@ -4346,7 +4338,7 @@ components: default: true new_state: - $ref: '#/components/schemas/UpdateTaskState' + $ref: "#/components/schemas/UpdateTaskState" SetTaskInstanceNote: type: object @@ -4382,8 +4374,7 @@ components: type: array items: type: string - description: - Return objects with specific DAG IDs. + description: Return objects with specific DAG IDs. The value can be repeated to retrieve multiple matching values (OR condition). @@ -4391,8 +4382,7 @@ components: type: array items: type: string - description: - Return objects with specific states. + description: Return objects with specific states. The value can be repeated to retrieve multiple matching values (OR condition). @@ -4450,16 +4440,14 @@ components: type: array items: type: string - description: - Return objects with specific DAG IDs. + description: Return objects with specific DAG IDs. The value can be repeated to retrieve multiple matching values (OR condition). dag_run_ids: type: array items: type: string - description: - Return objects with specific DAG Run IDs. + description: Return objects with specific DAG Run IDs. The value can be repeated to retrieve multiple matching values (OR condition). @@ -4468,8 +4456,7 @@ components: type: array items: type: string - description: - Return objects with specific task IDs. + description: Return objects with specific task IDs. The value can be repeated to retrieve multiple matching values (OR condition). @@ -4531,21 +4518,18 @@ components: state: type: array items: - $ref: '#/components/schemas/TaskState' - description: - The value can be repeated to retrieve multiple matching values (OR condition). + $ref: "#/components/schemas/TaskState" + description: The value can be repeated to retrieve multiple matching values (OR condition). pool: type: array items: type: string - description: - The value can be repeated to retrieve multiple matching values (OR condition). + description: The value can be repeated to retrieve multiple matching values (OR condition). queue: type: array items: type: string - description: - The value can be repeated to retrieve multiple matching values (OR condition). + description: The value can be repeated to retrieve multiple matching values (OR condition). # Common data type ScheduleInterval: @@ -4555,9 +4539,9 @@ components: nullable: true readOnly: true anyOf: - - $ref: '#/components/schemas/TimeDelta' - - $ref: '#/components/schemas/RelativeDelta' - - $ref: '#/components/schemas/CronExpression' + - $ref: "#/components/schemas/TimeDelta" + - $ref: "#/components/schemas/RelativeDelta" + - $ref: "#/components/schemas/CronExpression" discriminator: propertyName: __type @@ -4571,10 +4555,10 @@ components: - seconds - microseconds properties: - __type: {type: string} - days: {type: integer} - seconds: {type: integer} - microseconds: {type: integer} + __type: { type: string } + days: { type: integer } + seconds: { type: integer } + microseconds: { type: integer } RelativeDelta: description: Relative delta @@ -4598,22 +4582,22 @@ components: - second - microsecond properties: - __type: {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} + __type: { 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: description: Cron expression @@ -4622,8 +4606,8 @@ components: - __type - value properties: - __type: {type: string} - value: {type: string} + __type: { type: string } + value: { type: string } nullable: true Timezone: @@ -4727,7 +4711,6 @@ components: - removed - restarting - UpdateTaskState: description: | Expected new state. Only a subset of TaskState are available. @@ -5085,8 +5068,7 @@ components: items: type: string required: false - description: - The value can be repeated to retrieve multiple matching values (OR condition). + description: The value can be repeated to retrieve multiple matching values (OR condition). FilterPool: in: query name: pool @@ -5095,8 +5077,7 @@ components: items: type: string required: false - description: - The value can be repeated to retrieve multiple matching values (OR condition). + description: The value can be repeated to retrieve multiple matching values (OR condition). FilterQueue: in: query name: queue @@ -5104,8 +5085,7 @@ components: type: array items: type: string - description: - The value can be repeated to retrieve multiple matching values (OR condition). + description: The value can be repeated to retrieve multiple matching values (OR condition). FilterTags: in: query @@ -5115,9 +5095,9 @@ components: items: type: string description: | - List of tags to filter results. + List of tags to filter results. - *New in version 2.2.0* + *New in version 2.2.0* FilterDatasetID: in: query @@ -5279,61 +5259,61 @@ components: # Reusable responses, such as 401 Unauthenticated or 400 Bad Request responses: # 400 - 'BadRequest': + "BadRequest": description: Client specified an invalid argument. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 401 - 'Unauthenticated': + "Unauthenticated": description: Request not authenticated due to missing, invalid, authentication info. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 403 - 'PermissionDenied': + "PermissionDenied": description: Client does not have sufficient permission. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 404 - 'NotFound': + "NotFound": description: A specified resource is not found. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 405 - 'MethodNotAllowed': + "MethodNotAllowed": description: Request method is known by the server but is not supported by the target resource. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 406 - 'NotAcceptable': + "NotAcceptable": description: A specified Accept header is not allowed. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 409 - 'AlreadyExists': + "AlreadyExists": description: An existing resource conflicts with the request. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # 500 - 'Unknown': + "Unknown": description: Unknown server error. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: "#/components/schemas/Error" # Reusable response headers headers: {} diff --git a/airflow/api_connexion/schemas/dag_schema.py b/airflow/api_connexion/schemas/dag_schema.py index a0d0b11fa6..c771aca73d 100644 --- a/airflow/api_connexion/schemas/dag_schema.py +++ b/airflow/api_connexion/schemas/dag_schema.py @@ -109,7 +109,7 @@ class DAGDetailSchema(DAGSchema): is_active = fields.Method("get_is_active", dump_only=True) is_paused_upon_creation = fields.Boolean() end_date = fields.DateTime(dump_only=True) - template_search_path = fields.String(dump_only=True) + template_searchpath = fields.String(dump_only=True) render_template_as_native_obj = fields.Boolean(dump_only=True) last_loaded = fields.DateTime(dump_only=True, data_key="last_parsed") diff --git a/airflow/models/dag.py b/airflow/models/dag.py index 428f79e14e..26c83754a8 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -3609,6 +3609,10 @@ class DagModel(Base): """Provide interface compatibility to 'DAG'.""" return self.is_paused + def get_is_active(self, *, session: Session | None = None) -> bool: + """Provide interface compatibility to 'DAG'.""" + return self.is_active + @staticmethod @internal_api_call @provide_session diff --git a/airflow/www/static/js/types/api-generated.ts b/airflow/www/static/js/types/api-generated.ts index 607a173a6b..55ade6179d 100644 --- a/airflow/www/static/js/types/api-generated.ts +++ b/airflow/www/static/js/types/api-generated.ts @@ -1483,7 +1483,7 @@ export interface components { start_date?: string | null; dag_run_timeout?: components["schemas"]["TimeDelta"]; doc_md?: string | null; - default_view?: string; + default_view?: string | null; /** * @description User-specified DAG params. * diff --git a/tests/api_connexion/endpoints/test_dag_endpoint.py b/tests/api_connexion/endpoints/test_dag_endpoint.py index ef9f7d7519..c02e8b0ff3 100644 --- a/tests/api_connexion/endpoints/test_dag_endpoint.py +++ b/tests/api_connexion/endpoints/test_dag_endpoint.py @@ -131,6 +131,17 @@ class TestDagEndpoint: ) session.add(dag_model) + @provide_session + def _create_dag_model_for_details_endpoint(self, dag_id, session=None): + dag_model = DagModel( + dag_id=dag_id, + fileloc="/tmp/dag.py", + schedule_interval="2 2 * * *", + is_active=True, + is_paused=False, + ) + session.add(dag_model) + @provide_session def _create_deactivated_dag(self, session=None): dag_model = DagModel( @@ -251,7 +262,9 @@ class TestGetDag(TestDagEndpoint): class TestGetDagDetails(TestDagEndpoint): - def test_should_respond_200(self, current_file_token): + def test_should_respond_200(self, url_safe_serializer): + self._create_dag_model_for_details_endpoint(self.dag_id) + current_file_token = url_safe_serializer.dumps("/tmp/dag.py") response = self.client.get( f"/api/v1/dags/{self.dag_id}/details", environ_overrides={"REMOTE_USER": "test"} ) @@ -260,46 +273,56 @@ class TestGetDagDetails(TestDagEndpoint): expected = { "catchup": True, "concurrency": 16, - "max_active_tasks": 16, "dag_id": "test_dag", "dag_run_timeout": None, - "default_view": "grid", + "default_view": None, "description": None, "doc_md": "details", - "fileloc": __file__, + "end_date": None, + "fileloc": "/tmp/dag.py", "file_token": current_file_token, - "is_paused": None, - "is_active": None, + "has_import_errors": False, + "has_task_concurrency_limits": True, + "is_active": True, + "is_paused": False, + "is_paused_upon_creation": None, "is_subdag": False, + "last_expired": None, + "last_parsed": last_parsed, + "last_parsed_time": None, + "last_pickled": None, + "max_active_runs": 16, + "max_active_tasks": 16, + "next_dagrun": None, + "next_dagrun_create_after": None, + "next_dagrun_data_interval_end": None, + "next_dagrun_data_interval_start": None, "orientation": "LR", - "owners": ["airflow"], + "owners": [], "params": { "foo": { "__class": "airflow.models.param.Param", - "value": 1, "description": None, "schema": {}, + "value": 1, } }, - "schedule_interval": { - "__type": "TimeDelta", - "days": 1, - "microseconds": 0, - "seconds": 0, - }, - "start_date": "2020-06-15T00:00:00+00:00", - "tags": [{"name": "example"}], - "timezone": "Timezone('UTC')", - "max_active_runs": 16, "pickle_id": None, - "end_date": None, - "is_paused_upon_creation": None, - "last_parsed": last_parsed, "render_template_as_native_obj": False, + "root_dag_id": None, + "schedule_interval": {"__type": "CronExpression", "value": "2 2 * * *"}, + "scheduler_lock": None, + "start_date": "2020-06-15T00:00:00+00:00", + "tags": [], + "template_searchpath": None, + "timetable_description": None, + "timezone": "Timezone('UTC')", } assert response.json == expected - def test_should_response_200_with_doc_md_none(self, current_file_token): + def test_should_response_200_with_doc_md_none(self, url_safe_serializer): + current_file_token = url_safe_serializer.dumps("/tmp/dag.py") + self._create_dag_model_for_details_endpoint(self.dag2_id) response = self.client.get( f"/api/v1/dags/{self.dag2_id}/details", environ_overrides={"REMOTE_USER": "test"} ) @@ -308,39 +331,49 @@ class TestGetDagDetails(TestDagEndpoint): expected = { "catchup": True, "concurrency": 16, - "max_active_tasks": 16, "dag_id": "test_dag2", "dag_run_timeout": None, - "default_view": "grid", + "default_view": None, "description": None, "doc_md": None, - "fileloc": __file__, + "end_date": None, + "fileloc": "/tmp/dag.py", "file_token": current_file_token, - "is_paused": None, - "is_active": None, + "has_import_errors": False, + "has_task_concurrency_limits": True, + "is_active": True, + "is_paused": False, + "is_paused_upon_creation": None, "is_subdag": False, + "last_expired": None, + "last_parsed": last_parsed, + "last_parsed_time": None, + "last_pickled": None, + "max_active_runs": 16, + "max_active_tasks": 16, + "next_dagrun": None, + "next_dagrun_create_after": None, + "next_dagrun_data_interval_end": None, + "next_dagrun_data_interval_start": None, "orientation": "LR", - "owners": ["airflow"], + "owners": [], "params": {}, - "schedule_interval": { - "__type": "TimeDelta", - "days": 1, - "microseconds": 0, - "seconds": 0, - }, + "pickle_id": None, + "render_template_as_native_obj": False, + "root_dag_id": None, + "schedule_interval": {"__type": "CronExpression", "value": "2 2 * * *"}, + "scheduler_lock": None, "start_date": "2020-06-15T00:00:00+00:00", "tags": [], + "template_searchpath": None, + "timetable_description": None, "timezone": "Timezone('UTC')", - "max_active_runs": 16, - "pickle_id": None, - "end_date": None, - "is_paused_upon_creation": None, - "last_parsed": last_parsed, - "render_template_as_native_obj": False, } assert response.json == expected - def test_should_response_200_for_null_start_date(self, current_file_token): + def test_should_response_200_for_null_start_date(self, url_safe_serializer): + current_file_token = url_safe_serializer.dumps("/tmp/dag.py") + self._create_dag_model_for_details_endpoint(self.dag3_id) response = self.client.get( f"/api/v1/dags/{self.dag3_id}/details", environ_overrides={"REMOTE_USER": "test"} ) @@ -349,39 +382,49 @@ class TestGetDagDetails(TestDagEndpoint): expected = { "catchup": True, "concurrency": 16, - "max_active_tasks": 16, "dag_id": "test_dag3", "dag_run_timeout": None, - "default_view": "grid", + "default_view": None, "description": None, "doc_md": None, - "fileloc": __file__, + "end_date": None, + "fileloc": "/tmp/dag.py", "file_token": current_file_token, - "is_paused": None, - "is_active": None, + "has_import_errors": False, + "has_task_concurrency_limits": True, + "is_active": True, + "is_paused": False, + "is_paused_upon_creation": None, "is_subdag": False, + "last_expired": None, + "last_parsed": last_parsed, + "last_parsed_time": None, + "last_pickled": None, + "max_active_runs": 16, + "max_active_tasks": 16, + "next_dagrun": None, + "next_dagrun_create_after": None, + "next_dagrun_data_interval_end": None, + "next_dagrun_data_interval_start": None, "orientation": "LR", - "owners": ["airflow"], + "owners": [], "params": {}, - "schedule_interval": { - "__type": "TimeDelta", - "days": 1, - "microseconds": 0, - "seconds": 0, - }, + "pickle_id": None, + "render_template_as_native_obj": False, + "root_dag_id": None, + "schedule_interval": {"__type": "CronExpression", "value": "2 2 * * *"}, + "scheduler_lock": None, "start_date": None, "tags": [], + "template_searchpath": None, + "timetable_description": None, "timezone": "Timezone('UTC')", - "max_active_runs": 16, - "pickle_id": None, - "end_date": None, - "is_paused_upon_creation": None, - "last_parsed": last_parsed, - "render_template_as_native_obj": False, } assert response.json == expected - def test_should_respond_200_serialized(self, current_file_token): + def test_should_respond_200_serialized(self, url_safe_serializer): + current_file_token = url_safe_serializer.dumps("/tmp/dag.py") + self._create_dag_model_for_details_endpoint(self.dag_id) # Get the dag out of the dagbag before we patch it to an empty one SerializedDagModel.write_dag(self.app.dag_bag.get_dag(self.dag_id)) @@ -393,41 +436,49 @@ class TestGetDagDetails(TestDagEndpoint): expected = { "catchup": True, "concurrency": 16, - "max_active_tasks": 16, "dag_id": "test_dag", "dag_run_timeout": None, - "default_view": "grid", + "default_view": None, "description": None, "doc_md": "details", - "fileloc": __file__, + "end_date": None, "file_token": current_file_token, - "is_paused": None, - "is_active": None, + "fileloc": "/tmp/dag.py", + "has_import_errors": False, + "has_task_concurrency_limits": True, + "is_active": True, + "is_paused": False, + "is_paused_upon_creation": None, "is_subdag": False, + "last_expired": None, + "last_parsed_time": None, + "last_pickled": None, + "max_active_runs": 16, + "max_active_tasks": 16, + "next_dagrun": None, + "next_dagrun_create_after": None, + "next_dagrun_data_interval_end": None, + "next_dagrun_data_interval_start": None, "orientation": "LR", - "owners": ["airflow"], + "owners": [], "params": { "foo": { "__class": "airflow.models.param.Param", - "value": 1, "description": None, "schema": {}, + "value": 1, } }, - "schedule_interval": { - "__type": "TimeDelta", - "days": 1, - "microseconds": 0, - "seconds": 0, - }, - "start_date": "2020-06-15T00:00:00+00:00", - "tags": [{"name": "example"}], - "timezone": "Timezone('UTC')", - "max_active_runs": 16, "pickle_id": None, - "end_date": None, - "is_paused_upon_creation": None, "render_template_as_native_obj": False, + "root_dag_id": None, + "schedule_interval": {"__type": "CronExpression", "value": "2 2 * * *"}, + "scheduler_lock": None, + "start_date": "2020-06-15T00:00:00+00:00", + "tags": [], + "template_searchpath": None, + "timetable_description": None, + "timezone": "Timezone('UTC')", } response = self.client.get( f"/api/v1/dags/{self.dag_id}/details", environ_overrides={"REMOTE_USER": "test"} @@ -435,7 +486,6 @@ class TestGetDagDetails(TestDagEndpoint): assert response.status_code == 200 expected.update({"last_parsed": response.json["last_parsed"]}) - assert response.json == expected patcher.stop() @@ -447,36 +497,49 @@ class TestGetDagDetails(TestDagEndpoint): expected = { "catchup": True, "concurrency": 16, - "max_active_tasks": 16, "dag_id": "test_dag", "dag_run_timeout": None, - "default_view": "grid", + "default_view": None, "description": None, "doc_md": "details", - "fileloc": __file__, + "end_date": None, "file_token": current_file_token, - "is_paused": None, - "is_active": None, + "fileloc": "/tmp/dag.py", + "has_import_errors": False, + "has_task_concurrency_limits": True, + "is_active": True, + "is_paused": False, + "is_paused_upon_creation": None, "is_subdag": False, + "last_expired": None, + "last_parsed_time": None, + "last_pickled": None, + "max_active_runs": 16, + "max_active_tasks": 16, + "next_dagrun": None, + "next_dagrun_create_after": None, + "next_dagrun_data_interval_end": None, + "next_dagrun_data_interval_start": None, "orientation": "LR", - "owners": ["airflow"], + "owners": [], "params": { "foo": { "__class": "airflow.models.param.Param", - "value": 1, "description": None, "schema": {}, + "value": 1, } }, - "schedule_interval": {"__type": "TimeDelta", "days": 1, "microseconds": 0, "seconds": 0}, - "start_date": "2020-06-15T00:00:00+00:00", - "tags": [{"name": "example"}], - "timezone": "Timezone('UTC')", - "max_active_runs": 16, "pickle_id": None, - "end_date": None, - "is_paused_upon_creation": None, "render_template_as_native_obj": False, + "root_dag_id": None, + "schedule_interval": {"__type": "CronExpression", "value": "2 2 * * *"}, + "scheduler_lock": None, + "start_date": "2020-06-15T00:00:00+00:00", + "tags": [], + "template_searchpath": None, + "timetable_description": None, + "timezone": "Timezone('UTC')", } expected.update({"last_parsed": response.json["last_parsed"]}) assert response.json == expected diff --git a/tests/api_connexion/schemas/test_dag_schema.py b/tests/api_connexion/schemas/test_dag_schema.py index 8774f182ba..f3e54c0a96 100644 --- a/tests/api_connexion/schemas/test_dag_schema.py +++ b/tests/api_connexion/schemas/test_dag_schema.py @@ -183,6 +183,7 @@ def test_serialize_test_dag_detail_schema(url_safe_serializer): "schedule_interval": {"__type": "TimeDelta", "days": 1, "seconds": 0, "microseconds": 0}, "start_date": "2020-06-19T00:00:00+00:00", "tags": [{"name": "example1"}, {"name": "example2"}], + "template_searchpath": None, "timezone": "Timezone('UTC')", "max_active_runs": 16, "pickle_id": None,