Updated on 2024-04-25 GMT+08:00

Querying the IP addresses of WAF

Function

This API is used to query WAF IP addresses.

URI

GET /v1/{project_id}/waf/config/source-ip

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. To obtain it, go to Cloud management console and hover the cursor over your username. On the displayed window, choose My Credentials.Then, in the Projects area, view Project ID of the corresponding project.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Content-Type

Yes

String

Content type.

Default: application/json;charset=utf8

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

source_ip

Array of IpsItem objects

Origin server information list

last_modify

Long

Last time the WAF IP addresses are updated.

Table 4 IpsItem

Parameter

Type

Description

ips

Array of strings

WAF retrieval IP address

update_time

Long

Time the WAF IP addresses are updated.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Requests

The following example shows how to query the WAF IP addresses in a project. The project ID is specified by project_id.

GET https://{endpoint}/v1/{project_id}/waf/config/source-ip

Example Responses

Status code: 200

IP addresses of WAF

{
  "source_ip" : [ {
    "ips" : [ "122.112.208.32/28", "49.4.56.64/27", "2407:c080:804::/48" ],
    "update_time" : 1573779840000
  } ]
}

Status Codes

Status Code

Description

200

IP addresses of WAF

400

Request failed.

401

The token does not have required permissions.

500

Internal server error.

Error Codes

See Error Codes.