Query Rate Limit Assertion

The Query Rate Limit assertion is used to query the status of a custom rate limit counter from the Apply Rate Limit assertion. The results are then placed into context variables.
gateway90
The Query Rate Limit assertion is used to query the status of a custom rate limit counter from the Apply Rate Limit assertion. The results are then placed into context variables.
The Query Rate Limit assertion is most useful when a custom counter ID has been used in the Apply Rate Limit assertion.
Context Variables Created by This Assertion
The Query Rate Limit assertion sets the following context variables with the query results.
The <
prefix
> is set in the assertion properties and is optional. There is no default.
Variable
Description
$<
prefix
>.
counter
.
name
 
The full name of the matching counter.
$<
prefix
>.
counter
.
requestsremaining
The number of requests the counter would allow at this moment (neglecting concurrency).
$<
prefix
>.
counter
.
concurrency
The number of requests currently using the counter.
$<
prefix
>.
counter
.
blackoutmillisremaining
The number of milliseconds of blackout time remaining if the counter is blacked out. Otherwise, this value is 0 (zero).
Using the Assertion
  1. Do one of the following:
    • To add the assertion to the Policy Development window, see Add an Assertion.
    • To change the configuration of an existing assertion, proceed to step 2 below.
  2. Right-click
    Query Rate Limit for limit per <counter name>
    in the policy window and select Rate Limit Query Properties or double-click the assertion in the policy window. The assertion properties are displayed. 
  3. Configure the dialog as follows:
    Field
    Description
    Existing Counter Name
    Enter the name of the rate limit counter being queried.
    The counter name entered here should be the actual resolved counter ID from the Apply Rate Limit assertion. If you simply repeat the context variable from the other assertion, you must ensure that the query uses matching information, otherwise the results will be incorrect.
    For example, the Apply Rate Limit assertion uses the counter ID: "QA-${request.authenticateduser}" and you wish to query for user "jsmith". In this case, you would enter the counter name "QA-jsmith" in the Query Rate Limit assertion. If you simply repeated "QA-${request.authenticateduser}" as the counter name, the results will be correct only if the user performing the query is "jsmith".
    Variable Prefix
    Optionally, enter a prefix that will be added to the context variables created by this assertion. This prefix will ensure uniqueness and will prevent the variables from overwriting each other when multiple instances of this assertion appear in a policy. If set, the format ${<
    prefix
    >.
    counte
    r.
    name
    } is used instead of ${
    counter
    .
    name
    }.
    For an explanation of the validation messages displayed, see Context Variable Validation.   
  4. Click [
    OK
    ].