{ 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 /
  • General /
avatar image
1
Question by mariusz.panek · Sep 15, 2015 at 01:10 PM · 1.4k Views quota

Is it possible to set quota limit on key level?

Is it possible to set quota limit on key level?

Example: I want to have 3 users of my API,

I would like to give user A right to make 1000 calls / day

I would like to give user B right to make 5000 calls / day

I would like to give user C right to make 10000 calls / day

Later on another API user may be added with other customer limit. In the future I can have hundreds of users with custom quota limits.

Is it possible to achieve it with apigee? (I know that is doable with other(competitive) solution)

Comment
Add comment Show 1
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 mariusz.panek · Sep 15, 2015 at 01:34 PM 0
Link

Hi, thanks for very quick answers! I'm astonished by the speed I got first answers...

But getting back to my use-case: API Products seems like a product or access level to product. What if I need to set dozens of 'Exceptions' in limits for some developers (or keys)?

I don't want to have dozens of products but one product with some custom settings on key level on some keys - is it doable?

about quota-polices - I have read the article - I know that I can set Identifier to ref="client_id" - which set that quota is enforced on each single key (and not on aggregate level) but this still does not solve my problem...

Is it even possible to set exceptions for some developers/keys in policies - if so - how to do it?

Is there a way that I can set limit really on key level? I mean if I could set it on key settings tab then I should be able to check key quota limit for this very specific key without digging up through all policies...

Close

5 Answers

  • Sort: 
avatar image
4
Best Answer Wiki

Answer by Anil Sagar @ Google   · Sep 15, 2015 at 02:05 PM

Dear @mariusz.panek ,

Please find attached api proxy that demonstrates same. You can just import this and test same. Create an API product and add your API proxy to product. You need to create couple of developers with custom attribute, apps for each developer to generate keys. Make sure you select the product while creating an developer app. Provided developer custom attributes screenshots.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<VerifyAPIKey async="false" continueOnError="false" enabled="true" name="Verify-API-Key-1">
    <DisplayName>Verify API Key-1</DisplayName>
    <Properties/>
    <APIKey ref="request.queryparam.apikey"/>
</VerifyAPIKey>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Quota async="false" continueOnError="false" enabled="true" name="Quota-1">
    <DisplayName>Dynamic Quota</DisplayName>
    <Properties/>
    <Allow count="1000" countRef="verifyapikey.Verify-API-Key-1.developer.allowed_quota"/>
    <Interval ref="request.header.quota_count">1</Interval>
    <TimeUnit ref="request.header.quota_timeout">day</TimeUnit>
    <Identifier ref="client_id"/>
</Quota>

Cheers,

Anil Sagar


screen-shot-2015-09-15-at-73219-pm.png (109.6 kB)
screen-shot-2015-09-15-at-73253-pm.png (141.7 kB)
screen-shot-2015-09-15-at-73427-pm.png (21.4 kB)
screen-shot-2015-09-15-at-73437-pm.png (21.9 kB)
dynamicweather-rev1-2015-09-15.zip (2.1 kB)
Comment
Add comment Show 4 · 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 mariusz.panek · Sep 15, 2015 at 03:37 PM 0
Link

it works! thanks!

avatar image Anil Sagar @ Google ♦♦ mariusz.panek   · Sep 15, 2015 at 04:50 PM 0
Link

@mariusz.panek , Awesome, Glad your query is resolved :)

avatar image Anil Sagar @ Google ♦♦ mariusz.panek   · Sep 17, 2015 at 05:40 AM 0
Link

Dear @mariusz.panek ,

Just FYI,

Operator / API Admin need not to manually set these attributes. Apigee Edge Itself exposes many APIs to work with different entities inside Apigee Edge Platform. Apigee Developer Services integrates with Apigee Edge through these APIs & Allow your Developers to be onboarded into the platform seamlessly. We can able to configure these attributes automatically in developer portal where Admin / Operator can just enter value instead of keys & values. You can learn more about Apigee Developer Services here. Apigee Developer Portal is built on top of famous open source Drupal CMS. Please keep us posted if you have any queries.

Cheers,

Anil Sagar

avatar image Sujith Mathew Anil Sagar @ Google ♦♦ · Aug 26, 2017 at 07:41 AM 0
Link

do agree with Anil, however in rare cases , drupal is not allowed and hence no dev. portal due to security considerations (unfortunately) !!

avatar image
1

Answer by gnanasekaran · Sep 15, 2015 at 01:18 PM

