Updated on 2023-12-13 GMT+08:00

Querying the IP Whitelist of a DCS Instance

Function

This API is used to query the IP address whitelist of a specific instance.

URI

GET /v2/{project_id}/instance/{instance_id}/whitelist

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

instance_id

String

Instance ID.

enable_whitelist

Boolean

Whether to enable the whitelist. The options are true and false.

Enumeration values:

  • true

  • false

whitelist

Array of Whitelist objects

IP whitelist group.

Table 3 Whitelist

Parameter

Type

Description

group_name

String

Whitelist group name. A maximum of four groups can be created for each instance.

ip_list

Array of strings

List of IP addresses in the whitelist group. A maximum of 20 IP addresses or IP address ranges can be added to an instance. Separate multiple IP addresses or IP address ranges with commas (,). IP address 0.0.0.0 and IP address range 0.0.0/0 are not supported.

Example Requests

GET https://{dcs_endpoint}/v2/{project_id}/instance/{instance_id}/whitelist

Example Responses

Status code: 200

Instance whitelist queried successfully.

{
  "instance_id" : "5560df16-cebf-4473-95c4-d1b573c16e79",
  "enable_whitelist" : true,
  "whitelist" : [ {
    "group_name" : "test001",
    "ip_list" : [ "10.10.10.1", "10.10.10.2" ]
  } ]
}

Status Codes

Status Code

Description

200

Instance whitelist queried successfully.

Error Codes

See Error Codes.