Upgrades the version or kernel of an Elasticsearch cluster.

Note You can upgrade an instance version only from version 5.5.3 to version 5.6.16, version 5.6.16 to version 6.3.2, and version 6.3.2 to version 6.7.0. For more information, see Upgrade version.


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/upgrade-version HTTP/1.1

Request parameters

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

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. 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.

dryRun Boolean Query No false

Indicates whether to perform pre-upgrade verification:

  • true: verification
  • false (default): does not verify
Warning Version upgrade verification involves checking the cluster YML, plug-in configurations, cluster status, indexes, and resources. We strongly recommend that you perform pre-verification before the upgrade. Otherwise, upgrade issues may occur.
Object Body No

The body of the request.

version String Body No 6.7

The latest version. If type is set to engineVersion, the value is the instance version, for example, 6.7. If type is set to aliVersion, the value is the kernel version, for example, ali1.2.0.

type String Body No engineVersion

The type of the upgrade. Valid values:

  • engineVersion (default): Major version upgrade
  • aliVersion: kernel version upgrade

Response parameters

Parameter Type Example Description
RequestId String F99407AB-2FA9-489E-A259-40CF6DC*****

The ID of the request.

Result Array of Result

The moderation results.

validateType String checkClusterHealth

The monitoring type. Valid values:

  • checkClusterHealth: Cluster Health Status
  • checkConfigCompatible: Configuration Compatibility Status
  • checkClusterResource: resource space status
  • checkClusterSnapshot: Whether a snapshot exists
validateResult Array of validateResult

The verification information.

errorType String clusterStatus

The type of the error. Valid values:

  • clusterStatus: the health status of the cluster.
  • clusterConfigYml: Cluster YML File
  • clusterConfigPlugins: Cluster Configuration File
  • clusterResource: cluster resources
  • clusterSnapshot: cluster snapshot
errorCode String ClusterStatusNotHealth

The error code returned if the request failed.

errorMsg String The cluster status is not health

The error message returned.

status String success

The verification is passed. Valid values:

  • success: through
  • failed: failed


Sample requests

POST /openapi/instances/es-cn-n6w1o1x0w001c****/actions/upgrade-version?clientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF****&dryRun=false HTTP/1.1

  "version" : "6.7",
  "type" : "engineVersion"

Sample success response

JSON format

HTTP/1.1 200 OK

  "Result" : [ {
    "validateType" : "checkClusterHealth",
    "status" : "failed",
    "validateResult" : [ {
      "errorType" : "clusterStatus",
      "errorCode" : "ClusterStatusNotHealth",
      "errorMsg" : "ClusterStatusNotHealth"
    } ]
  }, {
    "validateType" : "checkConfigCompatible",
    "status" : "failed",
    "validateResult" : [ {
      "errorType" : "clusterConfigYml",
      "errorCode" : "ClusterYamlNotCompatible",
      "errorMsg" : "ClusterYamlNotCompatible"
    }, {
      "errorType" : "clusterConfigPlugins",
      "errorCode" : "ClusterPluginsNotSupport",
      "errorMsg" : "ClusterPluginsNotSupport"
    } ]
  }, {
    "validateType" : "checkClusterResource",
    "status" : "failed",
    "validateResult" : [ {
      "errorType" : "clusterResource",
      "errorCode" : "ClusterResourceNotEnough",
      "errorMsg" : "ClusterResourceNotEnough"
    } ]
  }, {
    "validateType" : "checkClusterSnapshot",
    "status" : "failed",
    "validateResult" : [ {
      "errorType" : "clusterSnapshot",
      "errorCode" : "ClusterSnapshotNotAvaild",
      "errorMsg" : "ClusterSnapshotNotAvaild"
    } ]
  } ],
  "RequestId" : "F99407AB-2FA9-489E-A259-40CF6DC****"

Error codes

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