Quota time window

Hello,

How can I specify a time window in the policy Quota?
Example: 8am to 6pm

Thanks.

Solved Solved
0 1 212
1 ACCEPTED SOLUTION

Have you looked at the calendar quota type?  It's documented pretty clearly . Allows you to specify a start time. There is no way to specify an "end time". 

But by your question I'm not clear on what you expect the Quota policy to do, if you "specify a time"? 

  1. If you want the proxy to DENY requests received outside that time window, and otherwise enforce the quota, then  you could use a Condition element BEFORE the quota policy, to examine the system.time.hour value, and reject if the hour is outside the acceptable range.

    I guess it would look like this:

    <Step> 
      <Name>RF-ServiceUnavailable</Name>
      <Condition>(system.time.hour < 😎 OR (system.time.hour > 18)</Condition>
    </Step>

    You may have to change the logic to reflect your own local timezone. The system.time.hour will be relative to UTC, so if you want that to be 8am to 6pm Pacific time, you would need something like

      <!-- Condition evaluates true when NOT between 8 am and 6pm Pacific time -->
      <Condition>NOT ((system.time.hour >= 15) || (system.time.hour == 0))</Condition>
    
  2. If you want the proxy to ALLOW all requests outside that time window, and otherwise enforce, then you'd use a similar condition, with the logic reversed, wrapped around the quota.

    <Step> 
      <Name>Quota-1</Name>
      <!-- Condition evaluates true between 8 am and 6pm Pacific time -->
      <Condition>(system.time.hour >= 15) OR (system.time.hour == 0)</Condition>
    </Step>

View solution in original post

1 REPLY 1

Have you looked at the calendar quota type?  It's documented pretty clearly . Allows you to specify a start time. There is no way to specify an "end time". 

But by your question I'm not clear on what you expect the Quota policy to do, if you "specify a time"? 

  1. If you want the proxy to DENY requests received outside that time window, and otherwise enforce the quota, then  you could use a Condition element BEFORE the quota policy, to examine the system.time.hour value, and reject if the hour is outside the acceptable range.

    I guess it would look like this:

    <Step> 
      <Name>RF-ServiceUnavailable</Name>
      <Condition>(system.time.hour < 😎 OR (system.time.hour > 18)</Condition>
    </Step>

    You may have to change the logic to reflect your own local timezone. The system.time.hour will be relative to UTC, so if you want that to be 8am to 6pm Pacific time, you would need something like

      <!-- Condition evaluates true when NOT between 8 am and 6pm Pacific time -->
      <Condition>NOT ((system.time.hour >= 15) || (system.time.hour == 0))</Condition>
    
  2. If you want the proxy to ALLOW all requests outside that time window, and otherwise enforce, then you'd use a similar condition, with the logic reversed, wrapped around the quota.

    <Step> 
      <Name>Quota-1</Name>
      <!-- Condition evaluates true between 8 am and 6pm Pacific time -->
      <Condition>(system.time.hour >= 15) OR (system.time.hour == 0)</Condition>
    </Step>