Skip to main content

quota_by_counter_keys

Creates, updates, deletes, gets or lists a quota_by_counter_keys resource.

Overview

Namequota_by_counter_keys
TypeResource
Idazure.api_management.quota_by_counter_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
counterKeystringThe Key value of the Counter. Must not be empty. Required.
periodEndTimestring (date-time)The date of the end of Counter Period. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. Required.
periodKeystringIdentifier of the Period for which the counter was collected. Must not be empty. Required.
periodStartTimestring (date-time)The date of the start of Counter Period. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. Required.
valueobjectQuota Value Properties.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_serviceselectresource_group_name, service_name, quota_counter_key, subscription_idLists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified service instance. The api does not support paging yet.
updateupdateresource_group_name, service_name, quota_counter_key, subscription_idUpdates all the quota counter values specified with the existing quota counter key to a value in the specified service instance. This should be used for reset of the quota counter values.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
quota_counter_keystringQuota counter key identifier. This is the result of expression defined in counter-key attribute of the quota-by-key policy. For example, if you specify counter-key="boo" in the policy, then it’s accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
service_namestringThe name of the API Management service. Required.
subscription_idstring

SELECT examples

Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified service instance. The api does not support paging yet.

SELECT
counterKey,
periodEndTime,
periodKey,
periodStartTime,
value
FROM azure.api_management.quota_by_counter_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND quota_counter_key = '{{ quota_counter_key }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

UPDATE examples

Updates all the quota counter values specified with the existing quota counter key to a value in the specified service instance. This should be used for reset of the quota counter values.

UPDATE azure.api_management.quota_by_counter_keys
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND quota_counter_key = '{{ quota_counter_key }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
count,
nextLink,
value;