Configuring IP Whitelist Groups
Function
This API is used to configure IP address whitelist groups for a specific instance, including creating, disabling, editing, and deleting a whitelist. New whitelist settings will overwrite the existing setting. Therefore, save the existing whitelist before you add a new one.
Calling Method
For details, see Calling APIs.
URI
PUT /v2/{project_id}/instance/{instance_id}/whitelist
|
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
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
instance_id |
No |
String |
Instance ID. |
|
enable_whitelist |
Yes |
Boolean |
Whether to enable the whitelist. The options are true and false. |
|
whitelist |
Yes |
Array of Whitelist objects |
IP whitelist group. New whitelist settings will overwrite the existing setting. Therefore, save the existing whitelist before you add a new one. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
group_name |
Yes |
String |
Parameter description: Whitelist group name. Constraints: Four unique groups can be created for each instance. Value range: N/A Default value: N/A |
|
ip_list |
Yes |
Array of strings |
Parameter description: IP list in a whitelist group. Separate multiple ones with commas (,). Constraints: An instance's IPs must be unique. IP address 0.0.0.0 and IP address range 0.0.0.0/0 are not supported. Value range: N/A Default value: N/A |
Response Parameters
Status code: 204
IP whitelist groups configured successfully.
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Error message. |
|
error_code |
String |
Error code. |
|
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Error message. |
|
error_code |
String |
Error code. |
|
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Error message. |
|
error_code |
String |
Error code. |
|
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Error message. |
|
error_code |
String |
Error code. |
|
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Error message. |
|
error_code |
String |
Error code. |
|
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. |
Example Requests
-
Enabling the whitelist and configuring IP addresses allowed to access the instance
PUT https://{dcs_endpoint}/v2/{project_id}/instance/{instance_id}/whitelist { "enable_whitelist" : true, "whitelist" : [ { "group_name" : "test001", "ip_list" : [ "10.10.10.1", "10.10.10.2" ] } ] } -
Enabling the whitelist and configuring subnet mask allowed to access the instance.
PUT https://{dcs_endpoint}/v2/{project_id}/instance/{instance_id}/whitelist
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
IP whitelist groups configured successfully. |
|
400 |
Invalid request. |
|
401 |
Invalid authentication information. |
|
403 |
The request is rejected. |
|
404 |
The requested resource is not found. |
|
500 |
Internal service error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.