Hi,
I'm trying to build a solution wherein I can trigger a manual quota reset outside of the target proxy. The problem I'm encountering is that my supposed target Quota Policy is in a shared flow. Tried different solutions but none of them are working. I just want to ask if this is possible at all?
I'm trying to reset the QuotaManagement policy in this shared flow using the ResetQuota Policy outside of the shared flow.
Regards,
Ryan
Solved! Go to Solution.
If you use an environment-wide or organization-wide quota, then yes, I think you can do what you want. The way to do that would be to use the context variable environment.name
or organization.name
as the Quota Identifier. On the other hand if you want to have a more specific quota, then,...you need to include the ResetQuota policy into the same proxy as the Quota policy.
The reason for this is ... if you use neither environment.name
nor organization.name
as the Quota Identifier, then the proxy name is always implicitly included as part of the Quota bucket identifier that is used internally by Apigee**. As a result, if you have Proxy 1 with a Quota policy and Proxy 2 with another Quota policy, then even if they use the same Identifier in the policy configuration (let's say you use the Application ID, which is the same for proxy1 and proxy2), still there will be different internal quota buckets, and different, distinct, independent quota counts for these respective proxies and policies. Likewise if you have a ResetQuota policy that resides in a different proxy than the Quota policy, then the same applies.
The bottom line is, it is not simple to implement a single quota bucket that is used across multiple proxies. The way to do it is to create a "quota proxy", and then have each "business proxy" call into the quota proxy (probably via a localProxy connection for efficiency) and then there will be a single quota bucket for multiple proxies. You might be able to use a similar pattern for your case: to allow a reset independently of the proxy.
**I've raised a feature enhancement request to make this optional. We know how to implement it, but so far we haven't prioritized that work.
If you use an environment-wide or organization-wide quota, then yes, I think you can do what you want. The way to do that would be to use the context variable environment.name
or organization.name
as the Quota Identifier. On the other hand if you want to have a more specific quota, then,...you need to include the ResetQuota policy into the same proxy as the Quota policy.
The reason for this is ... if you use neither environment.name
nor organization.name
as the Quota Identifier, then the proxy name is always implicitly included as part of the Quota bucket identifier that is used internally by Apigee**. As a result, if you have Proxy 1 with a Quota policy and Proxy 2 with another Quota policy, then even if they use the same Identifier in the policy configuration (let's say you use the Application ID, which is the same for proxy1 and proxy2), still there will be different internal quota buckets, and different, distinct, independent quota counts for these respective proxies and policies. Likewise if you have a ResetQuota policy that resides in a different proxy than the Quota policy, then the same applies.
The bottom line is, it is not simple to implement a single quota bucket that is used across multiple proxies. The way to do it is to create a "quota proxy", and then have each "business proxy" call into the quota proxy (probably via a localProxy connection for efficiency) and then there will be a single quota bucket for multiple proxies. You might be able to use a similar pattern for your case: to allow a reset independently of the proxy.
**I've raised a feature enhancement request to make this optional. We know how to implement it, but so far we haven't prioritized that work.
Hello!
Thank you for taking time to answer. I'll try this as a POC as implementing the environment.name and organization.name in our quota management shared flow would be a big change.
Thanks!