Obtains the estimated time that is required to restart an Elasticsearch cluster.

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}/estimated-time/restart-time HTTP/1.1

Request parameters

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

The ID of the instance.

force Boolean Query None false

Specifies whether to forcibly restart the cluster. Default value: false.

String Body None { "restartType":"nodeIp", "nodes": ["172.16.xx.xx"], "blueGreenDep":true }

Specifies the restart parameter information.

RequestBody

You can configure the following parameters in the request body to specify information about the restart.

Parameter

Type

Required

Example

Description

restartType

String

None

instance

The restart type. Supported types:

instance: restarts the instance. This is the default value.

nodeIp: The node is restarted.

nodes

List<String>

None

["127.0.0.1"]

Select the IP address list of the target node when the node is restarted.

blueGreenDep

Boolean

None

false

Specifies whether to perform a blue-green change when the node is restarted. Default value: false

batch

double

None

25.0

The concurrency of the instance restart. The default value of this parameter is 1 divided by the total number of nodes in the cluster.

batchUnit

String

None

percent

The unit of the batch. Default value: percent.

Note
  • If you set the restartType parameter to instance, you do not need to configure the blueGreenDep parameter.
    • If you set the force parameter to true, you must set the batch parameter to a value that is greater than 0 and less than or equal to 100. Otherwise, the system reports the RestartBatchValueError error.
    • If you set the force parameter to false, the default value of the batch parameter is 0. If you set the batch parameter to a value other than 0, the system reports the NormalRestartNotSupportBatch error.
  • If you set the restartType parameter to nodeIp, you do not need to configure the batch parameter.
    • If the nodes parameter is not configured, the system reports a parameter configuration error.
    • If you set the blueGreenDep parameter to true, the system performs a blue-green restart. If you set the blueGreenDep parameter to false, the system performs a normal restart.

Sample statement:


{
    "restartType":"nodeIp",
    "nodes": ["172.16.xx.xx"],
    "blueGreenDep":true
}

Response parameters

Parameter Type Example Description
RequestId String 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****

The request ID.

Result Object

The returned result.

unit String second

The unit.

value Long 50

The estimated restart time.

Examples

Sample requests

POST /openapi/instances/es-cn-n6w1o1x0w001c****/estimated-time/restart-time?force=true HTTP/1.1
Common request header

Sample success responses

JSON format

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

{
  "Result" : {
    "unit" : "second",
    "value" : 4200
  },
  "RequestId" : "7ACE8751-DD1B-40DB-A253-9080CA58****"
}

HTTP status code

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