yes, Quota can be configured for different type of API consumers, more details here - http://apigee.com/docs/api-services/reference/quot...

Look for Client ID / service plan.

These variables can be applied at various levels, at APIs, or at API products or group / individual developers or for each apps or for end user or even based on client ip

--

Since you mentioned about other solutions, are you evaluating apigee for your business? In that case, sales would be happy to assist you with more information on the solution based on your business needs

Comment
Add comment · 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
1

Answer by sarthak · Sep 15, 2015 at 01:41 PM

Yes absolutely you can do that using custom attributes of an API Key/developer/app. All the three attributes have custom attributes and define those custom quota limits there and then in your quota policy you can refer to the custom attributes instead of the value defined in the product.

For developers and apps the custom attributes can be defined in the UI and for API key it can be only defined by the management API.

This is an example of the API call to update the App attribute with custom name-value pairs : http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps/%7Bapp_name%7D/attributes/%7Battribute_name%7D

At which level you want to do it depends on the use cases. If you are specifying quota for a developer (who has lets say 5 different Apps and the quota is for combined traffic across all the apps) then specify it as part of developer attributes. Else specify it as part of the app attributes either in the UI or via APIs

Comment
Add comment Show 2 · 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 mariusz.panek · Sep 15, 2015 at 02:01 PM 0
Link

I guess it should solve my trouble.

I will test it right now. Thanks!

avatar image Anil Sagar @ Google ♦♦ mariusz.panek   · Sep 15, 2015 at 02:07 PM 0
Link

@mariusz.panek , added a new answer with sample api proxies & policies, developer attribute screenshots and trace screenshots which demonstrates same. You need to create a product and add an api proxy to same, create developer apps to generate keys. Just took 10 - 15 minutes to implement same from scratch :) keep me posted if you have any issues using attached proxy in new answer.

avatar image
0

Answer by sarthak · Sep 15, 2015 at 01:18 PM

Yes, you can. In Apigee you do that using API Products. You can learn more about API products here: http://apigee.com/docs/developer-services/content/what-api-product .

Let us know if this is what you were looking for or you.

Comment
Add comment · 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
0

Answer by Anil Sagar @ Google   · Sep 15, 2015 at 01:24 PM

Dear @mariusz.panek ,

Welcome to Apigee Community.

Yes, It's possible. You can achieve same using multiple ways with Quota Policy & Out of the box API Products.

Apigee Developer Portal gives great control how developers access your APIs by creating APPs tied to API Products.

If you use quota policy, Quota Supports CountRef to dynamically set Quota Allowed values,

<Allow count="2000" countRef="{FLOWVARIABLE}"/>

Flow Variable, You can either set using Javascript policy before quota policy to determine user type or use a variable from request payload to determine same.

Cheers,

Anil Sagar


screen-shot-2015-09-15-at-65108-pm.png (89.3 kB)
Comment
Add comment Show 4 · 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 GAURAV · Feb 04, 2016 at 06:47 AM 0
Link

Hi @Anil Sagar

I tried to use the above dynamic quota using flow variable set using Javascript policy.

I have the Quota Policy below

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Quota async="false" continueOnError="false" enabled="true" name="Quota">

<DisplayName>Quota</DisplayName>

<FaultRules/>

<Properties/>

<Interval>60</Interval>

<TimeUnit>second</TimeUnit>

<Allow countRef="{throttleParam}" />

</Quota>

And the variable "throttleParam" is set using Javascript Policy and I am getting this value fine but somehow it is not able to replace the value in Quota Policy. Please let me know what is missing here

Please find the attached trace session, just replace the txt extension with xml as not allowing to upload xml file

trace-1454567703410.txt

Thanks

trace-1454567703410.txt (38.6 kB)
avatar image GAURAV GAURAV · Feb 05, 2016 at 06:49 AM 0
Link

Hi @Anil Sagar @sgilson

Any inputs on my above query

Thanks in advance

avatar image GAURAV GAURAV · Feb 05, 2016 at 07:13 AM 0
Link

Hi @Anil Sagar @sgilson

It's working without {} like below

<Allow countRef="throttleParam" />

Is it right ?

Thanks

Show more comments

Follow this Question

Answers Answers and Comments

23 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting a quota on a product, that enforces same limit on all keys. 2 Answers

Conditional Quota Count 1 Answer

advanced quota 2 Answers

Quota limit for request methods 'get' or 'post' possible ? 1 Answer

What are the maximum values of spike arrest and quota? 1 Answer

  • 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