airflow - 如何使用环境变量在 Airflow 中定义 https 连接
问题描述
在 Airflow 中,http(和其他)连接可以定义为环境变量。但是,很难https
为这些连接使用模式。
这样的连接可能是:
export AIRFLOW_CONN_MY_HTTP_CONN=http://example.com
但是,无法定义安全连接:
export AIRFLOW_CONN_MY_HTTP_CONN=https://example.com
因为 Airflow 剥离了方案 ( https
) 并且在最终的连接对象中,url 得到http
了方案。
事实证明,可以https
通过这样定义连接来使用:
export AIRFLOW_CONN_MY_HTTP_CONN=https://example.com/https
第二个在气流代码https
中调用schema
(如 DSN 中的 eg postgresql://user:passw@host/schema
)。然后schema
将其用作scheme
连接对象中最终 url 的构造。
我想知道这是设计使然,还是只是scheme
和schema
.
解决方案
您应该使用Connections,然后您可以指定架构。
推荐阅读
- php - paygate payweb3 在 php 网站中的集成
- node.js - 验证 Adonis Websocket 连接
- python - 从 Python 列表中获取属性
- vue.js - v-data-table 中的 v-edit-dialog 在关闭时恢复原始值
- c - 接收到带有 sigaction 的信号时重启进程
- php - 使用 PHP 开发工具包向 Amazon SQS 发送消息时属性不可见
- swift - 无法对 UITableViewController 进行快照,但可以对 UIViewController 进行快照
- python - 想要为 2 列的组合聚合一个小时
- python - Beautiful Soup - urllib.error.HTTPError: HTTP 错误 403: 禁止
- git - 从一个 Git 项目中压缩多个 Pull Request 并将它们合并到另一个中作为一个 PR