Removes nodes from an Elasticsearch cluster.

When you call this operation, take note of the following items:

Before you remove data nodes, you must migrate the data stored on them to other nodes.

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, see Common request headers.

Request syntax

POST /openapi/instances/{InstanceId}/actions/shrink HTTP/1.1

Request parameters

Parameter Type Location Required Example value Message
InstanceId String Path Yes es-cn-nif1q9o8r0008****

The ID of the instance.

nodeType String Query Yes WORKER

The type of nodes to be scaled in. Valid values:

  • WORKER: hot node
  • WORKER_WARM: warm node
clientToken String Query No 5A2CFF0E-5718-45B5-9D4D-70B3FF****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

ignoreStatus Boolean Query No false

Specifies whether to ignore the health status of the cluster. Valid values:

  • true: ignore
  • false: does not ignore
count Integer Query No 2

The number of reduced nodes.

Important This parameter is applicable only to ACK instances. You cannot specify the host parameter in the body.
Array Body No

The body of the request.

host String Body No 192.168.xx.xx

The IP address of the node.

zoneId String Body No cn-shanghai-c

The ID of the zone where the instance node resides. For example, the value of Zone C in Shanghai is cn-shanghai-c.

nodeType String Body No WORKER

The type of the node to be scaled out. Optional values:

  • WORKER: hot node
  • WORKER_WARM: warm node
port Integer Body No 9200

The access port number of the node.

hostName String Body No es-cn-pl32xxxxxxx-data-f-1

cloud-native the name of the node in the ACK cluster. You can call the ListAllNode operation to query the name.

Response parameters

Parameter Type Example Message
Result Boolean true

Command output:

  • true: The scale-in is successful.
  • false: The scale-in failed.
RequestId String F99407AB-2FA9-489E-A259-40CF6DCC****

The ID of the region.

Examples

Sample requests

POST /openapi/instances/es-cn-nif1q9o8r0008****/actions/shrink?nodeType=WORKER&clientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF****&ignoreStatus=false HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

[ {
  "host" : "192.168.xx.xx",
  "port" : 9200,
  "zoneId" : "cn-shanghai-c"
} ]

Sample success responses

JSON format

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

{
  "Result" : true,
  "RequestId" : "C82758DD-282F-4D48-934F-92170A33****"
}

Error code

For a list of error codes, see Service error codes.