Skip to content

Api Gateway  >  Operations  >  create_usage_plan

create_usage_plan

Operation

create_usage_plan async

create_usage_plan(input: CreateUsagePlanInput, plugins: list[Plugin] | None = None) -> CreateUsagePlanOutput

Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.

Parameters:

Name Type Description Default
input CreateUsagePlanInput

An instance of CreateUsagePlanInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateUsagePlanOutput

An instance of CreateUsagePlanOutput.

Input

CreateUsagePlanInput dataclass

The POST request to create a usage plan with the name, description, throttle limits and quota limits, as well as the associated API stages, specified in the payload.

Attributes

api_stages class-attribute instance-attribute
api_stages: list[ApiStage] | None = None

The associated API stages of the usage plan.

description class-attribute instance-attribute
description: str | None = None

The description of the usage plan.

name class-attribute instance-attribute
name: str | None = None

The name of the usage plan.

quota class-attribute instance-attribute
quota: QuotaSettings | None = None

The quota of the usage plan.

tags class-attribute instance-attribute
tags: dict[str, str] | None = None

The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.

throttle class-attribute instance-attribute
throttle: ThrottleSettings | None = None

The throttling limits of the usage plan.

Output

CreateUsagePlanOutput dataclass

Represents a usage plan used to specify who can assess associated API stages. Optionally, target request rate and quota limits can be set. In some cases clients can exceed the targets that you set. Don't rely on usage plans to control costs. Consider using Amazon Web Services Budgets to monitor costs and WAF to manage API requests.

Attributes

api_stages class-attribute instance-attribute
api_stages: list[ApiStage] | None = None

The associated API stages of a usage plan.

description class-attribute instance-attribute
description: str | None = None

The description of a usage plan.

id class-attribute instance-attribute
id: str | None = None

The identifier of a UsagePlan resource.

name class-attribute instance-attribute
name: str | None = None

The name of a usage plan.

product_code class-attribute instance-attribute
product_code: str | None = None

The Amazon Web Services Marketplace product identifier to associate with the usage plan as a SaaS product on the Amazon Web Services Marketplace.

quota class-attribute instance-attribute
quota: QuotaSettings | None = None

The target maximum number of permitted requests per a given unit time interval.

tags class-attribute instance-attribute
tags: dict[str, str] | None = None

The collection of tags. Each tag element is associated with a given resource.

throttle class-attribute instance-attribute
throttle: ThrottleSettings | None = None

A map containing method level throttling information for API stage in a usage plan.