XD-DENG commented on a change in pull request #4884: [AIRFLOW-4015] Add
get_dag_runs GET endpoint to "classic" API
URL: https://github.com/apache/airflow/pull/4884#discussion_r263999923
##########
File path: airflow/www/api/experimental/endpoints.py
##########
@@ -106,6 +107,28 @@ def delete_dag(dag_id):
return jsonify(message="Removed {} record(s)".format(count), count=count)
+@api_experimental.route('/dags/<string:dag_id>/dag_runs', methods=['GET'])
+@requires_authentication
+def dag_runs(dag_id):
+ """
+ Returns a list of Dag Runs for a specific DAG ID.
+ :query param state: a query string parameter
'?state=queued|running|success...'
+ :param dag_id: String identifier of a DAG
+ :return: List of DAG runs of a DAG with requested state,
+ or all runs if the state is not specified
+ """
+ try:
+ state = request.args.get('state')
Review comment:
- Shall we allow users to not provide `state` explicitly (have a default
one, say `all`)?
- Is it possible to allow multiple states to be passed at one time? (or is
it necessary to you)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services