Restarts a specified Elasticsearch cluster.

Note After the instance is restarted, it enters the active state. After the instance is restarted, its status changes to active. Alibaba Cloud Elasticsearch supports single-node restart. Node restart includes normal restart and blue-green restart.

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

Request parameters

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

The instance ID.

force Boolean Query No false

Specifies whether to ignore the status of the instance and forcibly restart the instance.

  • true
  • false: does not ignore this parameter. This is the default value.
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 token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

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

Specifies the restart parameter information.

RequestBody

You must also specify the following parameters in the RequestBody parameter to specify the restart parameters.

Parameter

Type

Required

Example

Description

restartType

String

No

instance

The restart type. Valid values:

instance: The instance is restarted. This is the default value.

nodeIp: The node restarts. You need to specify the IP address of the node.

nodeEcsId: The node is restarted. You must specify the ID of an ECS instance in the cluster.

nodes

List<String>

No

["127.0.*.*"]

If you select Node Restart, specify the IP address or ID of the node to be restarted.

blueGreenDep

Boolean

No

false

Specifies whether to enable blue-green deployment when the node is restarted. Default value: false.

batchCount

Double

No

25.0

The concurrency that is specified when the instance is forcibly restarted.

batchUnit

String

No

percent

The unit of the batchCount. Default value: percent.

Note
  • If restartType is not specified or an empty string is specified, the default value is instance. If you set the parameter to instance, the blueGreenDep parameter is ignored by default. The following conditions must be met:
    • If force is set to true, batchCount must be greater than 0 and less than or equal to 100. Otherwise, an error RestartBatchValueError is returned.
    • If force is set to false, batchCount is 0 by default. If it is set to another value, an error NormalRestartNotSupportBatch.
  • If restartType is set to nodeIp, the batchCount parameter is ignored by default and the following conditions must be met:
    • The nodes parameter cannot be empty. Otherwise, the error message is returned.
    • If blueGreenDep is set to true, blue-green deployment is enabled when the node is restarted. If false, blue-green deployment is not enabled, that is, normal restart.

Sample statement:


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

Response parameters

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

The request ID.

Result Object

The returned result.

nodeAmount Integer 2

The number of data nodes.

publicDomain String es-cn-n6w1o1x0w001c****.public.elasticsearch.aliyuncs.com

The public endpoint of the cluster.

createdAt String 2020-07-06T10:18:48.662Z

The time when the instance was created.

status String active

The status of the cluster. The following configurations are supported:

  • active: Normal
  • activating: Effective
  • inactive: frozen
  • invalid: Fail
kibanaPort Integer 5601

The port number that is used to access the Kibana console of the cluster over the Internet.

publicPort Integer 9200

The port number that is used to access the cluster over the Internet.

paymentType String postpaid

The billing method of the instance.

Prepaid (subscription) and postpaid (pay-as-you-go) are supported.

domain String es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com

The internal endpoint of the cluster.

description String es-cn-abc

The name of the instance.

esVersion String 6.7.0_with_X-Pack

The version of the cluster.

kibanaDomain String es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com

The public endpoint of the Kibana console of the cluster.

updatedAt String 2018-07-18T10:10:04.484Z

The time when the instance was last updated.

instanceId String es-cn-n6w1o1x0w001c****

The instance ID.

dictList Array of dictList

The configurations of IK dictionaries.

fileSize Long 2782602

The size of the dictionary file. Unit: byte.

type String MAIN

The type of the dictionary. Valid values:

  • STOP: stopword list
  • MAIN: main dictionary
  • SYNONYMS: synonym dictionary
  • ALI_WS: Alibaba Cloud dictionary
name String SYSTEM_MAIN.dic

The name of the dictionary file.

sourceType String ORIGIN

The type of the source of the dictionary file. Valid values:

  • OSS: Object Storage Service (OSS). You must make sure that the ACL of the related OSS bucket is public read.
  • ORIGIN: Open source Elasticsearch
  • UPLOAD: uploaded files
synonymsDicts Array of synonymsDicts

The configurations of synonym dictionaries.

fileSize Long 2782602

The size of the dictionary file. Unit: byte.

type String STOP

The type of the dictionary. Valid values:

  • STOP: stopword list
  • MAIN: main dictionary
  • SYNONYMS: synonym dictionary
  • ALI_WS: Alibaba Cloud dictionary
name String SYSTEM_MAIN.dic

The name of the dictionary file.

sourceType String ORIGIN

The type of the source of the dictionary file. Valid values:

  • OSS: Object Storage Service (OSS). You must make sure that the ACL of the related OSS bucket is public read.
  • ORIGIN: Open source Elasticsearch
  • UPLOAD: uploaded files
kibanaConfiguration Object

The configurations of Kibana nodes.

spec String elasticsearch.n4.small

The specifications of the node.

amount Integer 1

The number of nodes.

disk Integer 20

The size of the node storage space. Unit: GB.

diskType String cloud_ssd

The storage type.

masterConfiguration Object

The configurations of dedicated master nodes.

spec String elasticsearch.sn2ne.large

The specifications of the node.

amount Integer 3

