AWS MWAA(托管 Apache Airflow);以编程方式启用 DAG

汤米

我们正在使用 AWS MWAA。我们以编程方式将 DAG.py 文件添加到我们的 S3 存储桶中。然后它们显示在 UI 中。但是,它们是“OFF”的,您必须单击“ON”按钮才能启动它们。

编辑:此外,我们有时可能希望将打开的 DAG 设置为关闭(以编程方式)

我希望以编程方式执行此步骤,但是我无法弄清楚。

API 似乎没有它:https : //docs.aws.amazon.com/mwaa/latest/userguide/mwaa-actions-resources.html

Boto 好像没有:https : //boto3.amazonaws.com/v1/documentation/api/latest/reference/services/mwaa.html

是否可以通过 API 从 OFF/ON ON/OFF 操纵 DAG 状态?

直播

这不能通过 API 实现,但您可以使用is_paused_upon_creation这个标志指定 dag 在第一次创建时是否暂停。如果 dag 已经存在,这个标志将被忽略。

您可以is_paused_upon_creation=False在 DAG 承包商中进行设置

dag = DAG(
    dag_id='tutorial',
    default_args=default_args,
    is_paused_upon_creation=False,
)

另一种选择是通过取消暂停 CLI来完成

airflow dags unpause [-h] [-S SUBDIR] dag_id

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在Apache Airflow DAG中使用AWS SES发送失败电子邮件

在DAG中使用boto3时,Apache airflow无法找到AWS凭证

Apache Airflow DAG无法导入本地模块

如何为Apache Airflow DAG定义超时?

具有单个任务的 Apache Airflow DAG

如何在Apache Airflow中重命名DAG

如何以Unix用户身份运行Apache Airflow DAG

UTC午夜的Apache Airflow dag时间表

Apache 气流不显示 DAG

Apache Airflow - 即使定义了 start_date 和 schedule_interval,Dag 也不会启动

apache airflow为DAG文件夹中的所有脚本定义数据

Apache Airflow-无论以前的进程成功与否,都需要始终在dag中运行该进程

Apache Airflow-触发/时间表DAG在完成时重新运行(文件传感器)

Apache Airflow-DAG中有多少个任务太多?

对于Apache Airflow,如何通过CLI手动触发DAG时如何传递参数?

如何在Apache Airflow Dag中添加手动任务

Apache airflow宏获取上一次dag运行的执行时间

Apache Airflow如何将xcom_pull()值转换为DAG?

Apache Airflow-即使关键任务失败,DAG也会注册为成功

Apache Airflow - 使用上次运行日期维护 dag_ids 表?

使用 Apache Airflow 工具,为批处理管道实现 DAG 以从远程系统获取目录

在AWS中托管Apache Camel的最佳方法是什么?

损坏的 DAG:使用 AWS Airflow Managed Service 时没有名为“psycopg2”的模块

Airflow DAG 的可选参数

我可以以编程方式确定是否安排了Airflow DAG还是手动触发了它?

Apache Airflow 1.9.0中的min_file_process_interval和dag_dir_list_interval有什么区别?

Apache Airflow-如何在使用TriggerDagRunOperator触发的流中在运算符外部检索dag_run数据

Apache Airflow 1.10+调度程序是否支持在特定时间在不同DST感知的时区中运行2个DAG?

创建DAG数据流(Apache Beam)