Was this helpful?

The Reset Quota Policy type enables you to dynamically reset the limit for a specified Quota. For example, you can use this policy to reset a developer's Quota counter when additional API calls are purchased.

Configuring a ResetQuota policy

Configure your Reset Quota policy using the following elements.

Field Name Description
Quota Name Specifies the name of the Quota policy whose counter should be reset.
Identifier name Variable used for uniquely identifying the client, for example client_id.
Allow (Allow integer) Specifies the message count tow which the Quota will be reset.

Reset Quota examples

Reset top-level Quota.

<ResetQuota name="resetQuota">
 <Quota name="request.header.quotapolicy">
  <Identifier name="_default">
    <Allow>100</Allow>
  </Identifier>
 </Quota>
</ResetQuota>

<ResetQuota name="resetQuota">
 <Quota name="request.header.quotapolicy">
  <Identifier name="_default">
    <Allow ref="request.header.allowquota" />
  </Identifier>
 </Quota>
</ResetQuota>

Reset top-level Quota for different identifiers.

<ResetQuota name="resetQuota">
 <Quota ref="request.header.quotapolicy">
  <Identifier ref="request.header.identifier">
    <Allow>100</Allow>
  </Identifier>
 </Quota>
</ResetQuota>

Reset class-level Quotas.

<ResetQuota name="resetQuota">
 <Quota name="quotapolicy">
  <Identifier name="_default">
   <Class ref="request.header.classIdentifier">
    <Allow>200</Allow>
  </Identifier>
  </Identifier>
 </Quota>
</ResetQuota>

Policy-specific error codes

The default format for error codes returned by Policies is:

{
  "code" : " {ErrorCode} ",
  "message" : " {Error message} ",
  "contexts" : [ ]
}
Error Code Message
InvalidRLPolicyDefinition Invalid rate limit policy {0}
NoRLPolicy Quota policy {0} is not attached.
InvalidCount Invalid count value {0} for identifier {1} in {2}
FailedToResolveAllowCountRef Failed to resolve allow count reference {0} for identifier {1} in {2}

Policy schema

Each policy type is defined by an XML schema (.xsd). For reference, policy schemas are available on GitHub.

Add new comment

Provide your email address if you wish to be contacted offline about your comment.
We will not display your email address as part of your comment.

We'd love your feedback and perspective! Please be as specific as possible.
Type the characters you see in this picture. (verify using audio)

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.