Quota Policy Start Time: Is it possible to have a dynamic value for the quota start time?

Not applicable

Suppose I want to start counting requests when the developer is created, not when they send the first request.

I was thinking that it would be great to have a dynamic start time ?

<StartTime ref="verifyapikey.verify-api-key.developer.created_at" />

This requirement is associated to the fact that subscription plans in payment platforms are usually billed on the day of the subscription was created (and developer created as well).

Solved Solved
1 14 631
1 ACCEPTED SOLUTION

Dear @Leonardo Fernandez ,

As of today, seems like ref attribute on startTime is not supported. I have just tested same and it's not working.

Great feature to have, I will let the team know about it. Thank you for highlighting this.

Cheers,

Anil Sagar

View solution in original post

14 REPLIES 14

Dear @Leonardo Fernandez ,

Welcome to Apigee Community 🙂

Please help me understand, Even if you set start time to dynamic value or static value at the end it will be just tracking number of requests and blocks apis over specific count within time interval if count exceeds. Am i missing something here ?

AFAIK, Start time option just allows you to set future date so that quota will be started only after that specified time. Any way if you set developer created at, it will be past time and will have no effect.

Cheers,

Anil Sagar

Dear @Leonardo Fernandez ,

If you are trying to implement something like monetization on top of APIs , Apigee supports it out of the box using Apigee Monetization product.

Cheers,

Anil Sagar

Hi Anil, Thanks for the reply.

Documentation doesn't say anything about start time being/representing a future date. If this is the case, adding it to the documentation would help people in the future.

It does say that Counter will get reset after certain (interval, unit) from the StartTime. If I can set the start time to the developer creation date matching the billing date then I align the service period with billing.

Monetization sounds good, can't afford it now. I'm working on Edge Free for the moment. My goal is to allow customers to set their own request limits. Each business tier will have different features but the amount of requests per month is dynamic. That's were I need to find a way to limit per developer (can have many keys/apps).

So far I added custom fields on the developer to store the limits and interval. But can't find a way to match the Quota starting period with the customer's billing period.

<Quota async="false" continueOnError="true" enabled="true" name="developer-quota">
    <DisplayName>Impose Quota Per Developer</DisplayName>
    <Identifier ref="verifyapikey.verify-api-key.developer.id"/>
    <Allow countRef="verifyapikey.verify-api-key.developer.quota.limit"/>
    <Interval ref="verifyapikey.verify-api-key.developer.quota.interval">1</Interval>
    <TimeUnit ref="verifyapikey.verify-api-key.developer.quota.timeunit">month</TimeUnit>
    <Distributed>true</Distributed>
    <Synchronous>false</Synchronous>
</Quota>

Dear @Leonardo Fernandez ,

Got it, So you would like to start counter from the day he created so that it matches the billing period. For example, if he is created on Aug 18 2015 but makes first request on Aug 20th 2015 that slides the quota window to Sep 20th instead of Sep 18th if quota is 1 month interval

Let me check is there a way to implement same.

Cheers,

Anil Sagar

Yeap. Exactly that.

If I have the StartTime dynamic. Then I can apply interval(30) and timeunit(day) with success.

I can't apply interval(1) and timeunit(month) as that would count only for the present month.

I event thought of doing some "hacky" stuff.

Like setting the limit of a developer to N + 1. And manually trigger the first request by impersonating the developer and that way forcing the first request to happen on the day developer creation.

BTB, I just tested. Start time supports previous date too. Not able to verify whether it support ref element or not. I will update you.

Seems like you need to use hacky way to solve this problem as a workaround for now. I will keep you updated.

Dear @Leonardo Fernandez ,

As of today, seems like ref attribute on startTime is not supported. I have just tested same and it's not working.

Great feature to have, I will let the team know about it. Thank you for highlighting this.

Cheers,

Anil Sagar

Do we have this feature now?

@deepaksharma1

Answers are strictly for answers, Please use comments to post any feedback / followup questions.

Dear @anilsr 

Is this feature available now? If yes, what is the configurations that should be made?

Your insights on this will be valuable. Please update!

 

Can you ask a new question? Clarify what specifically you are looking for.  This thread is 9 years old! 

If you like, in the new question, you can reference this one.  Just insert a link.  But in my experience, when people chime in on an older thread, often their interest is similar to, but not exactly the same as, the thing that was originally requested.