{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
5
Question by jonesfloyd · Feb 13, 2015 at 01:07 PM · 6.4k Views policiesquota

How do the quota settings on an API product interact with quota policies in an API proxy?

I can add quota settings to an API product, and I can also add quota policies to an API proxy. How do those settings interact? Also, how do I reference quota settings on the product in a quota policy?

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
6
Best Answer

Answer by Mike Dunker @Google   · Feb 13, 2015 at 07:19 PM

Good question, this brings up a common misconception about quota settings on an API product.

API products have a set of fields called "Quota" that allow you to configure how many requests per number of time periods (like 10 requests per 1 second) you want to allow. Just configuring this does NOT enforce quotas though!

Quotas are only enforced by adding a quota policy into your proxies. The configuration of the API Product Quota fields will populate variables that are accessible in your proxy, and these variables can be fed into a quota policy.

For example, if I have a VerifyAPIKey policy named VerifyKey, I'll have the following variables populated upon verification of a key with the Quota fields set as 10 requests per 1 second:

verifyapikey.VerifyKey.apiproduct.developer.quota.limit = 10

verifyapikey.VerifyKey.apiproduct.developer.quota.interval = 1

verifyapikey.VerifyKey.apiproduct.developer.quota.timeunit = second

I can then set the Quota policy like this (if the field is not set, I'm allowing a default of 2 calls per minute):

<Quota async="false" continueOnError="false" enabled="true" name="MyQuota" type="calendar">
    <Allow count="2" countRef="verifyapikey.VerifyKey.apiproduct.developer.quota.limit"/>
    <Interval ref="verifyapikey.VerifyKey.apiproduct.developer.quota.interval">1</Interval>
    <TimeUnit ref="verifyapikey.VerifyKey.apiproduct.developer.quota.timeunit">minute</TimeUnit>
    <Identifier ref='verifyapikey.VerifyKey.client_id'/>
    <Distributed>true</Distributed>
    <Synchronous>false</Synchronous>
    <StartTime>2015-02-13 12:00:00</StartTime>
</Quota>
Comment
Add comment Show 5 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tpearson · Apr 14, 2015 at 02:36 PM 0
Link

That's very helpful, thanks! But what does the verifyapikey.VerifyKey.client_id variable refer to?

avatar image sarthak ♦ · Apr 14, 2015 at 02:50 PM 0
Link

verifyapikey.VerifyKey.client_id this variable is populated after the execution of apikey validation policy. This contains the current apikey with which the call came in. This configuration ensures the quota is applied at each unique apikey level.

avatar image DSX-Team · Jun 13, 2016 at 11:04 PM 0
Link

Hi,

I have used the same way to apply quota policy to the proxy for various products accessing it via developer apps with different quota intervals for monthly usage. Is there any management api call available to get the current monthly usage of each product/developer app on that proxy?

avatar image soujanyaedunuri · Nov 10, 2017 at 07:12 PM 0
Link

@Mike Dunker

Hi,

If I have more than one API proxy in a product, Is counter distributed to both APIs (or) each API proxy will have it's own counter to determine quota voilation error?

for ex: quota limit defined on API product is 10 requests every 1 minute. API product has two API proxies ( API1, API2).

If API1 got 3 requests and API2 got 7 requests in one minute duration.

then 4th call to API1 will fail with rate limit error? (or) would API1 accept 10 requests & API2 accepts 10 requests?

avatar image sumiya soujanyaedunuri · Feb 14, 2018 at 11:01 AM 0
Link

@soujanyaedunuri

Answer for your question is you should have different quota settings for each API.Quota is not distributed among the API's which are under one product.

Please find the more information in this link.
https://docs.apigee.com/api-services/reference/quota-policy

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Concurrent Rate Limit per API Key 2 Answers

In a Quota/Reset Quota policy, how do Identifier and Class interact? 3 Answers

Quota policy per request parameters 2 Answers

Custom call rate policy - only when backend returned valid data 2 Answers

Is it possible to set the quota for all the api proxy calls within an environment? 3 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges