英文:
Airflow: Is there a way to copy variables from one Composer version to another Composer version using Cloud Shell?
问题
我正在进行迁移任务,涉及在Cloud Shell中从一个Cloud Composer版本复制变量到另一个Cloud Composer版本。
不过,在Cloud Shell中是否有可能完成这样的任务?
我已经阅读了Airflow和Composer文档;但是,似乎找不到可以允许我从一个Composer版本复制变量到另一个版本的工作命令。
英文:
I am working on a migration task, which involves copying variables from one Cloud Composer version to another Cloud Composer version using Cloud Shell.
Though, is it possible to accomplish such a task in Cloud Shell?
I have read the Airflow and Composer documentation; though, I cannot seem to find a working command that will allow me to copy variables from one Composer version to another.
答案1
得分: 0
没有一个单独的Airflow CLI命令可以"移动"变量从一个Airflow环境到另一个;但是,你可以从源环境导出变量到一个文件,然后从同一个文件中导入到目标环境。
类似这样:
从源环境导出
gcloud composer environments run SOURCE_ENVIRONMENT_NAME \
--location SOURCE_LOCATION \
variables export \
my_file.json
导入到目标环境
gcloud composer environments run TARGET_ENVIRONMENT_NAME \
--location TARGET_LOCATION \
variables import \
my_file.json
英文:
There isn't a single Airflow CLI command to "move" Variables from one Airflow environment to another; however, you can export Variables from source environment to a file and then import from the same file to the target environment.
Something like this:
Export from source environment
gcloud composer environments run SOURCE_ENVIRONMENT_NAME \
--location SOURCE_LOCATION \
variables export \
my_file.json
Import to target environment
gcloud composer environments run TARGET_ENVIRONMENT_NAME \
--location TARGET_LOCATION \
variables import \
my_file.json
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论