Hello All,
How do I access the Product Quota in ApigeeX as before?
The document says "The Product Quota is superseded by more specific quota limits set on operations that you define on the API product." --> This works as expected .
But if I don't have these specific ones and have only the Product level quota then those values are not getting reflected in the Quota Policy.
Please let me know if am missing anything ...
Thanks
Solved! Go to Solution.
yes, I apologize about that. This is a problem in the existing Apigee X UI. The internal bug reference is b/205148816 .
We have prioritized a fix and hope to issue it soon. The diagnosis is: The Apigee UI incorrectly invokes the Apigee API to set the quota information on API products.
The good news is: there's a workaround. Because it's a UI problem, if you directly invoke the Apigee API, you can set the appropriate values. The call looks like this:
# set quota on specific api product
PUT https://apigee.googleapis.com/v1/organizations/:org/apiproducts/productname1
Authorization: Bearer :token
content-type: application/json
{
"name": "productname1",
"displayName": "productname1",
"approvalType": "auto",
"attributes": [
{
"name": "access",
"value": "public"
}
],
"environments": [
"env1"
],
"quota": "25",
"quotaInterval": "1",
"quotaTimeUnit": "minute",
"operationGroup": {
"operationConfigs": [
{
"apiSource": "inventory",
"operations": [
{
"resource": "/*",
"methods": [
"POST",
"GET"
]
}
]
},
{
"apiSource": "proxy2",
"operations": [
{
"resource": "/path1",
"methods": [
"GET"
]
}
]
}
],
"operationConfigType": "proxy"
}
}
The key is to omit the "quota" property within the operationGroup that should have no quota information.
Things to keep in mind :
To help diagnose whether the quota is working in the way I expect, I insert a policy that injects response headers to hold the "used" and "available" count on the quota. Insert this in the response flow. It might look like this:
<AssignMessage name="AM-QuotaInformation">
<Set>
<Headers>
<Header name="quota-used">{ratelimit.Quota-1.used.count}</Header>
<Header name="quota-available">{ratelimit.Quota-1.available.count}</Header>
</Headers>
</Set>
</AssignMessage>