Upsert Rate Limit
Creates or updates rate limit for website acceleration service.
Request
Request-Line
POST /cdn/v1.0/services/{serviceId}/rateLimit HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | Service ID. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| timeWindow | Integer | Mandatory | Time to apply the limit (in seconds). |
| requestLimit | Integer | Mandatory | The maximum number of requests allowed from the same user IP within the specified time frame. |
| ignoreUrlPath | Boolean | Optional | Ignore URLs, apply a single limit for all URLs from the same user IP. Default is false. If omitted on update, the current value will be retained. Default is false. |
| ignoreQueryString | Boolean | Optional | Ignore Query String when counting requests. Default is false. If omitted on update, the current value will be retained. Default is false. |
Response
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | InvalidCustomer.IdEmpty | Customer id can be empty or invalid. |
| 400 | InvalidService.IdIncorrect | Service id is empty or invalid. |
| 400 | ServiceId.IdPermission | ServiceId can not be found or unknown. |
| 400 | InvalidRateLimit.TimeWindow | Invalid time window value. |
| 400 | InvalidRateLimit.RequestLimit | Invalid request limit value. |
Examples
Upsert Rate Limit
Request
POST /cdn/v1.0/services/228331/rateLimit HTTP/1.1
{
"timeWindow": 60,
"requestLimit": 10000000,
"ignoreUrlPath": true,
"ignoreQueryString": true
}
Successful Response Body
HTTP/1.1 200