You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/11/25 15:34:58 UTC
[GitHub] [airflow] SamWheating commented on a change in pull request #6652: [AIRFLOW-5548] [AIRFLOW-5550] REST API enhancement - dag info, task …
SamWheating commented on a change in pull request #6652: [AIRFLOW-5548] [AIRFLOW-5550] REST API enhancement - dag info, task …
URL: https://github.com/apache/airflow/pull/6652#discussion_r350256148
##########
File path: airflow/www/api/experimental/endpoints.py
##########
@@ -172,6 +175,85 @@ def task_info(dag_id, task_id):
return jsonify(fields)
+@api_experimental.route('/dags/<string:dag_id>/tasks', methods=['GET'])
+@requires_authentication
+def get_dag_tasks(dag_id):
+ """Returns a JSON array of task ids of a given `dag_id`. """
+ try:
+ info = get_tasks(dag_id)
+ except AirflowException as err:
+ _log.info(err)
+ response = jsonify(error="{}".format(err))
+ response.status_code = err.status_code
+ return response
+
+ return jsonify(info)
+
+
+@api_experimental.route('/dags', methods=['GET'])
+@requires_authentication
+def dags():
Review comment:
Would it be possible to add an option for some sort of filtering here, for example only returning DAGs with a provided prefix or matching a provided RegEx? It's fully possible that people might have hundreds to thousands of DAGs in which case they may not want to return the whole contents of the DagBag.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services