You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Pavel Shuvalov (JIRA)" <ji...@apache.org> on 2019/05/08 15:58:00 UTC

[jira] [Created] (AIRFLOW-4482) Add execution_date to trigger DAG run API response

Pavel Shuvalov created AIRFLOW-4482:
---------------------------------------

             Summary: Add execution_date to trigger DAG run API response
                 Key: AIRFLOW-4482
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4482
             Project: Apache Airflow
          Issue Type: Improvement
          Components: api
    Affects Versions: 1.10.3
            Reporter: Pavel Shuvalov


We are using experimental REST API for automating Airflow from Jenkins and our workflow looks like this:
 * Jenkins job triggers DAG run (using _POST /api/experimental/dags/*<dag_id>*/dag_runs_)
 * Airflow API returns response like this: 

{code:java}
 {"message":"Created <DagRun dag_id @ 2019-05-08 11:42:43+00:00: run_id, externally triggered: True>"}  {code}
 * Jenkins job parses the response for _*execution_date*_ (2019-05-08T11:42:43 for response above)
 * Jenkins job further uses execution_date to check DAG run state using _POST /api/experimental/dags/*<dag_id>*/dag_runs/*<execution_date>*_
 * **Also Jenkins job generates DAG run UI link

Here is [the code|https://github.com/doublescoring/jenkins-pipeline-goodness/blob/master/src/main/groovy/airflow.groovy].

Actually it is not a good idea to parse message string for execution_date. So it is proposed to add _*execution_date*_ in DAG run trigger API response as a field. It makes it possible to get execution_date directly from the response without dirty and unpredictable parsing. After this improvement API response will be like this:

 
{code:java}
{'execution_date': '2019-05-08T07:03:09+00:00', 'message': 'Created <DagRun dag_id @ 2019-05-08 07:03:09+00:00: manual__2019-05-08T07:03:09+00:00, externally triggered: True>'}
{code}
 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)