Amazon API Gateway

2016/08/16 - Amazon API Gateway - 12 new 6 updated api methods

Changes  Amazon API Gateway now supports API usage plans. Usage plans allows you to easily manage and monetize your APIs for your API-based business.

DeleteUsagePlanKey (new) Link ¶

Deletes a usage plan key and remove the underlying API key from the associated usage plan.

Request Syntax

client.delete_usage_plan_key(
    usagePlanId='string',
    keyId='string'
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The Id of the UsagePlan resource representing the usage plan containing the to-be-deleted UsagePlanKey resource representing a plan customer.

type keyId

string

param keyId

[REQUIRED]

The Id of the UsagePlanKey resource to be deleted.

returns

None

GetUsagePlanKey (new) Link ¶

Gets a usage plan key of a given key identifier.

Request Syntax

client.get_usage_plan_key(
    usagePlanId='string',
    keyId='string'
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.

type keyId

string

param keyId

[REQUIRED]

The key Id of the to-be-retrieved UsagePlanKey resource representing a plan customer.

rtype

dict

returns

Response Syntax

{
    'id': 'string',
    'type': 'string',
    'value': 'string',
    'name': 'string'
}

Response Structure

  • (dict) --

    Represents a usage plan key to identify a plan customer.

    To associate an API stage with a selected API key in a usage plan, you must create a UsagePlanKey resource to represent the selected ApiKey.

    " Create and Use Usage Plans

    • id (string) --

      The Id of a usage plan key.

    • type (string) --

      The type of a usage plan key. Currently, the valid key type is API_KEY .

    • value (string) --

      The value of a usage plan key.

    • name (string) --

      The name of a usage plan key.

ImportApiKeys (new) Link ¶

Import API keys from an external source, such as a CSV-formatted file.

Request Syntax

client.import_api_keys(
    body=b'bytes'|file,
    format='csv',
    failOnWarnings=True|False
)
type body

bytes or seekable file-like object

param body

[REQUIRED]

The payload of the POST request to import API keys. For the payload format, see API Key File Format.

type format

string

param format

[REQUIRED]

A query parameter to specify the input format to imported API keys. Currently, only the csv format is supported.

type failOnWarnings

boolean

param failOnWarnings

A query parameter to indicate whether to rollback ApiKey importation ( true ) or not ( false ) when error is encountered.

rtype

dict

returns

Response Syntax

{
    'ids': [
        'string',
    ],
    'warnings': [
        'string',
    ]
}

Response Structure

  • (dict) --

    The identifier of an API key used to reference an API key in a usage plan.

    • ids (list) --

      A list of all the ApiKey identifiers.

      • (string) --

    • warnings (list) --

      A list of warning messages.

      • (string) --

GetUsage (new) Link ¶

Gets the usage data of a usage plan in a specified time interval.

Request Syntax

client.get_usage(
    usagePlanId='string',
    keyId='string',
    startDate='string',
    endDate='string',
    position='string',
    limit=123
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The Id of the usage plan associated with the usage data.

type keyId

string

param keyId

The Id of the API key associated with the resultant usage data.

type startDate

string

param startDate

[REQUIRED]

The starting date (e.g., 2016-01-01) of the usage data.

type endDate

string

param endDate

[REQUIRED]

The ending date (e.g., 2016-12-31) of the usage data.

type position

string

param position

Position

type limit

integer

param limit

The maximum number of results to be returned.

rtype

dict

returns

Response Syntax

{
    'usagePlanId': 'string',
    'startDate': 'string',
    'endDate': 'string',
    'position': 'string',
    'items': {
        'string': [
            [
                123,
            ],
        ]
    }
}

Response Structure

  • (dict) --

    Represents the usage data of a usage plan.

    Create and Use Usage Plans, Manage Usage in a Usage Plan

    • usagePlanId (string) --

      The plan Id associated with this usage data.

    • startDate (string) --

      The starting date of the usage data.

    • endDate (string) --

      The ending date of the usage data.

    • position (string) --

    • items (dict) --

      The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, {..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]} , where {api_key} stands for an API key value and the daily log entry is of the format [used quota, remaining quota] .

      • (string) --

        • (list) --

          • (list) --

            • (integer) --

GetUsagePlans (new) Link ¶

Gets all the usage plans of the caller's account.

Request Syntax

client.get_usage_plans(
    position='string',
    keyId='string',
    limit=123
)
type position

string

param position

The zero-based array index specifying the position of the to-be-retrieved UsagePlan resource.

type keyId

string

param keyId

The identifier of the API key associated with the usage plans.

type limit

integer

param limit

The number of UsagePlan resources to be returned as the result.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    Represents a collection of usage plans for an AWS account.

    Create and Use Usage Plans

    • position (string) --

    • items (list) --

      Gets the current item when enumerating the collection of UsagePlan.

      • (dict) --

        Represents a usage plan than can specify who can assess associated API stages with specified request limits and quotas.

        In a usage plan, you associate an API by specifying the API's Id and a stage name of the specified API. You add plan customers by adding API keys to the plan.

        Create and Use Usage Plans

        • 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) --

          The request throttle limits of a usage plan.

          • burstLimit (integer) --

            The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

          • rateLimit (float) --

            The API request steady-state rate limit.

        • quota (dict) --

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

          • limit (integer) --

            The 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".

UpdateUsage (new) Link ¶

Grants a temporary extension to the reamining quota of a usage plan associated with a specified API key.

Request Syntax

client.update_usage(
    usagePlanId='string',
    keyId='string',
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The Id of the usage plan associated with the usage data.

type keyId

string

param keyId

[REQUIRED]

The identifier of the API key associated with the usage plan in which a temporary extension is granted to the remaining quota.

type patchOperations

list

param patchOperations

A list of update operations to be applied to the specified resource and in the order specified in this list.

  • (dict) -- A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.

    • op (string) --

      An update operation to be performed with this PATCH request. The valid value can be "add", "remove", or "replace". 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.

    • from (string) --

      Not supported.

rtype

dict

returns

Response Syntax

{
    'usagePlanId': 'string',
    'startDate': 'string',
    'endDate': 'string',
    'position': 'string',
    'items': {
        'string': [
            [
                123,
            ],
        ]
    }
}

Response Structure

  • (dict) --

    Represents the usage data of a usage plan.

    Create and Use Usage Plans, Manage Usage in a Usage Plan

    • usagePlanId (string) --

      The plan Id associated with this usage data.

    • startDate (string) --

      The starting date of the usage data.

    • endDate (string) --

      The ending date of the usage data.

    • position (string) --

    • items (dict) --

      The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, {..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]} , where {api_key} stands for an API key value and the daily log entry is of the format [used quota, remaining quota] .

      • (string) --

        • (list) --

          • (list) --

            • (integer) --

DeleteUsagePlan (new) Link ¶

Deletes a usage plan of a given plan Id.

Request Syntax

client.delete_usage_plan(
    usagePlanId='string'
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

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

returns

None

CreateUsagePlanKey (new) Link ¶

Creates a usage plan key for adding an existing API key to a usage plan.

Request Syntax

client.create_usage_plan_key(
    usagePlanId='string',
    keyId='string',
    keyType='string'
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The Id of the UsagePlan resource representing the usage plan containing the to-be-created UsagePlanKey resource representing a plan customer.

type keyId

string

param keyId

[REQUIRED]

The identifier of a UsagePlanKey resource for a plan customer.

type keyType

string

param keyType

[REQUIRED]

The type of a UsagePlanKey resource for a plan customer.

rtype

dict

returns

Response Syntax

{
    'id': 'string',
    'type': 'string',
    'value': 'string',
    'name': 'string'
}

Response Structure

  • (dict) --

    Represents a usage plan key to identify a plan customer.

    To associate an API stage with a selected API key in a usage plan, you must create a UsagePlanKey resource to represent the selected ApiKey.

    " Create and Use Usage Plans

    • id (string) --

      The Id of a usage plan key.

    • type (string) --

      The type of a usage plan key. Currently, the valid key type is API_KEY .

    • value (string) --

      The value of a usage plan key.

    • name (string) --

      The name of a usage plan key.

GetUsagePlan (new) Link ¶

Gets a usage plan of a given plan identifier.

Request Syntax

client.get_usage_plan(
    usagePlanId='string'
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The identifier of the UsagePlan resource to be retrieved.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    Represents a usage plan than can specify who can assess associated API stages with specified request limits and quotas.

    In a usage plan, you associate an API by specifying the API's Id and a stage name of the specified API. You add plan customers by adding API keys to the plan.

    Create and Use Usage Plans

    • 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) --

      The request throttle limits of a usage plan.

      • burstLimit (integer) --

        The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

      • rateLimit (float) --

        The API request steady-state rate limit.

    • quota (dict) --

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

      • limit (integer) --

        The 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".

CreateUsagePlan (new) Link ¶

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

Request Syntax

client.create_usage_plan(
    name='string',
    description='string',
    apiStages=[
        {
            'apiId': 'string',
            'stage': 'string'
        },
    ],
    throttle={
        'burstLimit': 123,
        'rateLimit': 123.0
    },
    quota={
        'limit': 123,
        'offset': 123,
        'period': 'DAY'|'WEEK'|'MONTH'
    }
)
type name

string

param name

[REQUIRED]

The name of the usage plan.

type description

string

param description

The description of the usage plan.

type apiStages

list

param apiStages

The associated API stages of the 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.

type throttle

dict

param throttle

The throttling limits of the usage plan.

  • burstLimit (integer) --

    The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

  • rateLimit (float) --

    The API request steady-state rate limit.

type quota

dict

param quota

The quota of the usage plan.

  • limit (integer) --

    The 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".

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    Represents a usage plan than can specify who can assess associated API stages with specified request limits and quotas.

    In a usage plan, you associate an API by specifying the API's Id and a stage name of the specified API. You add plan customers by adding API keys to the plan.

    Create and Use Usage Plans

    • 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) --

      The request throttle limits of a usage plan.

      • burstLimit (integer) --

        The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

      • rateLimit (float) --

        The API request steady-state rate limit.

    • quota (dict) --

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

      • limit (integer) --

        The 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".

GetUsagePlanKeys (new) Link ¶

Gets all the usage plan keys representing the API keys added to a specified usage plan.

Request Syntax

client.get_usage_plan_keys(
    usagePlanId='string',
    position='string',
    limit=123,
    nameQuery='string'
)
type usagePlanId

string

param usagePlanId

[REQUIRED]

The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.

type position

string

param position

A query parameter specifying the zero-based index specifying the position of a usage plan key.

type limit

integer

param limit

A query parameter specifying the maximum number usage plan keys returned by the GET request.

type nameQuery

string

param nameQuery

A query parameter specifying the name of the to-be-returned usage plan keys.

rtype

dict

returns

Response Syntax

{
    'position': 'string',
    'items': [
        {
            'id': 'string',
            'type': 'string',
            'value': 'string',
            'name': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the collection of usage plan keys added to usage plans for the associated API keys and, possibly, other types of keys.

    Create and Use Usage Plans

    • position (string) --

    • items (list) --

      Gets the current item of the usage plan keys collection.

      • (dict) --

        Represents a usage plan key to identify a plan customer.

        To associate an API stage with a selected API key in a usage plan, you must create a UsagePlanKey resource to represent the selected ApiKey.

        " Create and Use Usage Plans

        • id (string) --

          The Id of a usage plan key.

        • type (string) --

          The type of a usage plan key. Currently, the valid key type is API_KEY .

        • value (string) --

          The value of a usage plan key.

        • name (string) --

          The name of a usage plan key.

UpdateUsagePlan (new) Link ¶

Updates a usage plan of a given plan Id.

Request Syntax

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

string

param usagePlanId

[REQUIRED]

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

type patchOperations

list

param patchOperations

A list of update operations to be applied to the specified resource and in the order specified in this list.

  • (dict) -- A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.

    • op (string) --

      An update operation to be performed with this PATCH request. The valid value can be "add", "remove", or "replace". 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.

    • from (string) --

      Not supported.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    Represents a usage plan than can specify who can assess associated API stages with specified request limits and quotas.

    In a usage plan, you associate an API by specifying the API's Id and a stage name of the specified API. You add plan customers by adding API keys to the plan.

    Create and Use Usage Plans

    • 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) --

      The request throttle limits of a usage plan.

      • burstLimit (integer) --

        The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

      • rateLimit (float) --

        The API request steady-state rate limit.

    • quota (dict) --

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

      • limit (integer) --

        The 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".

CreateApiKey (updated) Link ¶
Changes (request, response)
Request
{'generateDistinctId': 'boolean', 'value': 'string'}
Response
{'value': 'string'}

Create an ApiKey resource.

AWS CLI

Request Syntax

client.create_api_key(
    name='string',
    description='string',
    enabled=True|False,
    generateDistinctId=True|False,
    value='string',
    stageKeys=[
        {
            'restApiId': 'string',
            'stageName': 'string'
        },
    ]
)
type name

string

param name

The name of the ApiKey.

type description

string

param description

The description of the ApiKey.

type enabled

boolean

param enabled

Specifies whether the ApiKey can be used by callers.

type generateDistinctId

boolean

param generateDistinctId

Specifies whether ( true ) or not ( false ) the key identifier is distinct from the created API key value.

type value

string

param value

Specifies a value of the API key.

type stageKeys

list

param stageKeys

DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.

  • (dict) --

    A reference to a unique stage identified in the format {restApiId}/{stage} .

    • restApiId (string) --

      A list of Stage resources that are associated with the ApiKey resource.

    • stageName (string) --

      The stage name in the RestApi that the stage key references.

rtype

dict

returns

Response Syntax

{
    'id': 'string',
    'value': 'string',
    'name': 'string',
    'description': 'string',
    'enabled': True|False,
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1),
    'stageKeys': [
        'string',
    ]
}

Response Structure

  • (dict) --

    A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.

    Use API Keys

    • id (string) --

      The identifier of the API Key.

    • value (string) --

      The value of the API Key.

    • name (string) --

      The name of the API Key.

    • description (string) --

      The description of the API Key.

    • enabled (boolean) --

      Specifies whether the API Key can be used by callers.

    • createdDate (datetime) --

      The date when the API Key was created, in ISO 8601 format.

    • lastUpdatedDate (datetime) --

      When the API Key was last updated, in ISO 8601 format.

    • stageKeys (list) --

      A list of Stage resources that are associated with the ApiKey resource.

      • (string) --

GetAccount (updated) Link ¶
Changes (response)
{'apiKeyVersion': 'string', 'features': ['string']}

Gets information about the current Account resource.

Request Syntax

client.get_account()
rtype

dict

returns

Response Syntax

{
    'cloudwatchRoleArn': 'string',
    'throttleSettings': {
        'burstLimit': 123,
        'rateLimit': 123.0
    },
    'features': [
        'string',
    ],
    'apiKeyVersion': 'string'
}

Response Structure

  • (dict) --

    Represents an AWS account that is associated with Amazon API Gateway.

    To view the account info, call GET on this resource.

    Error Codes

    The following exception may be thrown when the request fails.

    • UnauthorizedException

    • NotFoundException

    • TooManyRequestsException

    For detailed error code information, including the corresponding HTTP Status Codes, see API Gateway Error Codes

    Example: Get the information about an account. Request GET /account HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160531T184618Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} Response

    The successful response returns a 200 OK status code and a payload similar to the following:

    { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/account-apigateway-{rel}.html", "name": "account", "templated": true }, "self": { "href": "/account" }, "account:update": { "href": "/account" } }, "cloudwatchRoleArn": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "throttleSettings": { "rateLimit": 500, "burstLimit": 1000 } }

    In addition to making the REST API call directly, you can use the AWS CLI and an AWS SDK to access this resource.

    API Gateway Limits Developer Guide, AWS CLI

    • cloudwatchRoleArn (string) --

      The ARN of an Amazon CloudWatch role for the current Account.

    • throttleSettings (dict) --

      Specifies the API request limits configured for the current Account.

      • burstLimit (integer) --

        The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

      • rateLimit (float) --

        The API request steady-state rate limit.

    • features (list) --

      A list of features supported for the account. When usage plans are enabled, the features list will include an entry of "UsagePlans" .

      • (string) --

    • apiKeyVersion (string) --

      The version of the API keys used for the account.

GetApiKey (updated) Link ¶
Changes (request, response)
Request
{'includeValue': 'boolean'}
Response
{'value': 'string'}

Gets information about the current ApiKey resource.

Request Syntax

client.get_api_key(
    apiKey='string',
    includeValue=True|False
)
type apiKey

string

param apiKey

[REQUIRED]

The identifier of the ApiKey resource.

type includeValue

boolean

param includeValue

A boolean flag to specify whether ( true ) or not ( false ) the result contains the key value.

rtype

dict

returns

Response Syntax

{
    'id': 'string',
    'value': 'string',
    'name': 'string',
    'description': 'string',
    'enabled': True|False,
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1),
    'stageKeys': [
        'string',
    ]
}

Response Structure

  • (dict) --

    A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.

    Use API Keys

    • id (string) --

      The identifier of the API Key.

    • value (string) --

      The value of the API Key.

    • name (string) --

      The name of the API Key.

    • description (string) --

      The description of the API Key.

    • enabled (boolean) --

      Specifies whether the API Key can be used by callers.

    • createdDate (datetime) --

      The date when the API Key was created, in ISO 8601 format.

    • lastUpdatedDate (datetime) --

      When the API Key was last updated, in ISO 8601 format.

    • stageKeys (list) --

      A list of Stage resources that are associated with the ApiKey resource.

      • (string) --

GetApiKeys (updated) Link ¶
Changes (request, response)
Request
{'includeValues': 'boolean', 'nameQuery': 'string'}
Response
{'items': {'value': 'string'}, 'warnings': ['string']}

Gets information about the current ApiKeys resource.

Request Syntax

client.get_api_keys(
    position='string',
    limit=123,
    nameQuery='string',
    includeValues=True|False
)
type position

string

param position

The position of the current ApiKeys resource to get information about.

type limit

integer

param limit

The maximum number of ApiKeys to get information about.

type nameQuery

string

param nameQuery

The name of queried API keys.

type includeValues

boolean

param includeValues

A boolean flag to specify whether ( true ) or not ( false ) the result contains key values.

rtype

dict

returns

Response Syntax

{
    'warnings': [
        'string',
    ],
    'position': 'string',
    'items': [
        {
            'id': 'string',
            'value': 'string',
            'name': 'string',
            'description': 'string',
            'enabled': True|False,
            'createdDate': datetime(2015, 1, 1),
            'lastUpdatedDate': datetime(2015, 1, 1),
            'stageKeys': [
                'string',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    Represents a collection of API keys as represented by an ApiKeys resource.

    Use API Keys

    • warnings (list) --

      A list of warning messages logged during the import of API keys when the failOnWarnings option is set to true.

      • (string) --

    • position (string) --

    • items (list) --

      The current page of any ApiKey resources in the collection of ApiKey resources.

      • (dict) --

        A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.

        Use API Keys

        • id (string) --

          The identifier of the API Key.

        • value (string) --

          The value of the API Key.

        • name (string) --

          The name of the API Key.

        • description (string) --

          The description of the API Key.

        • enabled (boolean) --

          Specifies whether the API Key can be used by callers.

        • createdDate (datetime) --

          The date when the API Key was created, in ISO 8601 format.

        • lastUpdatedDate (datetime) --

          When the API Key was last updated, in ISO 8601 format.

        • stageKeys (list) --

          A list of Stage resources that are associated with the ApiKey resource.

          • (string) --

UpdateAccount (updated) Link ¶
Changes (response)
{'apiKeyVersion': 'string', 'features': ['string']}

Changes information about the current Account resource.

Request Syntax

client.update_account(
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
type patchOperations

list

param patchOperations

A list of update operations to be applied to the specified resource and in the order specified in this list.

  • (dict) -- A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.

    • op (string) --

      An update operation to be performed with this PATCH request. The valid value can be "add", "remove", or "replace". 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.

    • from (string) --

      Not supported.

rtype

dict

returns

Response Syntax

{
    'cloudwatchRoleArn': 'string',
    'throttleSettings': {
        'burstLimit': 123,
        'rateLimit': 123.0
    },
    'features': [
        'string',
    ],
    'apiKeyVersion': 'string'
}

Response Structure

  • (dict) --

    Represents an AWS account that is associated with Amazon API Gateway.

    To view the account info, call GET on this resource.

    Error Codes

    The following exception may be thrown when the request fails.

    • UnauthorizedException

    • NotFoundException

    • TooManyRequestsException

    For detailed error code information, including the corresponding HTTP Status Codes, see API Gateway Error Codes

    Example: Get the information about an account. Request GET /account HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160531T184618Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} Response

    The successful response returns a 200 OK status code and a payload similar to the following:

    { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/account-apigateway-{rel}.html", "name": "account", "templated": true }, "self": { "href": "/account" }, "account:update": { "href": "/account" } }, "cloudwatchRoleArn": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "throttleSettings": { "rateLimit": 500, "burstLimit": 1000 } }

    In addition to making the REST API call directly, you can use the AWS CLI and an AWS SDK to access this resource.

    API Gateway Limits Developer Guide, AWS CLI

    • cloudwatchRoleArn (string) --

      The ARN of an Amazon CloudWatch role for the current Account.

    • throttleSettings (dict) --

      Specifies the API request limits configured for the current Account.

      • burstLimit (integer) --

        The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.

      • rateLimit (float) --

        The API request steady-state rate limit.

    • features (list) --

      A list of features supported for the account. When usage plans are enabled, the features list will include an entry of "UsagePlans" .

      • (string) --

    • apiKeyVersion (string) --

      The version of the API keys used for the account.

UpdateApiKey (updated) Link ¶
Changes (response)
{'value': 'string'}

Changes information about an ApiKey resource.

Request Syntax

client.update_api_key(
    apiKey='string',
    patchOperations=[
        {
            'op': 'add'|'remove'|'replace'|'move'|'copy'|'test',
            'path': 'string',
            'value': 'string',
            'from': 'string'
        },
    ]
)
type apiKey

string

param apiKey

[REQUIRED]

The identifier of the ApiKey resource to be updated.

type patchOperations

list

param patchOperations

A list of update operations to be applied to the specified resource and in the order specified in this list.

  • (dict) -- A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.

    • op (string) --

      An update operation to be performed with this PATCH request. The valid value can be "add", "remove", or "replace". 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.

    • from (string) --

      Not supported.

rtype

dict

returns

Response Syntax

{
    'id': 'string',
    'value': 'string',
    'name': 'string',
    'description': 'string',
    'enabled': True|False,
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1),
    'stageKeys': [
        'string',
    ]
}

Response Structure

  • (dict) --

    A resource that can be distributed to callers for executing Method resources that require an API key. API keys can be mapped to any Stage on any RestApi, which indicates that the callers with the API key can make requests to that stage.

    Use API Keys

    • id (string) --

      The identifier of the API Key.

    • value (string) --

      The value of the API Key.

    • name (string) --

      The name of the API Key.

    • description (string) --

      The description of the API Key.

    • enabled (boolean) --

      Specifies whether the API Key can be used by callers.

    • createdDate (datetime) --

      The date when the API Key was created, in ISO 8601 format.

    • lastUpdatedDate (datetime) --

      When the API Key was last updated, in ISO 8601 format.

    • stageKeys (list) --

      A list of Stage resources that are associated with the ApiKey resource.

      • (string) --