Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

ApigeeX- quota-policy doesnot support TimeUnit - second for non-distributed counters

Hi Google Team,

  In ApigeeX , the Quota policy doesnot support TimeUnit "second" for non-distributed counters(when <Distributed> is set to false).

The document says it supports but am not able to create a quota policy with seconds.

https://cloud.google.com/apigee/docs/api-platform/reference/policies/quota-policy#timeunit

I get the following error message in ApigeeX--The TimeUnit element "second" must be one of "day", "hour", "minute", "month", or "week" for non-distributed counters.

This functionality works in Apigee Edge.

Could you please check..

Thanks

0 2 222
2 REPLIES 2

Seems like the documentation is in error. We'll get that updated.

What problem are you trying to solve?  Is a seconds-based quota something you *require*?  If so  can you explain? 

Thanks for your reply.

I’m currently in the process of migrating few proxies from Apigee Edge to ApigeeX, and I encountered an issue related in the Quota policy.

In Apigee Edge, some proxies use TimeUnit set to "second" with Distributed set to false, and these worked as expected. However, in ApigeeX, it failed to deploy, even though the documentation indicates support for "second" as a time unit. Thanks for the clarification on this.

Additionally, in our case, the TimeUnit  also takes ref  value  from a header with a default value of "second."

After further analysis:

I changed the default TimeUnit value to "minute" in order to successfully deploy the proxy in ApigeeX.

At runtime, I passed "second" via the header (to test out run-time scenarios), and the policy still executed correctly.

From what I understand, it appears that ApigeeX enforces a pre-condition validation that restricts the use of "second" for non-distributed counters, but at runtime, if "second" is provided via a dynamic reference, the policy behaves as expected and I didn't get any error executing this policy.

Could you please confirm if this behavior is expected? 

Appreciate your support and guidance on this.

Thanks

Top Solution Authors