Formula based throttling of API Proxies in a API Product

UseCase

We have a one API Product with many API Proxies.

Now we want to throttle API's in such a way that one API Proxy has one throttling parameter and remaining all other API Proxies have other throttling parameter.

This Throttling parameter is some factor (z * No. of hits) where z is variable parameter which can be number of licenses purchased by customer.

Example Suppose we have 5 API Proxies (A1,A2,A3,A4,A5)in a API Product.

Now we want to throttle API's (A1,A2,A3,A4) with z*20 requests per min and API (A5) with z*10 requests per min where z is number of licenses purchased by customer

How to achieve this usecase in best possible manner. Any help would be highly appreciated

Thanks

Solved Solved
0 4 577
1 ACCEPTED SOLUTION

Hi Gaurav,

Have you seen the doc on the Quota policy? You can use variables to set the parameters of the Quota policy. Those variables can come from anywhere:

  • Properties on the API product, app, or developer
  • From a KVM or vault
  • From a header, query param, form param, etc

For each API proxy, you can add a Quota policy that either references the same variable as all the other Quota policies in al the other proxies, or the Quota policy can reference variables unique for that policy and proxy.

Stephen

View solution in original post

4 REPLIES 4

Hi Gaurav,

Have you seen the doc on the Quota policy? You can use variables to set the parameters of the Quota policy. Those variables can come from anywhere:

  • Properties on the API product, app, or developer
  • From a KVM or vault
  • From a header, query param, form param, etc

For each API proxy, you can add a Quota policy that either references the same variable as all the other Quota policies in al the other proxies, or the Quota policy can reference variables unique for that policy and proxy.

Stephen

Hi @sgilson

Thanks for your response

I have gone through the Quota policy but our requirement is slightly different.

We have automated the proxy bundling , publishing and deploying process using Apigee REST Management API's as we have around 500 API Proxies.

And we are creating single API Product that too in an automated manner having all API Proxies Now we can have one custom variable in API Product which we can access in Quota Policy to dynamically set the Allowed quota.

But now I want one of the API Proxy from these 500 API Proxies in an API Product to have different Allowed Quota and other 499 with same quota which I can dynamically set through custom variable created in API product.

So how to handle that one APIProxy of API Product with different quota ?

Thanks in advance

Hi Gaurav,

What about using custom attributes on the API product? You could set those in your XML definition of the API product, then access them in your API proxies. 499 proxies can access one set of attributes, and 1 proxy can access a different set of attributes. To change the values, you only have to change the values once - in the API product.

Here's and example.

Stephen

I think there is a similar thread going on here on using the KVM, too.