Airflow 405获取通过rest api运行的气流dag时出错

Airflow 405获取通过rest api运行的气流dag时出错,airflow,Airflow,我正在尝试使用airflow REST api(v1.10.2),但每当我尝试查询有关特定dag的信息时,都会遇到问题 下面是一个最新运行的\u端点工作的示例: ❯❯❯ curl -X GET http://192.168.99.100:30080/api/experimental/latest_runs { "items": [ { "dag_id": "test_dag", "dag_run_url": "/admin/airflow/graph?dag

我正在尝试使用airflow REST api(v1.10.2),但每当我尝试查询有关特定dag的信息时,都会遇到问题

下面是一个
最新运行的\u
端点工作的示例:

 ❯❯❯ curl -X GET http://192.168.99.100:30080/api/experimental/latest_runs
{
  "items": [
    {
      "dag_id": "test_dag",
      "dag_run_url": "/admin/airflow/graph?dag_id=test_dag&execution_date=2019-03-07+21%3A18%3A23.387031%2B00%3A00",
      "execution_date": "2019-03-07T21:18:23.387031+00:00",
      "start_date": "2019-03-07T21:18:23.683240+00:00"
    }
  ]
}
但是,当我尝试查询
test\u dag
时,我得到一个错误:

 ❯❯❯ curl -X GET "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
❯❯❯ curl-X GET“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
405方法不允许
方法不允许
请求的URL不允许使用该方法

我还尝试查找源代码,发现有一个

 ❯❯❯ curl -X GET "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs?state=success"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
❯❯❯ curl-X GET“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs?state=success"
405方法不允许
方法不允许
请求的URL不允许使用该方法

但把这些加进去似乎没有什么帮助

我发现触发DAG是有效的:

 ❮❮❮ curl -X POST \
  http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs \
  -H 'Content-Type: application/json' \
  -d '{}'
{
  "message": "Created <DagRun test_dag @ 2019-03-07 22:31:18+00:00: manual__2019-03-07T22:31:18+00:00, externally triggered: True>"
}
❮❮❮ curl-X柱\
http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs \
-H'内容类型:应用程序/json'\
-d'{}'
{
“消息”:“已创建”
}
有人知道为什么我不能查询DAG的状态并获得405吗

编辑: 这里有更多的调查。我尝试了所有可能的方法,但没有一种成功:

 4:21PM /Users/paymahn/solvvy/scheduler  ✘ 130 train.models ✭ ✱ ◼
 ❯❯❯ curl -X GET "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
 4:21PM /Users/paymahn/solvvy/scheduler train.models ✭ ✱ ◼
 ❯❯❯ curl -X OPTIONS "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
 4:21PM /Users/paymahn/solvvy/scheduler train.models ✭ ✱ ◼
 ❯❯❯ curl -X TRACE "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
 4:22PM /Users/paymahn/solvvy/scheduler train.models ✭ ✱ ◼
 ❯❯❯ curl -X PATCH "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
 4:22PM /Users/paymahn/solvvy/scheduler train.models ✭ ✱ ◼
 ❯❯❯ curl -X DELETE "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
 4:22PM /Users/paymahn/solvvy/scheduler train.models ✭ ✱ ◼
 ❯❯❯ curl -X HEAD "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
Warning: Setting custom HTTP method to HEAD with -X/--request may not work the
Warning: way you want. Consider using -I/--head instead.
curl: (18) transfer closed with 178 bytes remaining to read
 4:22PM /Users/paymahn/solvvy/scheduler  ✘ 18 train.models ✭ ✱ ◼
 ❯❯❯ curl -X PUT "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
 4:22PM /Users/paymahn/solvvy/scheduler train.models ✭ ✱ ◼
 ❯❯❯ curl -X POST "http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
<!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>
4:21PM/Users/paymahn/solvvy/scheduler✘ 130辆火车✭ ✱ ◼
❯❯❯ curl-X GET“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs"
405方法不允许
方法不允许
请求的URL不允许使用该方法

下午4:21/用户/paymahn/solvvy/scheduler train.models✭ ✱ ◼ ❯❯❯ curl-X选项“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 下午4:21/用户/paymahn/solvvy/scheduler train.models✭ ✱ ◼ ❯❯❯ 旋度-X轨迹“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 405方法不允许 方法不允许 请求的URL不允许使用该方法

下午4:22/用户/paymahn/solvvy/scheduler train.models✭ ✱ ◼ ❯❯❯ curl-X面片“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 405方法不允许 方法不允许 请求的URL不允许使用该方法

下午4:22/用户/paymahn/solvvy/scheduler train.models✭ ✱ ◼ ❯❯❯ curl-X删除“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 405方法不允许 方法不允许 请求的URL不允许使用该方法

下午4:22/用户/paymahn/solvvy/scheduler train.models✭ ✱ ◼ ❯❯❯ 卷曲-X头“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 警告:将自定义HTTP方法设置为带有-X/--request的HEAD可能无法正常工作 警告:你想要的方式。考虑使用-I/-Head。 curl:(18)传输结束,剩余178个字节可读取 下午4:22/用户/paymahn/solvvy/scheduler✘ 18列车模型✭ ✱ ◼ ❯❯❯ curl-X PUT“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 405方法不允许 方法不允许 请求的URL不允许使用该方法

下午4:22/用户/paymahn/solvvy/scheduler train.models✭ ✱ ◼ ❯❯❯ 卷曲-X柱“http://192.168.99.100:30080/api/experimental/dags/test_dag/dag_runs" 400错误请求 错误的请求 浏览器(或代理)发送了此服务器无法理解的请求


结果表明,该端点仅在RBAC UI模式下的1.10.2中启用:。

看起来这是JIRA上气流问题的重复:启用身份验证了吗?