Google API网关:通过gcloud CLI分配配置



我正在寻找一种自动更新Google API网关配置的方法,即更改";API网关";一步到位。

到目前为止我所尝试的,假设新的API配置名称是";我的新配置";API网关名称为";我的网关":

  1. > gcloud beta api-gateway gateways update my-gateway --api-config=my-new-config --location=us-central1
    输出:
    ERROR: (gcloud.beta.api-gateway.gateways.update) INVALID_ARGUMENT: update_mask does not contain any field paths
  2. > gcloud beta api-gateway gateways update my-gateway --api-config=my-new-config --location=us-central1 --display-name random-string-for-display-name
    输出:
    命令执行成功,但未应用配置更改

gcloud版本:333.0.0
OS:Debian-linux
我在谷歌的问题跟踪器中创建了两个票证(一个、两个(,但三周后就没有活动了。

您尝试更新api-gatewayapi-config,这里api是必需的标志:

从文档中,当指定第一个时,第二个是强制性的:

[--api-config=API_CONFIG : --api=API]

api-config:如果指定了该组中的任何其他参数,则必须指定此标志。

添加--api后,可以使用新的api-config更新网关

尝试使用aplha而不是beta,并指定de API ID标志(--api(:

gcloud alpha api-gateway gateways update my-gateway --api=api-id --api-config=my-new-config --location=us-central1

步骤2中缺少--api标志,这似乎是必需的。如果没有具体说明,它就不会提出正确的请求。

最新更新