WAF Insights does not support automation via our REST API web service. If you are currently using WAF Insights, upgrade your WAF solution to take advantage of our REST API.
Updates a rate rule that determines the maximum number of requests that will be allowed within a given time period.
A request to update a rate limit is described below.
HTTP Method | Request URI |
---|---|
PUT |
https://api.edgecast.com/v2/mcc/customers/AccountNumber/waf/v1.0/limit/Rule Rule ID |
Define the following variables when submitting the above request:
VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). | Description |
---|---|
Required |
|
Required |
Replace this variable with the system-defined ID of the desired rate rule. Use the Get All Rate Rules endpoint to retrieve a list of rate rules and their IDs. |
This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.
Pass the following request body parameters:
Name | Data Type | Description |
---|---|---|
Array Objects |
Contains the set of condition groups associated with a rule. |
|
customer_id |
String |
Identifies your account by its customer account number. |
disabled |
Boolean |
Indicates whether this rate rule will be enforced. Valid values are:
|
Required |
Integer |
Indicates the length, in seconds, of the rolling window that tracks the number of requests eligible for rate limiting. The rate limit formula is calculated through the num and duration_sec properties as indicated below. num requests per duration_sec
Valid values are: 1 | 5 | 10 | 30 | 60 | 120 | 300
|
id |
String |
Indicates the system-defined ID for the rate rule. |
keys |
Array String values |
Indicates the method by requests will be grouped for the purposes of this rate rule. Valid values are:
|
last_modified_date |
String |
Indicates the timestamp at which this rate rule was last modified. Syntax: YYYY-MM-DDThh:mm:ss:ffffffZ
|
name |
String |
Indicates the name of the rate rule. |
Required |
Integer |
limits array Indicates the rate limit value. This value identifies the number of requests that will trigger rate limiting. The rate limit formula is calculated through the num and duration_sec properties as indicated below. num requests per duration_sec
|
The condition_groups array describes each condition group using the following properties:
Name | Data Type | Description |
---|---|---|
conditions |
Array Objects |
Contains a list of match conditions. This array describes each condition within a condition group using the following properties: target Object The target object describes the type of match condition. op Object The op object contains the match condition's properties. |
id |
String |
Indicates the system-defined alphanumeric ID of a condition group. Example: 12345678-90ab-cdef-ghij-klmnopqrstuvwxyz1
|
name |
String |
Indicates the name of a condition group. |
The target object describes the type of match condition using the following properties:
Name | Data Type | Description |
---|---|---|
type Required for target object |
String |
Determines how requests will be identified. Valid values are: FILE_EXT | GEOIdentifies the country from which the request originated by its 2 character country code. | REMOTE_ADDR | REMOTE_ASN | REQUEST_HEADERS | REQUEST_METHOD | REQUEST_URIRequest URL Path: Match against the request's URL path. Define a URL path that starts directly after the hostname. Exclude the protocol, hostname, and query string when defining this property.
|
value Required for REQUEST_HEADERS |
String |
type: REQUEST_HEADERS Only Indicates the name of the request header through which requests will be identified. Valid values are: Host | Referer | User-Agent
|
The op object describes each match condition using the following properties:
Name | Data Type | Description |
---|---|---|
is_case_insensitive |
Boolean |
Indicates whether the comparison between the requestThe attribute (e.g., hostname, URL path, IP address, etc.) of the request that will be compared is determined by the variable array. and the values property is case-sensitive. Valid values are:
|
is_negated |
Boolean |
Indicates whether this match condition will be satisfied when the requestThe attribute (e.g., hostname, URL path, IP address, etc.) of the request that will be compared is determined by the variable array. matches or does not match the value defined by the values property. Valid values are:
|
type Required for op object |
String |
Indicates how the system will interpret the comparison between the requestThe attribute (e.g., hostname, URL path, IP address, etc.) of the request that will be compared is determined by the variable array. and the values property. Valid values are:
|
value Required for RX |
String |
type: RX Only Identifies a regular expression used to identify requests that are eligible for rate limiting. If you are identifying traffic via a URL path (REQUEST_URI), then you should specify a URL path pattern that starts directly after the hostname. Exclude a protocol or a hostname when defining this property.
|
values Required for EM and IPMATCH |
Array String values |
type: EM and IPMATCH Only Identifies one or more values used to identify requests that are eligible for rate limiting. If you are identifying traffic via a URL path (REQUEST_URI), then you should specify a URL path pattern that starts directly after the hostname. Exclude a protocol or a hostname when defining this property.
If you are matching requests by IP address, make sure to use standard IPv4 and CIDR notation. |
The response to the above request includes an HTTP status code, response headers, and a response body.
A status code indicates whether the request was successfully performed.
The response for this endpoint only includes standard HTTP response headers.
The response body for a successful request contains the following parameters:
Name | Data Type | Description |
---|---|---|
id |
String |
Indicates the system-defined ID for the resource. |
status |
String |
Returns success. |
success |
Boolean |
Returns true. |
The response body for an unsuccessful request contains the following parameters:
Name | Data Type | Description |
---|---|---|
success |
Boolean |
Returns false. |
Array Objects |
Contains one or more error(s). |
The errors array describes each error that occurred using the following properties:
Name | Data Type | Description |
---|---|---|
code |
Integer |
Indicates the HTTP status code for the error. |
message |
String |
Indicates the description for the error that occurred. |
A sample JSON request is shown below.
PUT https://api.edgecast.com/v2/mcc/customers/0001/waf/v1.0/limit/fgSagLvT HTTP/1.1
Authorization: TOK:12345678-1234-1234-1234-1234567890ab
Accept: application/json
Content-Type: application/json
Host: api.edgecast.com
{ "duration_sec": 5, "condition_groups": [{ "conditions": [{ "target": { "type": "REQUEST_METHOD" }, "op": { "type": "EM", "values": ["POST"] } } ] } ], "num": 10 }
A sample JSON response is shown below.
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Date: Thu, 15 Apr 2021 12:00:00 GMT
Content-Length: 164
{ "id": "fgSagLvT", "status": "success", "success": true }