I am using a quota policy as below, 10 request per week,
<Quota name="Quota-1" type="flexi"> <DisplayName>Quota-1</DisplayName> <Properties/> <Distributed>true</Distributed> <Synchronous>true</Synchronous> <Identifier ref="request.queryparam.apikey"/> <Allow countRef="verifyapikey.Verify-API-Key-1.apiproduct.developer.quota.limit"/> <Interval ref="verifyapikey.Verify-API-Key-1.apiproduct.developer.quota.interval"/> <TimeUnit ref="verifyapikey.Verify-API-Key-1.apiproduct.developer.quota.timeunit"/> </Quota>
Now I have reached the limit. So I want to use Reset quota,
<ResetQuota name="Reset-Quota-1"> <DisplayName>Reset Quota-1</DisplayName> <Properties/> <Quota name="Quota-1"> <Identifier ref="request.queryparam.apikey"> <Allow>10</Allow> </Identifier> </Quota> </ResetQuota>
So this should ideally allow 10 more requests based on identifier right?
But in trace it shows this,
My requirement is when quota(10 request per week) is completed I want to reset it again to 10 requests per week.
How can I do this?
Solved! Go to Solution.
@Barahalikar Siddharth , Great Question.
Ideally, I think, You should place reset quota policy in fault rules with a specific condition match to reset quota.
The ResetQuota policy should really be called "IncreaseQuota" or "TempIncreaseQuota" because the way it works is:
- Add a value to available.count
- Subtract that same value from used.count
Those changes disappear when the Quota policy next resets!