【发布时间】:2020-04-20 18:56:01
【问题描述】:
我正在尝试使用 AirFlow 休息 API 触发我的 dag。但是无法理解如何进行身份验证。
以下 URL 在我的浏览器中运行良好。
http://localhost:8181/api/experimental/dags/demo/dag_runs
但是,以下代码给出了身份验证错误。
import requests
import json
from pprint import pprint
result = requests.get(
"http://localhost:8181/api/experimental/dags/demo/dag_runs",
data=json.dumps("{}"),
auth=("myuser", "mypassword"))
pprint(result.content.decode('utf-8'))
我也发现了这个,但现在确定如何通过身份验证
https://github.com/apache/airflow/blob/master/airflow/api/client/api_client.py
【问题讨论】:
标签: rest airflow airflow-scheduler