gpt4 book ai didi

How to grant permission to clear specific Airflow DAG?(如何授予清除特定气流DAG的许可?)

转载 作者:bug小助手 更新时间:2023-10-22 17:34:53 39 4
gpt4 key购买 nike



I want to create a role that can clear past Airflow DAG execution in specific DAG.
I have already found that User role has

我想创建一个角色,可以清除特定DAG中过去的气流DAG执行。我已经发现用户角色



  • can delete on DAG Runs

  • can delete on DAGs


https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.html
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/delete_dag_run
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/post_clear_task_instances

https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.htmlhttps://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/delete_dag_runhttps://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/post_clear_task_instances


But I assume that this permission can delete all DAGs. Which permission should I grant to clear past DAG execution for specific DAG?

但我认为这个权限可以删除所有DAG。我应该授予哪种权限来清除特定DAG的过去DAG执行?


更多回答

Try the permission combo of DAG:<specific_dag>.can_edit, DAG Runs.can_read and Task Instances.can_edit. Thats a variation of the combo in this table for the /dags/{dag_id}/clearTaskInstances endpoint

尝试DAG的权限组合:<specific_DAG>.can_edit、DAG Runs.can_read和Task Instances.can_edit。这是该表中/dags/{DAG_id}/clearTaskInstances端点组合的变体

优秀答案推荐

You need

你需要


DAG:<specific_dag>.can_edit
DAG Runs.can_read
DAG Runs.can_edit
DAG Runs.can_delete
Task Instances.can_read
Task Instances.can_edit
Task Instances.can_delete


To grant permission to clear past Airflow DAG execution in a specific DAG, you need to grant the following permission:

要授予清除特定DAG中过去气流DAG执行的权限,您需要授予以下权限:


DAG:<DAG_ID>:can_clear

This permission allows users to clear past DAG runs for the specified DAG. For example, to grant this permission to a user named alice for the DAG named my_dag, you would run the following command:

此权限允许用户清除指定DAG的过去DAG运行。例如,要为名为my_DAG的DAG向名为alice的用户授予此权限,您需要运行以下命令:


airflow permissions grant DAG:my_dag:can_clear alice

更多回答

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

正如目前所写的,你的答案还不清楚。请编辑以添加其他详细信息,以帮助其他人了解这是如何解决所问问题的。你可以在帮助中心找到更多关于如何写出好答案的信息。

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com