我已经安装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 应用程序?