CmdID

CmdID / aws / aws apigateway

aws apigateway update-usage-plan

Updates a usage plan of a given plan Id. AWS CLI reference

4 examples 2 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To change the period defined in a Usage Plan

The following update-usage-plan example changes the period defined in a Usage Plan.

aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/quota/period",value="MONTH"Identify
--usage-plan-idThe Id of the to-be-updated usage plan.
--patch-operationsFor more information about supported patch operations, see Patch Operations.
Its output
{
    "id": "a1b2c3",
    "name": "MyUsagePlan",
    "description": "My usage plan",
    "apiStages": [
        {
            "apiId": "1234123412",
            "stage": "dev"
        }
    ],
    "throttle": {
        "burstLimit": 100,
        "rateLimit": 50.0
    },
    "quota": {
        "limit": 5000,
        "offset": 0,
        "period": "MONTH"
    }
}

Example 2: To change the quota limit defined in a Usage Plan

The following update-usage-plan example changes the quota limit defined in a Usage Plan.

aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/quota/limit",value="500"Identify
--usage-plan-idThe Id of the to-be-updated usage plan.
--patch-operationsFor more information about supported patch operations, see Patch Operations.
Its output
{
    "id": "a1b2c3",
    "name": "MyUsagePlan",
    "description": "My usage plan",
    "apiStages": [
        {
            "apiId": "1234123412",
            "stage": "dev"
        }
    ],
    "throttle": {
        "burstLimit": 100,
        "rateLimit": 50.0
    },
    "quota": {
        "limit": 500,
        "offset": 0,
        "period": "MONTH"
    }
}

Example 3: To change the throttle rate limit defined in a Usage Plan

The following update-usage-plan example changes the throttle rate limit defined in a Usage Plan.

aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/throttle/rateLimit",value="10"Identify
--usage-plan-idThe Id of the to-be-updated usage plan.
--patch-operationsFor more information about supported patch operations, see Patch Operations.
Its output
{
    "id": "a1b2c3",
    "name": "MyUsagePlan",
    "description": "My usage plan",
    "apiStages": [
        {
            "apiId": "1234123412",
            "stage": "dev"
        }
    ],
    "throttle": {
        "burstLimit": 100,
        "rateLimit": 10.0
    },
    "quota": {
        "limit": 5000,
        "offset": 0,
        "period": "MONTH"
    }
}

Example 4: To change the throttle burst limit defined in a Usage Plan

The following update-usage-plan example changes the throttle burst limit defined in a Usage Plan.

aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/throttle/burstLimit",value="20"Identify
--usage-plan-idThe Id of the to-be-updated usage plan.
--patch-operationsFor more information about supported patch operations, see Patch Operations.
Its output
{
    "id": "a1b2c3",
    "name": "MyUsagePlan",
    "description": "My usage plan",
    "apiStages": [
        {
            "apiId": "1234123412",
            "stage": "dev"
        }
    ],
    "throttle": {
        "burstLimit": 20,
        "rateLimit": 50.0
    },
    "quota": {
        "limit": 5000,
        "offset": 0,
        "period": "MONTH"
    }
}

For more information, see Set up usage plans for REST APIs in API Gateway in the Amazon API Gateway Developer Guide.

Options

2 in the AWS CLI reference
--patch-operationsFor more information about supported patch operations, see Patch Operations.
--usage-plan-idThe Id of the to-be-updated usage plan.