Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: qiaoli <qiaoli@huawei.com> Co-committed-by: qiaoli <qiaoli@huawei.com>
18 KiB
Deleting a Blacklist or Whitelist Rule
Function
This API is used to delete a blacklist or whitelist rule.
URI
DELETE /v1/{project_id}/black-white-list/{list_id}
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. |
list_id |
Yes |
String |
Blacklist or whitelist ID, which can be obtained through the API for querying the blacklist or whitelist. Find the value in data.records.list_id (The period [.] is used to separate different levels of objects). |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to Obtaining an Enterprise Project ID. If the enterprise project function is not enabled, the value is 0. |
fw_instance_id |
No |
String |
Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. You can obtain the token by referring to Obtaining a User Token. |
Content-Type |
Yes |
String |
Content type. It can only be set to application/json. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
data |
BlackWhiteListId object |
Response to the request for deleting a blacklist/whitelist item. |
Parameter |
Type |
Description |
|---|---|---|
id |
String |
Blacklist/Whitelist ID. |
name |
String |
Blacklist/Whitelist name. |
Status code: 400
Parameter |
Type |
Description |
|---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Example Requests
Delete the blacklist or whitelist whose ID is 2eee3fe8-0b9b-49ac-8e7f-eaafa321e99a from the project 9d80d070b6d44942af73c9c3d38e0429.
https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/black-white-list/2eee3fe8-0b9b-49ac-8e7f-eaafa321e99a
Example Responses
Status code: 200
Blacklist/Whitelist deletion response.
{
"data" : {
"id" : "2eee3fe8-0b9b-49ac-8e7f-eaafa321e99a"
}
}
Status code: 400
Bad Request
{
"error_code" : "CFW.00200005",
"error_msg" : "Object not found."
}
Status Codes
Status Code |
Description |
|---|---|
200 |
Blacklist/Whitelist deletion response. |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server Error |
Error Codes
See Error Codes.