RestartInstance

Updated at:

Restarts an Elasticsearch cluster.

Operation description

Note

After a restart, the instance enters the activating state. After the restart succeeds, the instance status changes to active. Alibaba Cloud Elasticsearch supports single-node restarts. Node restarts are classified into normal restarts and blue-green restarts.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

elasticsearch:RestartInstance

none

*Instance

acs:elasticsearch:{#regionId}:{#accountId}:instances/{#instancesId}

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

es-cn-nif1q8auz0003****

Request parameters

Parameter

Type

Required

Description

Example

force

boolean

No

Specifies whether to ignore the cluster state and force a restart. Valid values:

  • true: Ignores the cluster state.

  • false: Does not ignore the cluster state. This is the default value.

false

clientToken

string

No

The client token that is used to ensure the idempotence of the request. You can generate the value of this parameter on the client side. Ensure that the value is unique across different requests and contains a maximum of 64 ASCII characters.

5A2CFF0E-5718-45B5-9D4D-70B3FF****

body

string

No

The restart parameters.

1. restart nodes example: { "restartType": "nodeIp", "nodes": [ "es-cn-xx-data-j-0" ], "blueGreenDep": false } 2. restart instance example: { "restartType": "instance", "blueGreenDep": false }

Request body

You must also specify the following parameters in the request body to configure the restart parameters.

NameTypeRequiredExampleDescription
restartTypeStringNoinstanceThe restart type. Valid values:
instance: restarts the instance. This is the default value.
nodeIp: restarts a node. You must specify the IP address of the node.
nodeEcsId: restarts a node. You must specify the ID of the ECS instance in the cluster.







nodesListNo["127.0.."]The IP addresses or names of the nodes to be restarted. This parameter is required when you restart nodes.
blueGreenDepBooleanNofalseSpecifies whether to enable blue-green deployment when you restart a node. Default value: false.
batchCountDoubleNo25.0The concurrency level for a forced instance restart.
batchUnitStringNopercentThe unit of batchCount. Default value: percent.
replaceNodesBooleanNofalseSpecifies whether to replace the node with a new ECS instance. This parameter takes effect only when you restart a node in a cloud-native architecture.
Note
  • If you do not specify restartType or specify an empty string, the default value instance is used. When restartType is set to instance, the blueGreenDep parameter is ignored by default, and 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, the RestartBatchValueError error is reported.

    • If force is set to false, the default value of batchCount is 0. If you set it to another value, the NormalRestartNotSupportBatch error is reported.

  • When restartType is set to nodeIp, the batchCount parameter is ignored by default, and the following conditions must be met:
    • nodes cannot be empty. Otherwise, a parameter error is reported.

    • If blueGreenDep is set to true, blue-green deployment is enabled when the node is restarted. If it is set to false, blue-green deployment is not enabled, and a normal restart is performed.

Example:

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

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

F99407AB-2FA9-489E-A259-40CF6DC****

Result

object

The returned result.

nodeAmount

integer

The number of data nodes in the instance.

2

publicDomain

string

The public network access address.

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

createdAt

string

The time when the instance was created. The time is displayed in UTC and formatted in accordance with ISO 8601.

2020-07-06T10:18:48.662Z

status

string

The state of the instance. Valid values:

  • active: Normal.

  • activating: Activating.

  • inactive: Frozen.

  • invalid: Invalid.

active

kibanaPort

integer

The public port of Kibana.

5601

publicPort

integer

The public port.

9200

paymentType

string

The billing method of the instance. Valid values: prepaid (subscription) and postpaid (pay-as-you-go).

postpaid

domain

string

The internal endpoint of the instance.

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

description

string

The instance name.

es-cn-abc

esVersion

string

The Elasticsearch version of the instance.

6.7.0_with_X-Pack

kibanaDomain

string

The Kibana public network access address.

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

updatedAt

string

The time when the instance was last updated. The time is displayed in UTC and formatted in accordance with ISO 8601.

2018-07-18T10:10:04.484Z

instanceId

string

The instance ID.

es-cn-n6w1o1x0w001c****

dictList

array<object>

The IK dictionary configurations.

object

fileSize

integer

The size of the dictionary file. Unit: bytes.

2782602

type

string

The dictionary type. Valid values:

  • STOP: Stopwords.

  • MAIN: Main dictionary.

  • SYNONYMS: Synonym dictionary.

  • ALI_WS: Alibaba Cloud dictionary.

MAIN

name

string

The name of the dictionary file.

SYSTEM_MAIN.dic

sourceType

string

The source type. Valid values:

  • OSS: Object Storage Service (OSS). Make sure that the OSS bucket is publicly readable.

  • ORIGIN: Open-source Elasticsearch.

  • UPLOAD: Uploaded file.

ORIGIN

synonymsDicts

array<object>

The synonym dictionary configurations.

object

fileSize

integer

The size of the dictionary file. Unit: bytes.

2782602

type

string

The dictionary type. Valid values:

  • STOP: Stopwords.

  • MAIN: Main dictionary.

  • SYNONYMS: Synonym dictionary.

  • ALI_WS: Alibaba Cloud dictionary.

STOP

name

string

The name of the dictionary file.

SYSTEM_MAIN.dic

sourceType

string

The source type. Valid values:

  • OSS: Object Storage Service (OSS). Make sure that the OSS bucket is publicly readable.

  • ORIGIN: Open-source Elasticsearch.

  • UPLOAD: Uploaded file.

ORIGIN

kibanaConfiguration

object

The Kibana node configurations.

spec

string

The node specifications.

elasticsearch.n4.small

amount

integer

The number of nodes.

1

disk

integer

The storage space of the node. Unit: GB.

20

diskType

string

The storage type of the node.

cloud_ssd

masterConfiguration

object

The dedicated master node configurations.

spec

string

The node specifications.

elasticsearch.sn2ne.large

amount

integer

The number of nodes.

3

disk

integer

The storage space of the node. Unit: GB.

20

diskType

string

The storage type of the node. Only cloud_ssd (standard SSD) is supported.

cloud_ssd

networkConfig

object

The network configurations.

vpcId

string

The VPC ID.

vpc-bp16k1dvzxtmagcva****

vsArea

string

The zone where the instance resides.

cn-hangzhou-i

type

string

The network type. Only VPC is supported.

vpc

vswitchId

string

The vSwitch ID.

vsw-bp1k4ec6s7sjdbudw****

nodeSpec

object

The data node configurations.

spec

string

The node specifications.

elasticsearch.n4.small

disk

integer

The storage space of the node. Unit: GB.

50

diskType

string

The storage type of the node.

cloud_ssd

The following response example only guarantees the inclusion of the parameters listed in the response data. Other parameters are for reference only and must not be strictly relied upon in your code.

Examples

Success response

JSON format

{
  "RequestId": "F99407AB-2FA9-489E-A259-40CF6DC****",
  "Result": {
    "nodeAmount": 2,
    "publicDomain": "es-cn-n6w1o1x0w001c****.public.elasticsearch.aliyuncs.com",
    "createdAt": "2020-07-06T10:18:48.662Z",
    "status": "active",
    "kibanaPort": 5601,
    "publicPort": 9200,
    "paymentType": "postpaid",
    "domain": "es-cn-nif1q8auz0003****.elasticsearch.aliyuncs.com",
    "description": "es-cn-abc",
    "esVersion": "6.7.0_with_X-Pack",
    "kibanaDomain": "es-cn-nif1q8auz0003****.kibana.elasticsearch.aliyuncs.com",
    "updatedAt": "2018-07-18T10:10:04.484Z",
    "instanceId": "es-cn-n6w1o1x0w001c****",
    "dictList": [
      {
        "fileSize": 2782602,
        "type": "MAIN",
        "name": "SYSTEM_MAIN.dic",
        "sourceType": "ORIGIN"
      }
    ],
    "synonymsDicts": [
      {
        "fileSize": 2782602,
        "type": "STOP",
        "name": "SYSTEM_MAIN.dic",
        "sourceType": "ORIGIN"
      }
    ],
    "kibanaConfiguration": {
      "spec": "elasticsearch.n4.small",
      "amount": 1,
      "disk": 20,
      "diskType": "cloud_ssd"
    },
    "masterConfiguration": {
      "spec": "elasticsearch.sn2ne.large",
      "amount": 3,
      "disk": 20,
      "diskType": "cloud_ssd"
    },
    "networkConfig": {
      "vpcId": "vpc-bp16k1dvzxtmagcva****",
      "vsArea": "cn-hangzhou-i",
      "type": "vpc",
      "vswitchId": "vsw-bp1k4ec6s7sjdbudw****"
    },
    "nodeSpec": {
      "spec": "elasticsearch.n4.small",
      "disk": 50,
      "diskType": "cloud_ssd"
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InstanceActivating Instance is activating
400 InstanceNotFound The instanceId provided does not exist

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.