I followed the documentation, https://cloud.google.com/apigee/docs/api-platform/reference/policies/quota-policy?hl=en#samples, and implemented a quota policy. The XML is below. I get an error that Apigee fails to resolve the reference. I have the Verify API Policy implemented as verify-api-policy
XML:
<Allow count="3" countRef="verifyapikey.verify-api-key.apiproduct.developer.quota.limit"/>
<Interval ref="verifyapikey.verify-api-key.apiproduct.developer.quota.timeInterval"/>
<TimeUnit ref="verifyapikey.verify-api-key.apiproduct.developer.quota.timeunit"/>
<Identifier ref="verifyapikey.Verify-API-Key.client_id"/> </Quota>
Error:
"faultstring": "Failed to resolve quota interval reference verifyapikey.verify-api-key.apiproduct.developer.quota.timeInterval in quota policy CheckQuota",
Solved! Go to Solution.
You need to do first the api key verification.
then
verifyapikey.<api key verification policy name>.apiproduct.developer.quota.limit
verifyapikey.<api key verification policy name>.apiproduct.developer.quota.timeunit
verifyapikey.<api key verification policy name>.apiproduct.developer.quota.interval
Also, I will suggest to have default values in your policy also.
Hi John Smith
If your VerifyAPIKey policy is named "verify-api-policy" then the variables you must reference in the quota policy will be will be
verifyapikey.verify-api-policy.apiproduct.developer.quota.limit
verifyapikey.verify-api-policy.apiproduct.developer.quota.timeunit
verifyapikey.verify-api-policy.apiproduct.developer.quota.interval
The "failed to resolve reference" mesage means "there's no variable with the name provided in the policy". If you correct your variable names you might be able to move forward.
You need to do first the api key verification.
then
verifyapikey.<api key verification policy name>.apiproduct.developer.quota.limit
verifyapikey.<api key verification policy name>.apiproduct.developer.quota.timeunit
verifyapikey.<api key verification policy name>.apiproduct.developer.quota.interval
Also, I will suggest to have default values in your policy also.
Hi John, there is nothing like timeInterval, it's only interval. And it's not timeUnit, it's timeunit. Just follow as I stated.
Thanks. Using your reference variables worked. I was using the XML from the documentation and it needs updating.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |