• Web Application Firewall

waf
  1. Help Center
  2. Web Application Firewall
  3. API Reference
  4. APIs
  5. Blacklist and Whitelist Rules
  6. Updating a Blacklist or Whitelist Rule

Updating a Blacklist or Whitelist Rule

Function Description

This API is used to update a blacklist or whitelist rule.

URI

  • URI format

    PUT /v1/{project_id}/waf/policy/{policy_id}/whiteblackip/{whiteblackip_rule_id}

  • 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.

    whiteblackip_rule_id

    Yes

    String

    Specifies the ID of a blacklist or whitelist rule.

Request

Request parameters
Table 2 Parameter description

Parameter

Mandatory

Type

Description

addr

Yes

String

Specifies the IP address or range (IP address and subnet mask). For example, 192.168.0.125 or 192.168.6.0/24.

white

Yes

Integer

Specifies the IP address type.

  • 1: Whitelist
  • 0: Blacklist

Response

Response parameters
Table 3 Parameter description

Parameter

Type

Description

id

String

Specifies the ID of a blacklist or whitelist rule.

policyid

String

Specifies the policy ID.

addr

String

Specifies the IP address or range (IP address and subnet mask). For example, 192.168.0.125 or 192.168.6.0/24.

white

Integer

Specifies the IP address type.

  • 1: Whitelist
  • 0: Blacklist

If you do not configure the white parameter, the value is Blacklist by default.

timestamp

Long

Specifies the time when a blacklist or whitelist rule is added.

Examples

192.168.0.125 is used as an example.

  • Request example
    {
     "addr": "192.168.0.125"
     "white": 0
    }
  • Response example
    {
      "id": "44d887434169475794b2717438f7fa78",
      "policyid": "ertr45c0f96784ec8abd8ba61a98064ef",
      "addr": "192.168.0.125",
      "white": 1,
      "timestamp": 1499817600
    }

Status Code

Table 4 describes the normal status code returned by the API.
Table 4 Status code

Status Code

Description

Meaning

200

OK

The request has succeeded.

For details about error status codes, see Status Codes.