get_usage
(**kwargs)¶Gets the usage data of a usage plan in a specified time interval.
See also: AWS API Documentation
Request Syntax
response = client.get_usage(
usagePlanId='string',
keyId='string',
startDate='string',
endDate='string',
position='string',
limit=123
)
[REQUIRED]
The Id of the usage plan associated with the usage data.
[REQUIRED]
The starting date (e.g., 2016-01-01) of the usage data.
[REQUIRED]
The ending date (e.g., 2016-12-31) of the usage data.
dict
Response Syntax
{
'usagePlanId': 'string',
'startDate': 'string',
'endDate': 'string',
'position': 'string',
'items': {
'string': [
[
123,
],
]
}
}
Response Structure
(dict) --
Represents the usage data of 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]
.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException