Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Li, Qiao <qiaoli@huawei.com> Co-committed-by: Li, Qiao <qiaoli@huawei.com>
15 KiB
Querying Blacklist and Whitelist Rules
Function Description
This API is used to query all blacklist and whitelist rules.
URI
- URI format
GET /v1/{project_id}/waf/policy/{policy_id}/whiteblackip?offset={offset}&limit={limit}
- Parameter description
Table 1 Path parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Specifies the project ID.
policy_id
Yes
String
Specifies the policy ID.
offset
No
Long
Specifies the number of returned pages. Its value ranges from 0 to 65535. The default value is 0.
limit
No
Long
Specifies the maximum number of records displayed on each page. Its value ranges from 0 to 50. The default value is 10.
Request
Request parameters
None
Response
Parameter |
Type |
Description |
---|---|---|
total |
Integer |
Specifies the total number of rules. |
items |
Specifies the blacklist or whitelist rule objects. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the ID of a blacklist or whitelist rule. |
policy_id |
String |
Specifies the ID of the policy to which the rule belongs. |
addr |
String |
Specifies the public IP address or range (IP address and subnet mask). For example, X.X.0.125 or X.X.6.0/24. |
white |
Integer |
Specifies the IP address type.
|
timestamp |
Long |
Specifies the time when a blacklist or whitelist rule is added. |
Example
total with a value of 2 is used as an example.
{ "total": 2, "items": [{ "id": "3a9b5c0f96784ec8abd8ba61a98064ef", "policy_id": "ertr45c0f96784ec8abd8ba61a98064ef", "addr": "X.X.0.125", "white": 1, "timestamp": 1499817600 }, { "id": "44d887434169475794b2717438f7fa78", "policy_id": "ertr45c0f96784ec8abd8ba61a98064ef", "addr": "X.X.0.125", "white": 0, "timestamp": 1499817601 } ] }
Status Code
For details about error status codes, see Status Codes.