本文介绍了AWS Lambda和Apache Airflow集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道是否有人可以阐明此问题:

wondered if anyone could shed some light on this issue:

我正试图找到Airflow REST API URL来启动DAG以从AWS Lambda函数运行

I'm trying to locate the Airflow REST API URL to initiate a DAG to Run from AWS Lambda Function.

到目前为止,除了查看Apache Incubator网站提供的所有相关文档外,解决该问题的唯一指南是在Lambda中使用此URL结构(python 3.6)代码:

So far from looking at all the relevant documentation provided from the Apache Incubator Site, the only guidance to solved the problem is by using this URL structure in the Lambda (python 3.6) Code:

Apache实验API:

Apache Experimental API: https://airflow.apache.org/api.html#endpoints

语法应为:

http://airflow_hostname/api/experimental/dags/<DAG_ID>/

但是,这无法从我的AWS Lambda函数中启动特定DAG,任何帮助/指导或指针都将非常有用。

However this fails to initiate the Specific DAG in from my AWS Lambda Function, any help/guidance or pointers would be great.

推荐答案

在Airflow 1.10中,以下发布请求将起作用:

In the Airflow 1.10 the following post request will work:

curl -X POST http://localhost:8080/api/experimental/dags/<dag_id>/dag_runs -H 'Cache-Control: no-cache' -H 'Content-Type: application/json'    -d '{"conf":"{\"key\":\"value\"}"}'

您需要传递一个空的JSON字符串,否则发布请求将失败。

You need to pass an empty JSON string otherwise the post request will fail.

这篇关于AWS Lambda和Apache Airflow集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:54