apache / apache/airflow

Airflow REST API: Add generic capability to retrieve required information for the specified entity..

Open
#29,893 15 comments 0 reactions 0 assignees View on GitHub
area:API good first issue kind:feature
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 10h
Merged PRs (30d)
483

Description

### Description

Airflow REST API should add a generic capability to retrieve the required information only. Instead sending all of them.
E.g. If I want to retrieve DAG Run details using REST API: https://airflow.apache.org/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
Or want to fetch list of DAGs using RET API: https://airflow.apache.org/api/v1/dags

It always returns the full details. Often it is the case where caller is not interested in all the information.

So I suggest to add a generic capability to retrieve only needed information just like offset and limit.
E.g. if we pass fields = {dag_id, is_paused} in the query parameter while calling https://airflow.apache.org/api/v1/dags API, So it returns JSON body contains {dag_id, is_paused} fields.

Similarly it is true for other end points as well (At least Get Ones)

### Use case/motivation

1. Optimize the information what we want to retrieve from server.
2. Saving Network bandwidth by reducing the information to required one.
3. Possibility to collect more data in one go.

### Related issues

Cannot say.

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the cited GET endpoints for DAG runs and DAG lists, including their current response shapes and query parameters. Define how a fields parameter should work across the requested GET endpoints, including invalid or missing fields; done means the behavior is consistent and documented for the agreed scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.