【发布时间】:2021-01-31 21:54:29
【问题描述】:
我正在尝试使用 aws-sdk apigateway 创建使用计划,但收到错误响应。
这是我正在使用的功能:
const params = {
name: 'My usage plan',
description: 'My plan for checking the usage',
apiStages: [
{
apiId: 'b3mzhze48g',
stage: 'dev',
throttle: {
string: {
burstLimit: 4,
rateLimit: 8,
},
},
},
],
throttle: {
burstLimit: 5,
rateLimit: 10,
},
quota: {
limit: 100,
offset: 1,
period: 'WEEK',
},
};
try {
const result = await apigateway.createUsagePlan(params).promise();
res.send(result);
} catch (err) {
res.send(err);
}
这是我的 API 的 id 图像:
这是我收到的错误消息:
{
"message": "Invalid method {resourcePath: string,method: } specified",
"code": "BadRequestException",
"time": "2021-01-31T10:58:28.117Z",
"requestId": "6d175534-e555-4a0d-99ef-1f3fc628e502",
"statusCode": 400,
"retryable": false,
"retryDelay": 80.40030962554764
}
我应该如何修改 apiStages 参数才能在我的 API 中设置特定资源的使用计划?
【问题讨论】:
标签: aws-api-gateway aws-sdk aws-sdk-nodejs