We wish to display the current quota usage for a specific developer app. Is there any way to get this information from existing management APIs?
Solved! Go to Solution.
> Is there any way to get this information
Maybe. It depends on your requirements .
When a Quota policy runs, it sets a bunch of context variables (aka flow variables) that provide information about the quota. These are described here: http://apigee.com/docs/api-services/reference/quota-policy (scroll about 70% down the page to the "Flow Variables" section). Some of the interesting ones are:
ratelimit.{policy_name}.allowed.count ratelimit.{policy_name}.used.count ratelimit.{policy_name}.available.count ratelimit.{policy_name}.exceed.count ratelimit.{policy_name}.total.exceed.count ratelimit.{policy_name}.expiry.time ratelimit.{policy_name}.identifier
With these, your flow logic can determine the available quota and the consumed quota. You could then send this information back to the consuming app, and the app could show that sort of thing in a view for the user, or for the developer.
But this isn't what you asked. You asked about a MANAGEMENT API call. I don't know of a management API call that accomplishes what you want. As far as I am aware, the only way to learn the status of a quota is to actually apply the Quota enforcement.
Not sure about this, but.... it might be possible to use a MessageWeight of 0 (zero) to evaluate the quota and get the data from the system, without actually updating the quota counter. I haven't tested this.
The complete list of flow variables can be found here. Unfortunately, I didn't see anything that fits your needs. Let me ping my colleagues here to see if anyone has any ideas of how to do this.
> Is there any way to get this information
Maybe. It depends on your requirements .
When a Quota policy runs, it sets a bunch of context variables (aka flow variables) that provide information about the quota. These are described here: http://apigee.com/docs/api-services/reference/quota-policy (scroll about 70% down the page to the "Flow Variables" section). Some of the interesting ones are:
ratelimit.{policy_name}.allowed.count ratelimit.{policy_name}.used.count ratelimit.{policy_name}.available.count ratelimit.{policy_name}.exceed.count ratelimit.{policy_name}.total.exceed.count ratelimit.{policy_name}.expiry.time ratelimit.{policy_name}.identifier
With these, your flow logic can determine the available quota and the consumed quota. You could then send this information back to the consuming app, and the app could show that sort of thing in a view for the user, or for the developer.
But this isn't what you asked. You asked about a MANAGEMENT API call. I don't know of a management API call that accomplishes what you want. As far as I am aware, the only way to learn the status of a quota is to actually apply the Quota enforcement.
Not sure about this, but.... it might be possible to use a MessageWeight of 0 (zero) to evaluate the quota and get the data from the system, without actually updating the quota counter. I haven't tested this.
OK, thanks for these first answers
Is the expiry time shown in ratelimit.{policy_name}.expiry.time in seconds or milliseconds? or what is the unit?
@Nagashree B , FYI, Please post question as a new question instead of posting the same as answer so that we won't lose context and same will be helpful for others too.
Regarding, ratelimit.{policy_name}.expiry.time
Returns the time in milliseconds, which determines when the quota expires and new quota counter starts. For more information see here.
Sure Anil, will keep that in mind. Thanks for the answer too.
@Yoann Regardin did you get the api management call to fulfill this requirement? as i also am searching for the same thing you mentioned here.
Kindly update if you have found the way around to achieve this.
Thanks
@DSX-Team we have put aside this feature for our users in developer.orange.com. However, I'm not working any more on this subject.
Ok no problem @Yoann Regardin..Thanks anyways 🙂