Skip to content

Add a DAG Run clear endpoint to REST API #23419

Closed

Description

@bbovenzi

Description

Add a POST endpoint to clear a dag run like we currently do here.

Url format: api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/clear

Use case/motivation

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. tirkarthi commented on May 3, 2022

    @tirkarthi
    Contributor

    @bbovenzi I would like to pick this up in case you are not working on this. I have a rough working version of this and can also work on queue, run endpoints. I would like to confirm below things.

    1. The linked API has confirmed parameter which will return a str value of task_instances on false. Do we need to support this parameter in query parameter? If so do we need to return str value of task_instances or do we need to return like the endpoint where task_instances for a dag_run or returned.
    2. Since we have dag_id and dag_run_id in the URL do we need this as a post endpoint since confirmed is also a query parameter and we are not posting additional data whereas the linked API uses post since /dagrun_clear has no details of dag_id and dag_run_id. It makes sense for post if the API will be expanded in future to support more customisation.
  2. bbovenzi commented on May 3, 2022

    @bbovenzi
    ContributorAuthor
    1. We should make sure we're consistent with the existing API endpoints:https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/post_clear_task_instances. So instead of confirmed, we send dry_run. The return should be json instead of a string.
    2. Let's do POST to support future changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions