Updates the IP address whitelist of a specified Elasticsearch cluster.

Usage notes

  • The instance is in the Active (activating), Invalid (invalid), and Inactive (inactive) state and cannot be updated.
  • You can update the whitelist in two ways: IP address whitelist list and IP address whitelist group. The two methods cannot be used at the same time. In addition to InstanceId and clientToken, the two methods support different parameters, as follows:
    • IP address whitelist: whiteIpList, nodeType, and networkType
    • IP address whitelist groups: modifyMode and whiteIpGroup
  • Public network access whitelists do not support configuring private IP addresses. Private network access whitelists do not support configuring public IP addresses.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, refer to the documentation of common request parameters.

Request syntax

PATCHPOST /openapi/instances/{InstanceId}/actions/modify-white-ips HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
InstanceId String Path Yes es-cn-0pp1jxvcl000z****

The ID of the instance.

clientToken String Query No 5A2CFF0E-5718-45B5-9D4D-70B3FF****

The client token that is used to ensure the idempotence of the request. The value of this parameter is generated by the client and must be unique among different requests. The value can be up to 64 ascii characters in length.

Object Body No

The request body parameters.

nodeType String Body No WORKER

The type of the node. If the whiteIpList parameter is optional, this parameter is required. Valid values:

  • WORKER:Elasticsearch cluster
  • KIBANA:Kibana cluster
networkType String Body No PUBLIC

The network type. If the whiteIpList parameter is optional, this parameter is required. Valid values:

  • PRIVATE: private network
  • PUBLIC: public network
modifyMode String Body No Cover

The modification method. Valid values:

  • Cover (default): overwrites the original IP address whitelist with the value of the ips parameter.
  • Append: Add the IP addresses entered in the ips parameter to the original IP address whitelist.
  • Delete: Delete the IP addresses entered in the ips parameter from the original IP address whitelist. You must retain at least one IP address.
whiteIpList Array of String Body No 192.168.xx.xx

The list of IP address whitelists. This parameter is available if whiteIpGroup is left empty. The value of this parameter updates the IP address whitelist configurations in the Default whitelist group.

Notice You cannot configure whiteIpList and whiteIpGroup at the same time.
whiteIpGroup Object Body No

You can update the whitelist configurations of an instance by using a whitelist group. You can update only one whitelist group.

Notice You cannot configure whiteIpList and whiteIpGroup at the same time.
groupName String Body No test_group

The group name of the whitelist group. This parameter is required if the whiteIpGroup parameter is optional.

ips Array of String Body No 192.168.xx.xx

The list of IP addresses in the whitelist group. This parameter is required if the whiteIpGroup parameter is optional.

whiteIpType String Body No PRIVATE_ES

The type of the IP address whitelist. Valid values:

  • PRIVATE_KIBANA: the IP address whitelist of Kibana
  • PRIVATE_ES:Elasticsearch private network access whitelist
  • PUBLIC_ES:Elasticsearch Internet access whitelist
  • PUBLIC_KIBANA: the public IP address whitelist of Kibana
Notice The addition and deletion of whitelist groups are implemented by calling modifyMode to Cover. Delete and Append cannot add or delete whitelist groups at the same time. You can only modify the IP address list in the whitelist group. Take note of the following items:
  • If the modifyMode parameter is set to Cover, the whitelist group is deleted if ips is empty. If groupName is not in the list of existing whitelist group names, a whitelist group is created.
  • If the modifyMode parameter is set to Delete, you must retain at least one IP address for the deleted ips.
  • If the modifyMode parameter is set to Append, make sure that the whitelist group name has been created. Otherwise, the NotFound error message appears.

Response parameters

Parameter Type Example Description
Result Boolean true

Response:

  • true: The whitelist is updated.
  • false: The whitelist failed to be updated.
RequestId String 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1DERFG

The ID of the request.

Example

Sample request

PATCH /openapi/instances/es-cn-0pp1jxvcl000z****/actions/modify-white-ips HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
{
    "nodeType" : "WORKER",
    "networkType" : "PUBLIC",
    "whiteIpList": [
        "110.0.XX.XX/8"
    ]
}
or
{
    "modifyMode": "cover",
    "whiteIpGroup": {
        "groupName": "test_group_name", 
        "ips": [
            "0.0.0.0", 
            "10.2.XX.XX"
        ],
        "whiteIpType" : "PRIVATE_ES"
    }
}

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyWhiteIpsResponse>
    <Result>true</Result>
    <RequestId>5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1DERFG</RequestId>
</ModifyWhiteIpsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Result" : true,
  "RequestId" : "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1DERFG"
}

Error codes

For a list of error codes, visit the API Error Center.