Rate Limit
Use the Rate Limit policy to apply one or more rate, burst, or count limits at any point in your API assembly flow. Rate and burst limits restrict the number of calls made to an API in a specified time period, while count limits impose a strict limit on the total number of calls.
Gateway support
Gateway | Policy version |
---|---|
DataPower® API Gateway | 2.0.0 2.1.0 (DataPower API Gateway Version 10.0.1.0 or later) 2.2.0 (DataPower API Gateway Version 10.0.2.0 or later) 2.3.0 (DataPower API Gateway Version 10.5.0.0 |
This topic describes how to configure the policy in the assembly user interface; for details on how to configure the policy in your OpenAPI source, see ratelimit.
About
The defined rate, burst, and count limits are applied to whatever follows in the assembly flow. For example, if a Rate Limit policy is placed before an Invoke policy, and the call made by the Invoke policy exceeds the limits defined by the Rate Limit policy, the API call itself fails.
Properties
The following table lists the policy properties, indicates whether a property is required, specifies the valid and default values for input, and specifies the data type of the values.
Property label | Required | Description | Data type |
---|---|---|---|
Title | No | The title of the policy. The default value is |
string |
Description | No | A description of the policy. | string |
Source | Yes | The location of all the rate limit, burst limit, and count limit definitions that are
included in this policy. Select one of the following options: |
string |
Rate Limit Name | Yes1 | If Source property is set to Catalog by Name,
the name of a rate limit as defined in the DataPower API Gateway configuration,
To display the Rate Limit Name field, click Add Rate Limit; you can add as many rate limits as you want. 1You must provide at least one rate, burst, or count limit. |
string |
Burst Limit Name | Yes2 | If Source property is set to Catalog by Name,
the name of a burst limit as defined in the DataPower API Gateway configuration.
If Source is set to Plan by Name, the name of an assembly burst limit in a Plan. To display the Burst Limit Name field, click Add Burst Limit; you can add as many burst limits as you want. 2You must provide at least one rate, burst, or count limit. |
string |
Count Limit Name | Yes3 | If Source property is set to Catalog by Name,
the name of a count limit as defined in the DataPower API Gateway configuration.
If Source is set to Plan by Name, the name of an assembly count limit in a Plan. To display the Count Limit Name field, click Add Count Limit; you can add as many count limits as you want. 3You must provide at least one rate, burst, or count limit. |
string |
Operation | No | For a rate limit, select one of the following options: For a count limit, select one of the following options:
By default, the count limit is automatically decremented at the end of the API assembly by the total amount incremented during the assembly, minus any decrement operations that are defined in the assembly. You do not need to explicitly define decrement operations unless you want the decrements to occur at specific points in the assembly. However, if the auto decrement feature has been explicitly disabled in the count limit configuration, you must include a corresponding decrement operation, otherwise when the count limit is reached all future calls are blocked. For more information on configuring a count limit, see Configuring a rate, burst, or count limit on the. The default value is Increment. For a burst limit, the only option is Consume, meaning that the limit applied is that defined in the burst limit specified in the Burst Limit Name field. |
string |