我正在通过Apache Airflow托管工作流程(MWAA) 测试在 AWS 上运行 Apache Airflow 的情况。AWS 已部署并为我管理的 Airflow 版本是1.10.12。
当我尝试访问 v1 REST API 时,/api/experimental/test我收到状态代码403 Forbidden。
是否可以在 MWAA 中启用实验性 API?如何?
我正在尝试使用 REST API 触发气流 dags。这是行不通的。我收到 ERROR 400 响应:
{
"detail": "Property is read-only - 'state'",
"status": 400,
"title": "Bad Request",
"type": "https://airflow.apache.org/docs/2.0.1/stable-rest-api-ref.html#section/Errors/BadRequest"
}
Run Code Online (Sandbox Code Playgroud)
我通过 CURL 和 Python requests 模块进行了尝试,结果是相同的。
例子:
import requests
headers = {
'accept': 'application/json',
'Content-Type': 'application/json',
}
auth = ('test', 'test')
import json
body = {
"conf": {},
"dag_run_id": "string",
"execution_date": "2021-04-15T14:04:43.602Z",
"state": "success"
}
req = requests.post("http://127.0.0.1:8080/api/v1/dags/sleeper/dagRuns",
headers=headers, auth=auth, data=json.dumps(body))
Run Code Online (Sandbox Code Playgroud)
我是否需要在 Airflow 配置或 Dag 中指定某些内容才能运行它?因为据我了解,有一些具有权限的东西?
"Property is read-only - 'state'",