关闭金丝雀版本 - Amazon API Gateway
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

关闭金丝雀版本

要关闭金丝雀版本部署,请将 canarySettings 设置为 Null 以从阶段中删除它。

您可以使用 API Gateway 控制台、Amazon CLI 或Amazon开发工具包禁用 Canary 版本部署。

使用 API Gateway 控制台关闭金丝雀版本

要使用 API Gateway 控制台关闭金丝雀版本部署,请执行以下步骤:

关闭金丝雀版本部署
  1. 登录 API Gateway 控制台并在主导航窗格中选择现有 API。

  2. 在主导航窗格中,选择阶段,然后选择一个现有阶段。

  3. 选择金丝雀选项卡。

  4. 选择 删除

  5. 选择 Delete (删除) 确认您要删除 Canary。

结果,canarySettings 属性变为 null,并从部署阶段中删除。您可以使用 Amazon CLI 验证此项。有关示例,请查看使用 Amazon CLI 关闭金丝雀版本

使用 Amazon CLI 关闭金丝雀版本

要使用 Amazon CLI 关闭金丝雀版本部署,请按以下所示调用 update-stage 命令:

aws apigateway update-stage \ --rest-api-id abcd1234 \ --stage-name canary \ --patch-operations '[{"op":"remove", "path":"/canarySettings"}]'

成功的响应返回与以下类似的负载:

{ "stageName": "prod", "accessLogSettings": { ... }, "cacheClusterEnabled": false, "cacheClusterStatus": "NOT_AVAILABLE", "deploymentId": "nfcn0x", "lastUpdatedDate": 1511309280, "createdDate": 1511152939, "methodSettings": { ... } }

如输出中所示,canarySettings 属性不再存在于已禁用 Canary 的部署的阶段中。