msb217 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_r350285506
##########
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:
Yes, I think that's a good idea. I will add these to the following methods
as well.
GET - Tasks in a DAG
GET - Upstream Tasks
GET - Downstream Tasks
----------------------------------------------------------------
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