The number of nodes.

disk Integer 20

The size of the node storage space. Unit: GB.

diskType String cloud_ssd

The storage type. Only cloud_ssd is supported.

networkConfig Object

The network configurations.

vpcId String vpc-bp16k1dvzxtmagcva****

The VPC ID of the cluster.

vsArea String cn-hangzhou-i

Select a zone for the NLB instance.

type String vpc

The network type. Only the VPC is supported.

vswitchId String vsw-bp1k4ec6s7sjdbudw****

The vSwitch ID of the cluster.

nodeSpec Object

The configurations of data nodes.

spec String elasticsearch.n4.small

The specifications of the node.

disk Integer 50

The storage capacity of the node. Unit: GB.

diskType String cloud_ssd

The storage type.

In the following return example, this article only ensures that the parameters in the returned data list are included, and the parameters not mentioned are for reference only. The program cannot be forced to rely on to obtain these parameters.

Examples

Sample requests

POST /openapi/instances/es-cn-nif1q8auz0003****/actions/restart HTTP/1.1
Common request header
{
    "restartType":"nodeIp",
    "nodes":["172.16.xx.xx","172.16.xx.xx"],
    "blueGreenDep":true
}

Sample success responses

JSON format

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

{
  "Result" : {
    "instanceId" : "es-cn-nif1q8auz0003****",
    "version" : "7.4.0_with_X-Pack",
    "description" : "es-cn-nif1q8auz0003****",
    "nodeAmount" : 3,
    "paymentType" : "prepaid",
    "status" : "active",
    "privateNetworkIpWhiteList" : [ "0.0.0.0/0" ],
    "enablePublic" : false,
    "nodeSpec" : {
      "spec" : "elasticsearch.n4.small",
      "disk" : 20,
      "diskType" : "cloud_ssd",
      "diskEncryption" : false
    },
    "networkConfig" : {
      "vpcId" : "vpc-bp16k1dvzxtmagcva****",
      "vswitchId" : "vsw-bp1k4ec6s7sjdbudw****",
      "vsArea" : "cn-hangzhou-i",
      "type" : "vpc"
    },
    "createdAt" : "2020-07-06T10:18:48.662Z",
    "updatedAt" : "2020-07-06T10:18:48.662Z",
    "commodityCode" : "elasticsearchpre",
    "extendConfigs" : [ {
      "configType" : "usageScenario",
      "value" : "general"
    }, {
      "configType" : "maintainTime",
      "maintainStartTime" : "02:00Z",
      "maintainEndTime" : "06:00Z"
    } ],
    "endTime" : 1596729600000,
    "clusterTasks" : [ ],
    "vpcInstanceId" : "es-cn-nif1q8auz0003****-worker",
    "resourceGroupId" : "rg-acfm2h5vbzd****",
    "zoneCount" : 1,
    "protocol" : "HTTP",
    "zoneInfos" : [ {
      "zoneId" : "cn-hangzhou-i",
      "status" : "NORMAL"
    } ],
    "instanceType" : "elasticsearch",
    "inited" : true,
    "tags" : [ ],
    "domain" : "es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com",
    "port" : 9200,
    "esVersion" : "7.4.0_with_X-Pack",
    "esConfig" : {
      "action.destructive_requires_name" : "true",
      "xpack.watcher.enabled" : "false",
      "action.auto_create_index" : "+.*,-*"
    },
    "esIPWhitelist" : [ "0.0.0.0/0" ],
    "esIPBlacklist" : [ ],
    "kibanaIPWhitelist" : [ "0.0.0.0/0", "::/0" ],
    "kibanaPrivateIPWhitelist" : [ ],
    "publicIpWhitelist" : [ ],
    "kibanaDomain" : "es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com",
    "kibanaPort" : 5601,
    "haveKibana" : true,
    "instanceCategory" : "x-pack",
    "dedicateMaster" : false,
    "advancedDedicateMaster" : false,
    "masterConfiguration" : { },
    "haveClientNode" : false,
    "warmNode" : false,
    "warmNodeConfiguration" : { },
    "clientNodeConfiguration" : { },
    "kibanaConfiguration" : {
      "spec" : "elasticsearch.n4.small",
      "amount" : 1,
      "disk" : 0
    },
    "dictList" : [ {
      "name" : "SYSTEM_MAIN.dic",
      "fileSize" : 2782602,
      "sourceType" : "ORIGIN",
      "type" : "MAIN"
    }, {
      "name" : "SYSTEM_STOPWORD.dic",
      "fileSize" : 132,
      "sourceType" : "ORIGIN",
      "type" : "STOP"
    } ],
    "synonymsDicts" : [ ],
    "ikHotDicts" : [ ],
    "aliwsDicts" : [ ],
    "haveGrafana" : false,
    "haveCerebro" : false,
    "enableKibanaPublicNetwork" : true,
    "enableKibanaPrivateNetwork" : false,
    "advancedSetting" : {
      "gcName" : "CMS"
    }
  },
  "RequestId" : "BB58A51D-CE72-49F9-AF08-F57F3C8A****"
}

HTTP status code

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