【发布时间】:2020-10-02 14:59:24
【问题描述】:
我正在尝试使用基础设施即代码的方法创建一个作曲家环境。为此,我需要以编程方式存储和检索气流变量,并将它们版本化。
在previous post,Ed Morton写了一个脚本将表格转换为JSON,但是在使用以下命令时,composer/airflow输出数据的方式存在问题:
gcloud composer environments run `$COMPOSER_ENV` --location <location> connections -- --list
输出的样本是:
╒════════════════════════════════╤═════════════════════════════╤════════════════════════════════╤════════╤════════════════╤══════════════════════╤════════════════════════════════╕
│ Conn Id │ Conn Type │ Host │ Port │ Is Encrypted │ Is Extra Encrypted │ Extra │
╞════════════════════════════════╪═════════════════════════════╪════════════════════════════════╪════════╪════════════════╪══════════════════════╪════════════════════════════════╡
│ 'airflow_db' │ 'mysql' │ 'airflow-sqlp...rvice.default' │ None │ True │ False │ None │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┼────────┼────────────────┼──────────────────────┼────────────────────────────────┤
如您所见,问题在于Host 和Extra 列包含省略号...,它会删减长文本,例如此处'airflow-sqlp...rvice.default'。
如何获得上述 (composer) 实用程序输出的完整版信息?
我正在使用composer-1.12.1-airflow-1.10.9。不幸的是nice feature of exporting the connections to a JSON using the CLI is only available in the latest version of airflow。
【问题讨论】:
标签: google-cloud-platform airflow google-cloud-composer