【问题标题】:gcloud array syntax for adding multiple values in a patch call用于在补丁调用中添加多个值的 gcloud 数组语法
【发布时间】:2014-07-01 00:20:53
【问题描述】:

我已安装 gcloud 来管理我的 CloudSQL 实例和我的 GAE 应用程序之间的关系。

我有一些需要连接到其中一个数据库的应用程序,我正在尝试自动化添加新 GAE 应用程序的过程,这是简化部署过程的一部分。

我正在尝试使用patch 命令,但是对于数组,它会覆盖整个值,所以我需要传递一个完整的数组。除了,我无法弄清楚这样做的精确语法。这是我最好的猜测。

$ gcloud sql instances patch projectname:databasename --authorized-gae-apps="testappid1,testappid2" 

This command will change the instance settings.
All arrays must be fully-specified. Any previous data in an array will be overwritten with the given list.
The following JSON message will be used for the patch API method.
{'instance': 'test', 'settings': {'authorizedGaeApplications': ['testappid1,testappid2']}}
Do you want to continue (Y/n)?  Y

ERROR: (gcloud.sql.instances.patch) ResponseError: status=400, code=Bad Request, reason=invalid
message=Invalid Value

它似乎将应用程序作为数组中的字符串发送,而不是将每个值分开。我尝试了其他一些方法,但我没有尝试成功地将命令行参数转换为 JSON 中的多项数组。

如果我做这样的事情(只设置一个应用程序),它可以工作,但它会覆盖完整的值,这不是我想要的:

gcloud sql instances patch projectname:databasename --authorized-gae-apps="testappid1" 

如何让gcloud 让我从命令行指定多个授权的 GAE 应用程序?

【问题讨论】:

    标签: google-app-engine google-cloud-sql gcloud


    【解决方案1】:

    试试这样:

    gcloud sql instances patch projectname:databasename --authorized-gae-apps testappid1 testappid2

    【讨论】:

    • 是的,做到了。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2017-05-07
    • 1970-01-01
    • 2023-04-03
    • 2015-06-18
    • 2021-02-22
    • 2020-03-20
    • 2020-10-26
    • 1970-01-01
    相关资源
    最近更新 更多