UpdatePublicWhiteIps
Updates the public IP address whitelist of a specified Elasticsearch instance.
Operation description
Precautions
You cannot update the public IP address access whitelist of an instance when the instance status is activating, invalid, or inactive.
- You can update the whitelist by using an IP address whitelist or an IP address whitelist group. You cannot use both methods at the same time. Except for InstanceId and clientToken, the parameters supported by the two methods are different. The details are as follows:
IP address whitelist: publicIpWhitelist
IP address whitelist group: modifyMode and whiteIpGroup
You cannot configure private IP addresses in a public network access whitelist, and you cannot configure public IP addresses in a private network access whitelist.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:UpdatePublicWhiteIps |
update |
*Instance
|
None | None |
Request syntax
PATCH /openapi/instances/{InstanceId}/public-white-ips HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
es-cn-tl329rbpc0001**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| clientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 ASCII characters in length. |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| modifyMode |
string |
No |
The modification method. Valid values:
|
Cover |
| body |
string |
No |
The public network access whitelist or whitelist group configuration of the instance. |
{"publicIpWhitelist":["0.0.0.0/0","0.0.0.0/1"]} |
RequestBody
| Parameter | Type | Required | Example | Description |
| publicIpWhitelist | List | Yes | ["0.0.0.0/0","0.0.0.0/1"] | The IP address whitelist. This parameter is available when whiteIpGroup is empty. The value of this parameter updates the IP address whitelist configuration in the default whitelist group. You cannot configure publicIpWhitelist and whiteIpGroup at the same time. |
| whiteIpGroup | Object | No | Updates the whitelist configuration of the instance by using a whitelist group. You can update only one whitelist group. You cannot configure publicIpWhitelist and whiteIpGroup at the same time. | |
| └ groupName | String | No | test_group_name | The name of the whitelist group. If you specify the whiteIpGroup parameter, this parameter is required. |
| └ ips | List | No | ["0.0.0.0", "10.2.XX.XX"] | The list of IP addresses in the whitelist group. If you specify the whiteIpGroup parameter, this parameter is required. |
When modifyMode is set to Cover, if ips is empty, the whitelist group is deleted. If groupName is not in the list of existing whitelist group names, a new whitelist group is created.
When modifyMode is set to Delete, at least one IP address must be retained after deletion.
When modifyMode is set to Append, make sure that the whitelist group name already exists. Otherwise, a NotFound error is returned.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
C82758DD-282F-4D48-934F-92170A33**** |
| Result |
object |
The returned result. |
|
| publicIpWhitelist |
array |
The public IP address access whitelist. |
|
|
string |
The public IP address access whitelist. |
["0.0.0.0","10.2.XX.XX","110.0.XX.XX/8"] |
In the following response example, only the parameters in the returned data list are guaranteed to be included. Other parameters are for reference only. For parameter descriptions, see ListInstance. Do not hardcode dependencies on these parameters in your programs.
Examples
Success response
JSON format
{
"RequestId": "C82758DD-282F-4D48-934F-92170A33****",
"Result": {
"publicIpWhitelist": [
"[\"0.0.0.0\",\"10.2.XX.XX\",\"110.0.XX.XX/8\"]"
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.