You can call this operation to restart a specified Elasticsearch instance.
Debugging
Request header
This operation uses common request parameters only. For more information, see Common parameters.
Request syntax
POST /openapi/instances/[InstanceId]/actions/restart HTTPS|HTTP
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
InstanceId | String | Yes | es-cn-nif1q8auz0003**** |
The ID of the instance. |
force | Boolean | No | false |
Specifies whether to ignore the status of the instance and forcibly restart the instance. |
clientToken | String | No | 5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
A unique token generated by the client to guarantee the idempotency of the request. The maximum length of the token is 64 ASCII characters. |
RequestBody
The following parameters must be specified in RequestBody:
Parameter |
Type |
Required |
Example |
Description |
---|---|---|---|---|
restartType |
String |
No |
instance |
The restart type. Valid values: instance(default): Instance restart. nodeIp: To restart the node, you need to specify the IP address of the node. nodeEcsId: To restart a node, you need to specify the ID of the ECS instance in the cluster. |
nodes |
List<String> |
No |
["127.0.0.1"] |
When selecting a node to restart, specify the IP address or ID of the node to be restarted. |
blueGreenDep |
Boolean |
No |
false |
Whether to enable blue-green deployment when the node restarts. Default value: false. |
batchCount |
Double |
No |
25.0 |
Set the concurrency when the instance is forced to restart. |
batchUnit |
String |
No |
percent |
The unit of the batchCount. Default value: percent. |
- If the restartType parameter is not specified or is empty, the default value is instance. For instance the blueGreenDep parameter is ignored by default, and the following conditions must be met:
- When the value of force is true, the value of batchCount must be greater than 0 but less than or equal to 100. Otherwise, a RestartBatchValueError error is returned.
- When the force parameter is set to false, batchCount is set to 0 by default. If it is set to another value, an error NormalRestartNotSupportBatch.
- When the value of restartType is nodeIp, the batchCount parameter is ignored. And the following conditions are met:
- The error message returned if the nodes parameter is null.
- when the bluependep is true, the blue-green deployment is enabled when the node is restarted. When this parameter is set to false, the system does not enable the blue-green deployment and restarts normally.
Example:
{
"restartType":"nodeIp",
"nodes":["172.16.xx.xx","172.16.xx.xx"],
"blueGreenDep":true
}
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | F99407AB-2FA9-489E-A259-40CF6DC**** |
The ID of the request. |
Result | Struct |
The return results. |
|
createdAt | String | 2020-07-06T10:18:48.662Z |
The time when the instance was created. |
description | String | es-cn-abc |
The name of the instance. |
dictList | Array of dictList |
The configuration of the IK dictionaries. |
|
dictList | |||
fileSize | Long | 2782602 |
The size of the Dictionary File. Unit: bytes. |
name | String | SYSTEM_MAIN.dic |
The name of the dictionary file. |
sourceType | String | ORIGIN |
The source type. Valid values:
|
type | String | MAIN |
The type of the dictionary. Valid values:
|
domain | String | es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com |
The intranet access address of the instance. |
esVersion | String | 6.7.0_with_X-Pack |
The version of the instance. |
instanceId | String | es-cn-n6w1o1x0w001c**** |
The ID of the instance. |
kibanaConfiguration | Struct |
The configuration of Kibana nodes. |
|
amount | Integer | 1 |
The number of performance metrics. |
disk | Integer | 20 |
The size of the node storage space. Unit: GB. |
diskType | String | cloud_ssd |
The storage type of the node. |
spec | String | elasticsearch.n4.small |
The specification of data nodes. |
kibanaDomain | String | es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com |
The public network access address of Kibana. |
kibanaPort | Integer | 5601 |
The public port of the Kibana network. |
masterConfiguration | Struct |
The configuration of dedicated master nodes. |
|
amount | Integer | 3 |
The number of nodes in the cluster. |
disk | Integer | 20 |
The size of the node storage space. Unit: GB. |
diskType | String | cloud_ssd |
The storage type of the node. This tool only supports cloud_ssd (cloud SSD) disks. |
spec | String | elasticsearch.sn2ne.large |
The node specifications of the cluster. |
networkConfig | Struct |
The network configuration. |
|
type | String | vpc |
The network type. Only Virtual Private Cloud (VPC) is supported. |
vpcId | String | vpc-bp16k1dvzxtmagcva**** |
The ID of the VPC. |
vsArea | String | cn-hangzhou-i |
The zone where the instance is deployed. |
vswitchId | String | vsw-bp1k4ec6s7sjdbudw**** |
The ID of the VSwitch associated with the specified VPC. |
nodeAmount | Integer | 2 |
The number of data nodes. |
nodeSpec | Struct |
The configuration of data nodes. |
|
disk | Integer | 50 |
The storage space size per data node. Unit: GB. |
diskType | String | cloud_ssd |
The storage type of the node. Valid values: cloud_ssd and cloud_efficiency. |
spec | String | elasticsearch.n4.small |
The specification of data nodes. |
paymentType | String | postpaid |
The billing method of the created ECS instance. Valid values: prepaid and postpaid. |
publicDomain | String | es-cn-n6w1o1x0w001c****.public.elasticsearch.aliyuncs.com |
The public network access address. |
publicPort | Integer | 9200 |
The public network port. |
status | String | active |
The state of the cluster. Supported: active (normal), activating (initializing), inactive (blocked), and invalid (expired). |
synonymsDicts | Array of synonymsDicts |
The configuration of the synonym dictionaries. |
|
synonymsDicts | |||
fileSize | Long | 2782602 |
The size of the Dictionary File. Unit: bytes. |
name | String | SYSTEM_MAIN.dic |
The name of the dictionary file. |
sourceType | String | ORIGIN |
The source type. Valid values:
|
type | String | STOP |
The type of the dictionary. Valid values:
|
updatedAt | String | 2018-07-18T10:10:04.484Z |
The time when the instance was last updated. |
The following response examples may contain the parameters in the list of returned data. These parameters are for reference only. You must make sure that your application is not strongly reliant on these parameters.
Examples
Sample requests
POST /openapi/instances/es-cn-nif1q8auz0003****/actions/restart HTTP/1.1
Common request parameters
{
"restartType":"nodeIp",
"nodes":["172.16.xx.xx","172.16.xx.xx"],
"blueGreenDep":true
}
Sample success responses
XML
format
<Result>
<instanceId>es-cn-nif1q8auz0003****</instanceId>
<version>7.4.0_with_X-Pack</version>
<description>es-cn-nif1q8auz0003****</description>
<nodeAmount>3</nodeAmount>
<paymentType>prepaid</paymentType>
<status>active</status>
<privateNetworkIpWhiteList>0.0.0.0/0</privateNetworkIpWhiteList>
<enablePublic>false</enablePublic>
<nodeSpec>
<spec>elasticsearch.n4.small</spec>
<disk>20</disk>
<diskType>cloud_ssd</diskType>
<diskEncryption>false</diskEncryption>
</nodeSpec>
<networkConfig>
<vpcId>vpc-bp16k1dvzxtmagcva****</vpcId>
<vswitchId>vsw-bp1k4ec6s7sjdbudw****</vswitchId>
<vsArea>cn-hangzhou-i</vsArea>
<type>vpc</type>
</networkConfig>
<createdAt>2020-07-06T10:18:48.662Z</createdAt>
<updatedAt>2020-07-06T10:18:48.662Z</updatedAt>
<commodityCode>elasticsearchpre</commodityCode>
<extendConfigs>
<configType>usageScenario</configType>
<value>general</value>
</extendConfigs>
<extendConfigs>
<configType>maintainTime</configType>
<maintainStartTime>02:00Z</maintainStartTime>
<maintainEndTime>06:00Z</maintainEndTime>
</extendConfigs>
<endTime>1596729600000</endTime>
<vpcInstanceId>es-cn-nif1q8auz0003****-worker</vpcInstanceId>
<resourceGroupId>rg-acfm2h5vbzd****</resourceGroupId>
<zoneCount>1</zoneCount>
<protocol>HTTP</protocol>
<zoneInfos>
<zoneId>cn-hangzhou-i</zoneId>
<status>NORMAL</status>
</zoneInfos>
<instanceType>elasticsearch</instanceType>
<inited>true</inited>
<domain>es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com</domain>
<port>9200</port>
<esVersion>7.4.0_with_X-Pack</esVersion>
<esConfig>
<action.destructive_requires_name>true</action.destructive_requires_name>
<xpack.watcher.enabled>false</xpack.watcher.enabled>
<action.auto_create_index>+.*,-*</action.auto_create_index>
</esConfig>
<esIPWhitelist>0.0.0.0/0</esIPWhitelist>
<kibanaIPWhitelist>0.0.0.0/0</kibanaIPWhitelist>
<kibanaIPWhitelist>::/0</kibanaIPWhitelist>
<kibanaDomain>es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com</kibanaDomain>
<kibanaPort>5601</kibanaPort>
<haveKibana>true</haveKibana>
<instanceCategory>x-pack</instanceCategory>
<dedicateMaster>false</dedicateMaster>
<advancedDedicateMaster>false</advancedDedicateMaster>
<masterConfiguration/>
<haveClientNode>false</haveClientNode>
<warmNode>false</warmNode>
<warmNodeConfiguration/>
<clientNodeConfiguration/>
<kibanaConfiguration>
<spec>elasticsearch.n4.small</spec>
<amount>1</amount>
<disk>0</disk>
</kibanaConfiguration>
<dictList>
<name>SYSTEM_MAIN.dic</name>
<fileSize>2782602</fileSize>
<sourceType>ORIGIN</sourceType>
<type>MAIN</type>
</dictList>
<dictList>
<name>SYSTEM_STOPWORD.dic</name>
<fileSize>132</fileSize>
<sourceType>ORIGIN</sourceType>
<type>STOP</type>
</dictList>
<haveGrafana>false</haveGrafana>
<haveCerebro>false</haveCerebro>
<enableKibanaPublicNetwork>true</enableKibanaPublicNetwork>
<enableKibanaPrivateNetwork>false</enableKibanaPrivateNetwork>
<advancedSetting>
<gcName>CMS
</advancedSetting>
</Result>
<RequestId>BB58A51D-CE72-49F9-AF08-F57F3C8A****</RequestId>
JSON
format
{
"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****"
}
Error codes
For a list of error codes, visit the API Error Center.