Skip to content

Api Gateway  >  Operations  >  get_usage

get_usage

Operation

get_usage async

get_usage(input: GetUsageInput, plugins: list[Plugin] | None = None) -> GetUsageOutput

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

Parameters:

Name Type Description Default
input GetUsageInput

An instance of GetUsageInput.

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
GetUsageOutput

An instance of GetUsageOutput.

Input

GetUsageInput dataclass

The GET request to get the usage data of a usage plan in a specified time interval.

Attributes

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

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

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

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

limit class-attribute instance-attribute
limit: int | None = None

The maximum number of returned results per page. The default value is 25 and the maximum value is 500.

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

The current pagination position in the paged result set.

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

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

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

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

Output

GetUsageOutput dataclass

Represents the usage data of a usage plan.

Attributes

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

The ending date of the usage data.

items class-attribute instance-attribute
items: dict[str, list[list[int]]] | None = None

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].

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

The current pagination position in the paged result set.

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

The starting date of the usage data.

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

The plan Id associated with this usage data.