APIGateway / Client / update_usage_plan

update_usage_plan#

APIGateway.Client.update_usage_plan(**kwargs)#

Updates a usage plan of a given plan Id.

See also: AWS API Documentation

Request Syntax

response = client.update_usage_plan(
    usagePlanId='string',
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
Parameters:
  • usagePlanId (string) –

    [REQUIRED]

    The Id of the to-be-updated usage plan.

  • patchOperations (list) –

    For more information about supported patch operations, see Patch Operations.

    • (dict) –

      For more information about supported patch operations, see Patch Operations.

      • op (string) –

        An update operation to be performed with this PATCH request. The valid value can be add, remove, replace or copy. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message..

      • path (string) –

        The op operation’s target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of {“name”:”value”}, the path for this property is /name. If the name property value is a JSON object (e.g., {“name”: {“child/name”: “child-value”}}), the path for the child/name property will be /name/child~1name. Any slash (“/”) character appearing in path names must be escaped with “~1”, as shown in the example above. Each op operation can have only one path associated with it.

      • value (string) –

        The new target value of the update operation. It is applicable for the add or replace operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., ‘{“a”: …}’.

      • from (string) –

        The copy update operation’s source as identified by a JSON-Pointer value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with “op”:”copy”, “from”:”/canarySettings/deploymentId” and “path”:”/deploymentId”.

Return type:

dict

Returns:

Response Syntax

{
    'id': 'string',
    'name': 'string',
    'description': 'string',
    'apiStages': [
        {
            'apiId': 'string',
            'stage': 'string',
            'throttle': {
                'string': {
                    'burstLimit': 123,
                    'rateLimit': 123.0
                }
            }
        },
    ],
    'throttle': {
        'burstLimit': 123,
        'rateLimit': 123.0
    },
    'quota': {
        'limit': 123,
        'offset': 123,
        'period': 'DAY'|'WEEK'|'MONTH'
    },
    'productCode': 'string',
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    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.

    • id (string) –

      The identifier of a UsagePlan resource.

    • name (string) –

      The name of a usage plan.

    • description (string) –

      The description of a usage plan.

    • apiStages (list) –

      The associated API stages of a usage plan.

      • (dict) –

        API stage name of the associated API stage in a usage plan.

        • apiId (string) –

          API Id of the associated API stage in a usage plan.

        • stage (string) –

          API stage name of the associated API stage in a usage plan.

        • throttle (dict) –

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

          • (string) –

            • (dict) –

              The API request rate limits.

              • burstLimit (integer) –

                The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.

              • rateLimit (float) –

                The API target request rate limit.

    • throttle (dict) –

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

      • burstLimit (integer) –

        The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.

      • rateLimit (float) –

        The API target request rate limit.

    • quota (dict) –

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

      • limit (integer) –

        The target maximum number of requests that can be made in a given time period.

      • offset (integer) –

        The number of requests subtracted from the given limit in the initial time period.

      • period (string) –

        The time period in which the limit applies. Valid values are “DAY”, “WEEK” or “MONTH”.

    • productCode (string) –

      The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.

    • tags (dict) –

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

      • (string) –

        • (string) –

Exceptions

  • APIGateway.Client.exceptions.BadRequestException

  • APIGateway.Client.exceptions.ConflictException

  • APIGateway.Client.exceptions.LimitExceededException

  • APIGateway.Client.exceptions.NotFoundException

  • APIGateway.Client.exceptions.UnauthorizedException

  • APIGateway.Client.exceptions.TooManyRequestsException