Parameter | Required | Description |
Enable default policy | Yes | Whether to enable the default policy. The default policy implements traffic throttling at the API level and is independent from all other traffic throttling policies. For each request, the default policy will be checked first before other policies. |
Default throttling limit | Yes if the default policy is enabled | Upper limit of the number of times an API can be accessed within a certain period of time, which must be a positive integer. |
Default traffic throttling duration | Yes if the default policy is enabled | It supports four units: second, minute, hour, and day, and is used together with the default throttling limit. |
Traffic throttling policy | Yes | Parameter traffic throttling policy. You can create up to 10 policies in the same parameter traffic throttling plugin. The configuration items in a policy are as detailed below. |
Parameter | Required | Description |
Policy name | Yes | Current policy name, which can contain up to 50 characters and must be unique in the same plugin. |
Weight | Yes | You can enter a positive integer between 0 and 100, which must be unique in the same plugin. The greater the weight, the higher the priority. |
Trigger condition | No | If you set a condition, only when it is met can this traffic throttling policy be executed.<br>Enter a conditional expression. For more information on the rules of writing conditional expressions, see Notes. |
Traffic throttling parameter location | Yes | You can enter only one traffic throttling parameter and need to select the location and set the parameter name. For example, Header.ClientIP indicates to perform traffic throttling for each value of the ClientIP parameter in Header .<br>The following locations are supported: Header, Query, and Path. The Path parameter represents a complete API path, for which you don't need to enter the parameter name. |
Traffic throttling parameter name | Yes | You can enter only one traffic throttling parameter and need to select the location and set the parameter name. For example, Header.ClientIP indicates to perform traffic throttling for each value of the ClientIP parameter in Header .<br>The traffic throttling parameter name needs to be used together with the parameter location. The Path parameter represents a complete API path, for which you don't need to enter the parameter name. |
Throttling limit | Yes | Traffic throttling threshold for the traffic throttling parameter in this policy, which must be a positive integer and used together with the traffic throttling duration. |
Traffic throttling duration | Yes | It supports four units: second, minute, hour, and day, and is used together with the throttling limit. |
header.userid
parameter in a traffic throttling policy, the threshold will take effect for each different value of this parameter in the request.{"default_window":60, // Traffic throttling time window in seconds. If the value is 0, traffic throttling will be disabled by default"default_rate_limit":5, // Traffic throttling threshold, which must be a positive integer"strategies":[ // List of parameter traffic throttling policies. You can add 1–10 policies{"name":"a", // Policy name."strategy_weight":0, // Policy execution priority, which must be unique. The higher the value, the higher the execution priority"parameters":[ // List of traffic throttling parameters. Currently, you can add only one parameter{"type":"query", // Type of traffic throttling parameter. Valid values: [query,header,path]"name":"a" // Name of traffic throttling parameter. If the parameter type is `path`, the parameter will be the complete request path, and you don't need to pass in `name`}],"rate_limit":1, // Traffic throttling threshold, which must be a positive integer"window":1, // Traffic throttling time window in seconds"condition":"" // Policy trigger condition. If the value is an empty string, the policy will be executed unconditionally}]}
Was this page helpful?