[ 
https://issues.apache.org/jira/browse/AIRFLOW-2664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16751338#comment-16751338
 ] 

ASF GitHub Bot commented on AIRFLOW-2664:
-----------------------------------------

rcorre commented on pull request #3546: AIRFLOW-2664: Support filtering dag 
runs by id prefix in API.
URL: https://github.com/apache/airflow/pull/3546
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Support filtering on /dags/<dag_id>/dag_runs
> --------------------------------------------
>
>                 Key: AIRFLOW-2664
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2664
>             Project: Apache Airflow
>          Issue Type: New Feature
>          Components: api
>            Reporter: Ryan Roden-Corrent
>            Priority: Major
>
> the `GET /dags/<dag_id>/dag_runs` endpoint was recently added as described in 
> AIRFLOW-2550. I'd like a ?run_id_prefix parameter to filter runs by the 
> run_id.
>  
> For example, `GET /dags/my_dag/dag_runs?run_id_prefix=create_namespace_foo 
> would return the list of dag runs with a run_id starting with 
> "create_namespace_foo".
>  
> An additional filter would be a `?latest=<n>` query param to limit the count 
> to the latest <n> runs (I believe the list returned by GET is already ordered 
> chronologically). For example, `GET 
> /dags/my_dag/dag_runs?run_id_prefix=create_namespace_foo&latest=1` would 
> return the last run with run_id starting with create_namespace_foo.
>  
> Do these features sound generally useful, or are they too specific?
>  
> In our use case, we have a DAG that provisions namespaced resources. If I'm 
> provisioning resources for namespace foo, I would `POST 
> /dags/provision/dag_runs \{"run_id": "create_namespace_foo"}`. To check on 
> the status, we could run `GET 
> /dags/provision/dag_runs?run_id_prefix=create_namespace_foo&latest=1`.
>  
> While there is already an endpoint to get status based on an exact dag_run 
> ID, this requires storing the id after the POST, which would make our service 
> stateful. Filtering by a prefix allows for stateless querying of status.



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

Reply via email to