气流会以编程方式使停顿失效吗?

编程入门 行业动态 更新时间:2024-10-24 14:26:43
本文介绍了气流会以编程方式使停顿失效吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个数据包,我们将部署到多个不同的气流实例,在airflow.cfg中,我们有 dags_are_paused_at_creation = True ,但是对于这个特定的数据包,我们希望它无需手动单击即可将其打开。有没有办法以编程方式完成它?

I have a dag that we'll deploy to multiple different airflow instances and in our airflow.cfg we have dags_are_paused_at_creation = True but for this specific dag we want it to be turned on without having to do so manually by clicking on the UI. Is there a way to do it programmatically?

推荐答案

airflow-rest-api-plugin插件也可以用于以编程方式暂停任务。

airflow-rest-api-plugin plugin can also be used to programmatically pause tasks.

暂停DAG

Pauses a DAG

气流版本:1.7.0或更大

Available in Airflow Version: 1.7.0 or greater

获取-http:// {HOST}:{PORT} / admin / rest_api / api?api = pause

GET - {HOST}:{PORT}/admin/rest_api/api?api=pause

查询参数:

dag_id-字符串-dag的ID

dag_id - string - The id of the dag

subdir(可选) -字符串-从中查找dag的文件位置或目录

subdir (optional) - string - File location or directory from which to look for the dag

示例:

http:// {HOST}:{PORT} / admin / rest_api / api?api = pause& dag_id = test_id

{HOST}:{PORT}/admin/rest_api/api?api=pause&dag_id=test_id

请参阅更多详细信息: github/teamclairvoyant/airflow-rest -api-plugin

See for more details: github/teamclairvoyant/airflow-rest-api-plugin

更多推荐

气流会以编程方式使停顿失效吗?

本文发布于:2023-11-24 08:53:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624547.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:气流   会以   停顿   方式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!