如何通过REST API触发Airflow DAG?

时间:2018-09-26 16:55:48

标签: airflow

1.10.0文档说我应该能够针对/ api / experimental / dags // dag_runs进行POST来触发DAG运行,但是当我这样做时,我收到了一条错误消息:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>

1 个答案:

答案 0 :(得分:5)

要执行此操作,我发现我需要在正文中发送一个空的JSON字符串:

curl -X POST \
  http://airflow.dyn.fa.disney.com/api/experimental/dags/people_data/dag_runs \
  -H 'Cache-Control: no-cache' \
  -d '{}'