Skip to content

Commit

Permalink
AIP-84: Add UI batch recent dag runs endpoint (#43204)
Browse files Browse the repository at this point in the history
* AIP-84 | add UI batch recent dag runs endpoint

* AIP-84 | add UI batch recent dag runs

* refactor: use public serializer for ui batch recent runs

* fix: add trigger_by for dag run in public test_dag

* refactor: use DAGRunResponse from public endpoint

* Update code review

---------

Co-authored-by: pierrejeambrun <pierrejbrun@gmail.com>
  • Loading branch information
jason810496 and pierrejeambrun authored Oct 25, 2024
1 parent 752f933 commit 14abd33
Show file tree
Hide file tree
Showing 14 changed files with 1,250 additions and 1 deletion.
272 changes: 272 additions & 0 deletions airflow/api_fastapi/core_api/openapi/v1-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,103 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/ui/dags/recent_dag_runs:
get:
tags:
- Dags
summary: Recent Dag Runs
description: Get recent DAG runs.
operationId: recent_dag_runs
parameters:
- name: dag_runs_limit
in: query
required: false
schema:
type: integer
default: 10
title: Dag Runs Limit
- name: limit
in: query
required: false
schema:
type: integer
default: 100
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
default: 0
title: Offset
- name: tags
in: query
required: false
schema:
type: array
items:
type: string
title: Tags
- name: owners
in: query
required: false
schema:
type: array
items:
type: string
title: Owners
- name: dag_id_pattern
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Dag Id Pattern
- name: dag_display_name_pattern
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Dag Display Name Pattern
- name: only_active
in: query
required: false
schema:
type: boolean
default: true
title: Only Active
- name: paused
in: query
required: false
schema:
anyOf:
- type: boolean
- type: 'null'
title: Paused
- name: last_dag_run_state
in: query
required: false
schema:
anyOf:
- $ref: '#/components/schemas/DagRunState'
- type: 'null'
title: Last Dag Run State
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DAGWithLatestDagRunsCollectionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/public/dags/:
get:
tags:
Expand Down Expand Up @@ -2093,6 +2190,181 @@ components:
- total_entries
title: DAGTagCollectionResponse
description: DAG Tags Collection serializer for responses.
DAGWithLatestDagRunsCollectionResponse:
properties:
total_entries:
type: integer
title: Total Entries
dags:
items:
$ref: '#/components/schemas/DAGWithLatestDagRunsResponse'
type: array
title: Dags
type: object
required:
- total_entries
- dags
title: DAGWithLatestDagRunsCollectionResponse
description: DAG with latest dag runs collection response serializer.
DAGWithLatestDagRunsResponse:
properties:
dag_id:
type: string
title: Dag Id
dag_display_name:
type: string
title: Dag Display Name
is_paused:
type: boolean
title: Is Paused
is_active:
type: boolean
title: Is Active
last_parsed_time:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Parsed Time
last_pickled:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Pickled
last_expired:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Last Expired
scheduler_lock:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Scheduler Lock
pickle_id:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Pickle Id
default_view:
anyOf:
- type: string
- type: 'null'
title: Default View
fileloc:
type: string
title: Fileloc
description:
anyOf:
- type: string
- type: 'null'
title: Description
timetable_summary:
anyOf:
- type: string
- type: 'null'
title: Timetable Summary
timetable_description:
anyOf:
- type: string
- type: 'null'
title: Timetable Description
tags:
items:
$ref: '#/components/schemas/DagTagPydantic'
type: array
title: Tags
max_active_tasks:
type: integer
title: Max Active Tasks
max_active_runs:
anyOf:
- type: integer
- type: 'null'
title: Max Active Runs
max_consecutive_failed_dag_runs:
type: integer
title: Max Consecutive Failed Dag Runs
has_task_concurrency_limits:
type: boolean
title: Has Task Concurrency Limits
has_import_errors:
type: boolean
title: Has Import Errors
next_dagrun:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Next Dagrun
next_dagrun_data_interval_start:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Next Dagrun Data Interval Start
next_dagrun_data_interval_end:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Next Dagrun Data Interval End
next_dagrun_create_after:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Next Dagrun Create After
owners:
items:
type: string
type: array
title: Owners
latest_dag_runs:
items:
$ref: '#/components/schemas/DAGRunResponse'
type: array
title: Latest Dag Runs
file_token:
type: string
title: File Token
description: Return file token.
readOnly: true
type: object
required:
- dag_id
- dag_display_name
- is_paused
- is_active
- last_parsed_time
- last_pickled
- last_expired
- scheduler_lock
- pickle_id
- default_view
- fileloc
- description
- timetable_summary
- timetable_description
- tags
- max_active_tasks
- max_active_runs
- max_consecutive_failed_dag_runs
- has_task_concurrency_limits
- has_import_errors
- next_dagrun
- next_dagrun_data_interval_start
- next_dagrun_data_interval_end
- next_dagrun_create_after
- owners
- latest_dag_runs
- file_token
title: DAGWithLatestDagRunsResponse
description: DAG with latest dag runs response serializer.
DagProcessorInfoSchema:
properties:
status:
Expand Down
2 changes: 2 additions & 0 deletions airflow/api_fastapi/core_api/routes/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

from airflow.api_fastapi.common.router import AirflowRouter
from airflow.api_fastapi.core_api.routes.ui.assets import assets_router
from airflow.api_fastapi.core_api.routes.ui.dags import dags_router
from airflow.api_fastapi.core_api.routes.ui.dashboard import dashboard_router

ui_router = AirflowRouter(prefix="/ui")

ui_router.include_router(assets_router)
ui_router.include_router(dashboard_router)
ui_router.include_router(dags_router)
Loading

0 comments on commit 14abd33

Please sign in to comment.