We are excited to announce our new API Documentation.
Protected
Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.
Use a bare-bones client and the command you need to make an API call.
import { APIGatewayClient, CreateUsagePlanCommand } from "@aws-sdk/client-api-gateway"; // ES Modules import// const { APIGatewayClient, CreateUsagePlanCommand } = require("@aws-sdk/client-api-gateway"); // CommonJS importconst client = new APIGatewayClient(config);const input = { // CreateUsagePlanRequest name: "STRING_VALUE", // required description: "STRING_VALUE", apiStages: [ // ListOfApiStage { // ApiStage apiId: "STRING_VALUE", stage: "STRING_VALUE", throttle: { // MapOfApiStageThrottleSettings "<keys>": { // ThrottleSettings burstLimit: Number("int"), rateLimit: Number("double"), }, }, }, ], throttle: { burstLimit: Number("int"), rateLimit: Number("double"), }, quota: { // QuotaSettings limit: Number("int"), offset: Number("int"), period: "DAY" || "WEEK" || "MONTH", }, tags: { // MapOfStringToString "<keys>": "STRING_VALUE", },};const command = new CreateUsagePlanCommand(input);const response = await client.send(command);// { // UsagePlan// id: "STRING_VALUE",// name: "STRING_VALUE",// description: "STRING_VALUE",// apiStages: [ // ListOfApiStage// { // ApiStage// apiId: "STRING_VALUE",// stage: "STRING_VALUE",// throttle: { // MapOfApiStageThrottleSettings// "<keys>": { // ThrottleSettings// burstLimit: Number("int"),// rateLimit: Number("double"),// },// },// },// ],// throttle: {// burstLimit: Number("int"),// rateLimit: Number("double"),// },// quota: { // QuotaSettings// limit: Number("int"),// offset: Number("int"),// period: "DAY" || "WEEK" || "MONTH",// },// productCode: "STRING_VALUE",// tags: { // MapOfStringToString// "<keys>": "STRING_VALUE",// },// };
CreateUsagePlanCommandInput
CreateUsagePlanCommandOutput
input
response
config
BadRequestException (client fault)
The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
ConflictException (client fault)
The request configuration has conflicts. For details, see the accompanying error message.
LimitExceededException (client fault)
The request exceeded the rate limit. Retry after the specified time period.
NotFoundException (client fault)
The requested resource is not found. Make sure that the request URI is correct.
TooManyRequestsException (client fault)
The request has reached its throttling limit. Retry after the specified time period.
UnauthorizedException (client fault)
The request is denied because the caller has insufficient permissions.
APIGatewayServiceException
Base exception class for all service exceptions from APIGateway service.
Readonly
Static
Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.
Example
Use a bare-bones client and the command you need to make an API call.
Param
CreateUsagePlanCommandInput
Returns
CreateUsagePlanCommandOutput
See
input
shape.response
shape.config
shape.Throws
BadRequestException (client fault)
The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
Throws
ConflictException (client fault)
The request configuration has conflicts. For details, see the accompanying error message.
Throws
LimitExceededException (client fault)
The request exceeded the rate limit. Retry after the specified time period.
Throws
NotFoundException (client fault)
The requested resource is not found. Make sure that the request URI is correct.
Throws
TooManyRequestsException (client fault)
The request has reached its throttling limit. Retry after the specified time period.
Throws
UnauthorizedException (client fault)
The request is denied because the caller has insufficient permissions.
Throws
APIGatewayServiceException
Base exception class for all service exceptions from APIGateway service.