get_usage¶
Operation¶
get_usage
¶
get_usage(request: GetUsageInput | GetUsageInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetUsageInputDict]) -> GetUsageOutput
Gets the usage data of a usage plan in a specified time interval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetUsageInput | GetUsageInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[GetUsageInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
GetUsageOutput
|
An instance of |
get_usage
async
¶
get_usage(request: GetUsageInput | GetUsageInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetUsageInputDict]) -> GetUsageOutput
Gets the usage data of a usage plan in a specified time interval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetUsageInput | GetUsageInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[GetUsageInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
GetUsageOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
GetUsageInputDict
¶
Bases: TypedDict
Dictionary form of GetUsageInput.
Attributes¶
end_date
instance-attribute
¶
The ending date (e.g., 2016-12-31) of the usage data.
key_id
instance-attribute
¶
key_id: str | None
The Id of the API key associated with the resultant usage data.
limit
instance-attribute
¶
limit: int | None
The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
position
instance-attribute
¶
position: str | None
The current pagination position in the paged result set.
start_date
instance-attribute
¶
The starting date (e.g., 2016-01-01) of the usage data.
GetUsageInput
dataclass
¶
Bases: _SerdeShape
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 = ...
The ending date (e.g., 2016-12-31) of the usage data.
key_id
class-attribute
instance-attribute
¶
key_id: str | None = ...
The Id of the API key associated with the resultant usage data.
limit
class-attribute
instance-attribute
¶
limit: int | 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 = ...
The current pagination position in the paged result set.
Output¶
GetUsageOutput
dataclass
¶
Bases: _SerdeShape
Represents the usage data of a usage plan.
Attributes¶
end_date
class-attribute
instance-attribute
¶
end_date: str | None = ...
The ending date of the usage data.
items
class-attribute
instance-attribute
¶
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 = ...
The current pagination position in the paged result set.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.