Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
25 KiB
Configuring IP Whitelist Groups

IP whitelist groups are supported only by DCS Redis 4.0/5.0 instances, and not by DCS Redis 3.0 instances
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.
URI
PUT /v2/{project_id}/instance/{instance_id}/whitelist
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
instance_id |
Yes |
String |
Instance ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable_whitelist |
Yes |
Boolean |
Whether to enable the whitelist. Options:
|
whitelist |
Yes |
Array of Whitelist objects |
IP whitelist group. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
group_name |
Yes |
String |
Whitelist group name. A maximum of four groups can be created for each instance. |
ip_list |
Yes |
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. |
Response Parameters
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error information. Maximum length: 1024 characters |
error_code |
String |
Error code. Maximum length: 9 characters |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. Maximum length: 1024 characters |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error information. Maximum length: 1024 characters |
error_code |
String |
Error code. Maximum length: 9 characters |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. Maximum length: 1024 characters |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error information. Maximum length: 1024 characters |
error_code |
String |
Error code. Maximum length: 9 characters |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. Maximum length: 1024 characters |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error information. Maximum length: 1024 characters |
error_code |
String |
Error code. Maximum length: 9 characters |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. Maximum length: 1024 characters |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error information. Maximum length: 1024 characters |
error_code |
String |
Error code. Maximum length: 9 characters |
error_ext_msg |
String |
Extended error information. This parameter is not used currently and is set to null. Maximum length: 1024 characters |
Example Request
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" ] } ] }
Example Response
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 could not be found. |
500 |
Internal service error |
Error Codes
See Error Codes.