[ 
https://issues.apache.org/jira/browse/AIRFLOW-4482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaodong DENG resolved AIRFLOW-4482.
------------------------------------
       Resolution: Resolved
    Fix Version/s: 2.0.0

> 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
>            Assignee: Pavel Shuvalov
>            Priority: Major
>             Fix For: 2.0.0
>
>
> 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)

Reply via email to