In a Quota/Rest Quota policy, I know I can create quota buckets by developer or app using the Identifier element. But I can also specify a child Identifier/Class to provide more fine-grained quota setting/resetting. My questions are:
Thanks!
Solved! Go to Solution.
Okay, looks like I answered the wrong question. I have not seen this usecase. But I would suspect the behavior would be something similar. i.e for each entity- set different limits for different classes.
But in that case, the Allow should be inside class, but in your example, it is outside. So I am not sure about it now!
@Floyd,@sandeep, Looks like the above policy is wrong to reset the quota at class level , it doesn't even get saved and throws some schema exceptions .
Hi @Floyd Jones,
These are mutually exclusive. For example, if you have a policy like this: (with identifier as client_id and class as your time identifier
<Quota name="QuotaPolicy"> <Interval>1</Interval> <TimeUnit>day</TimeUnit> <Allow count="100"> <Class ref="time_variable"> <Allow class="peak_time" count="1000"/> <Allow class="off_peak_time" count="10000" /> </Class> </Allow> <Identifier ref="client_id"/> </Quota>
What you are effectively saying is - for each app, allow it to use more api calls in the off peak hours. Might be helpful for APIs that you are launching as a trail.
Let me know if this helps
Thanks very much, Sandeep. I get all that, but the schema allows an Identifier > Class relationship, and we current have the following example in the Reset Quota docs, which was lifted from the original spec:
<Identifier name="_default"> <Class ref="request.header.classIdentifier" /> <Allow>200</Allow> </Identifier>
This seems to let a policy use both an Identifier and a child Class. I was wondering in particular about the relationship between those two elements. Seems odd.
I do not know if _default means something different, but have tried to answer the other part of the question
Okay, looks like I answered the wrong question. I have not seen this usecase. But I would suspect the behavior would be something similar. i.e for each entity- set different limits for different classes.
But in that case, the Allow should be inside class, but in your example, it is outside. So I am not sure about it now!
@Floyd,@sandeep, Looks like the above policy is wrong to reset the quota at class level , it doesn't even get saved and throws some schema exceptions .
Thanks very much, guys. Much appreciated. I think it's enough for now to confirm that it's not right. I'll play around with it some more and file any appropriate bugs.