对于create-stage,我可以在MethodSetting
输出下的CreateStage
中获取CloudWatch设置,但在创建阶段或创建部署时无法设置设置。
答案 0 :(得分:1)
您应该能够使用patch request更新update-stage operation
的舞台的CloudWatch设置这是一个示例代码段(我还没有对此进行过测试;但基本原则应该有效):
AmazonApiGateway apiGateway = ...;
UpdateStageRequest req = new UpdateStageRequest().withRestApiId(<api-id>).
withStageName(<stage-name>).
withPatchOperations(
new PatchOperation().withPath("*/*/metrics/enabled")
.withOp("replace")
.withValue("true"));
apiGateway.upate(req);