python - 如何在Apache气流中通过rest api触发dag,得到403禁止错误
问题描述
我尝试使用以下命令
curl -X POST
http://localhost:8080/api/experimental/dags/dag_trigger_external_api/dag_runs
H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -d '{"conf":"{\"key\":\"value\"}"}'
我还在airflow_home目录下的pulgin文件夹中安装了REST_api插件并设置了rbac=True
我还在airflow.config文件中插入了以下代码行
过滤掉来自标准输出的加载消息 默认值:真
filter_loading_messages_in_cli_response = True
用于验证 REST API 插件的 REST 调用的 HTTP 标头名称 默认:“rest_api_plugin_http_token”
rest_api_plugin_http_token_header_name = rest_api_plugin_http_token
用于对 REST API 插件的 REST 调用进行身份验证的 HTTP 令牌 默认值:无 将此注释掉以禁用身份验证
rest_api_plugin_expected_http_token = 无
解决方案
推荐阅读
- javascript - 如何在不覆盖第一个元素的情况下向数组添加新元素?
- react-native - 使用 Expo SecureStore 将登录凭据保存到 Keychain
- javascript - 如何将 `this` 与 ES6 类原型方法绑定
- android - 我应该在哪里为 Main Activity 实现 setOnTouchListener
- java - 如果哈希图过滤器收集器java 8中的条件为真,请执行某些操作
- swift - 物理身体不只显示一个精灵?
- php - 使用名称和分数创建 PHP 表
- linux - 从 bash 或节点写入终端环境
- javascript - 将 TR 和更改焦点附加到新的 tr 输入字段
- python - 使用 BeautifulSoup 将所有图像从网站下载到指定文件夹的 Python 脚本