Adding a Blacklist or Whitelist Rule

Function Description

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

URI

Request

Request parameters
Table 2 Parameter description

Parameter

Mandatory

Type

Description

addr

Yes

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

No

Integer

Specifies the IP address type.

  • 1: Whitelist
  • 0: Blacklist

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

Response

Response parameters
Table 3 Parameter description

Parameter

Type

Description

id

String

Specifies the ID of a blacklist or whitelist rule.

policy_id

String

Specifies the policy ID.

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.

  • 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

X.X.0.125 is used as an example.

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.