All Products
Search
Document Center

Elasticsearch:createInstance

Last Updated:Sep 10, 2024

Call the createInstance operation to create a Elasticsearch instance.

Usage notes

  • You have a good command of the billing and pricing standards of Alibaba Cloud Elasticsearch. For more information, see Pricing of Alibaba Cloud Elasticsearch.

  • You have passed real-name verification.

  • You do not need to specify a zone when you create a cluster. By default, the cluster is deployed in the same zone as the specified virtual private cloud (VPC).

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 does not have operation-specific request headers and uses only common request headers. For more information, see Common request headers.

Request syntax

POST /openapi/instances HTTP/1.1

Request parameters

Parameter

Type

Position

Required

Example

Description

clientToken

String

Query

No.

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

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.

Object

Body

No

The request parameters.

zoneCount

Integer

Body

No.

2

The number of zones to deploy the cluster. Valid values: 1, 2, and 3. Default value: 1.

paymentType

String

Body

No

postpaid

The billing method. Valid values:

  • postpaid: pay-as-you-go

  • prepaid: subscription

paymentInfo

PaymentInfo

Body

No

The billing details of the cluster. This parameter is required if you set the paymentType to prepaid.

nodeAmount

Integer

Body

Yes

3

The number of data nodes. Valid values: 2 to 50.

instanceCategory

String

Body

No

advanced

version type:

  • x-pack: Create an instance of the Commercial Edition or an instance of the Kernel-Enhanced Edition with Indexing Service and OpenStore disabled.

  • IS: Creates a kernel-enhanced instance with Indexing Service or OpenStore enabled.

esAdminPassword

String

Body

Yes

Es_password

The password used to access the cluster. The password must be 8 to 32 characters in length and must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: ! @ # $ % ^ & * ( ) _ + - =

esVersion

String

Body

Yes

5.5.3_with_X-Pack

The version of the instance. Valid values:

  • 8.5.1_with_X-Pack

  • 7.10_with_X-Pack

  • 6.7_with_X-Pack

  • 7.7_with_X-Pack

  • 6.8_with_X-Pack

  • 6.3_with_X-Pack

  • 5.6_with_X-Pack

  • 5.5.3_with_X-Pack

Note

The preceding versions may not include all versions supported by the Elasticsearch instance. You can call the GetRegionConfiguration operation to view the supported versions.

nodeSpec

NodeSpec

Body

No

The configurations of data nodes.

Note

When you use createInstance to create a new generation of disk-type data nodes in the China (Beijing), China (Shanghai), China (Hangzhou), and China (Shenzhen) regions, you must specify the instance family and suffix .new, for example, Elasticsearch. sn1 ne.large.new.

masterConfiguration

MasterNodeConfiguration

Body

No

The configurations of dedicated master nodes.

Note

When you use createInstance to create a new generation of disk-type data nodes in the China (Beijing), China (Shanghai), China (Hangzhou), and China (Shenzhen) regions, you must specify the instance family and suffix .new, for example, Elasticsearch. sn1 ne.large.new.

warmNodeConfiguration

WarmNodeConfiguration

Body

No

The configurations of warm nodes.

clientNodeConfiguration

ClientNodeConfiguration

Body

No

The configurations of client nodes.

elasticDataNodeConfiguration

ElasticDataNodeConfiguration

Body

No

The configurations of elastic nodes.

kibanaConfiguration

KibanaNodeConfiguration

Body

No

The configurations of Kibana nodes.

Note

We strongly recommend that you enable the Kibana node.

networkConfig

NetworkConfig

Body

Yes

The network configurations.

Note

You cannot specify an IP address whitelist when you create an instance.

resourceGroupId

String

Body

No

rg-aekzu7tsu4n****

The ID of the resource group to which the instance belongs.

description

String

Body

No

es

The name of the instance.

tags

Array

Body

No

The tag group of the instance.

tagKey

String

Body

No

KeyTest

The tag key of the instance.

tagValue

String

Body

No

KeyValue

The tag value of the instance.

Note
  • Alibaba Cloud Elasticsearch a list of supported node specifications, see Alibaba Cloud Elasticsearch Pricing and Specifications.

  • The diskType parameter specifies the storage type of the node. This parameter is required for basic disks. This parameter is not required for local disks.

Request body examples:

  • Create a General-purpose Business Edition instance that contains both hot and cold nodes.

    {
      "description": "xpack-hot-cold",
      "nodeAmount": 2,
      "esVersion": "7.10_with_X-Pack",
      "instanceCategory": "x-pack",
      "nodeSpec": {
        "spec": "elasticsearch.sn2ne.xlarge",
        "disk": 20,
        "diskType": "cloud_ssd"
      },
      "warmNodeConfiguration": {
        "spec": "elasticsearch.sn1ne.xlarge",
        "amount": 3,
        "diskType": "cloud_efficiency",
        "disk": 500
      },
      "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-8vbfu74bmw4m7m84a****",
        "vswitchId": "vsw-8vbnk6cmurbpump2f****",
        "vsArea": "cn-zhangjiakou-c"
      },
      "paymentType": "postpaid",
      "esAdminPassword": "yourPassword",
      "kibanaConfiguration": {
        "spec": "elasticsearch.sn1ne.large"
      }
    }
    
  • Create an Indexing Service series instance that contains only hot nodes.

    {
      "description": "is-hot",
      "nodeAmount": 2,
      "esVersion": "7.10_with_X-Pack",
      "instanceCategory": "IS",
      "nodeSpec": {
        "spec": "elasticsearch.sn1ne.xlarge",
        "disk": 20,
        "diskType": "cloud_ssd"
      },
      "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-8vbfu74bmw4m7m84a****",
        "vswitchId": "vsw-8vbnk6cmurbpump2f****",
        "vsArea": "cn-zhangjiakou-c"
      },
      "paymentType": "postpaid",
      "esAdminPassword": "yourPassword",
      "kibanaConfiguration": {
        "spec": "elasticsearch.sn1ne.large"
      }
    }
    
  • Create an Indexing Service series instance that contains only cold nodes.

    {
      "description": "is-cold",
      "nodeAmount": 2,
      "esVersion": "7.10_with_X-Pack",
      "instanceCategory": "IS",
      "warmNodeConfiguration": {
        "spec": "group.c6.large.500",
        "amount": 3,
        "disk": 300
      },
      "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-8vbfu74bmw4m7m84a****",
        "vswitchId": "vsw-8vbnk6cmurbpump2f****",
        "vsArea": "cn-zhangjiakou-c"
      },
      "paymentType": "postpaid",
      "esAdminPassword": "yourPassword",
      "kibanaConfiguration": {
        "spec": "elasticsearch.sn1ne.large"
      }
    }
    
  • Create an Indexing Service series instance that contains both hot and cold nodes.

    {
      "description": "is-hot-cold",
      "nodeAmount": 2,
      "esVersion": "7.10_with_X-Pack",
      "instanceCategory": "IS",
      "nodeSpec": {
        "spec": "elasticsearch.sn2ne.xlarge",
        "disk": 50,
        "diskType": "cloud_ssd"
      },
      "warmNodeConfiguration": {
        "spec": "group.c6.large.500",
        "amount": 3,
        "disk": 300
      },
      "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-8vbfu74bmw4m7m84a****",
        "vswitchId": "vsw-8vbnk6cmurbpump2f****",
        "vsArea": "cn-zhangjiakou-c"
      },
      "paymentType": "postpaid",
      "esAdminPassword": "yourPassword",
      "kibanaConfiguration": {
        "spec": "elasticsearch.sn1ne.large"
      }
    }
    
  • Create an Indexing Service series instance, enable OpenStore storage, and include both cold and hot nodes.

    {
      "description": "os-1",
      "nodeAmount": 2,
      "esVersion": "7.10_with_X-Pack",
      "instanceCategory": "IS",
      "nodeSpec": {
        "spec": "elasticsearch.sn2ne.xlarge",
        "disk": 50,
        "diskType": "cloud_ssd"
      },
      "warmNodeConfiguration": {
        "spec": "openstore.i2g.4xlarge",
        "amount": 3
      },
      "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-8vbfu74bmw4m7m84a****",
        "vswitchId": "vsw-8vbnk6cmurbpump2f****",
        "vsArea": "cn-zhangjiakou-c"
      },
      "paymentType": "postpaid",
      "esAdminPassword": "yourPassword",
      "kibanaConfiguration": {
        "spec": "elasticsearch.sn1ne.large"
      }
    }
    
  • Create an Indexing Service series instance, enable OpenStore, and include hot and cold shared nodes.

    {
      "description": "os-2",
      "nodeAmount": 2,
      "esVersion": "7.10_with_X-Pack",
      "instanceCategory": "IS",
      "nodeSpec": {
        "spec": "openstore.i2g.4xlarge",
        "disk": 50,
        "diskType": "cloud_ssd"
      },
      "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-8vbfu74bmw4m7m84a****",
        "vswitchId": "vsw-8vbnk6cmurbpump2f****",
        "vsArea": "cn-zhangjiakou-c"
      },
      "paymentType": "postpaid",
      "esAdminPassword": "yourPassword",
      "kibanaConfiguration": {
        "spec": "elasticsearch.sn1ne.large"
      }
    }
    
  • Create a Universal Business Edition 7.10 instance and enable auto-renewal.

    Note

    If paymentType is set to prepaid, the instance is in subscription mode. The auto-renewal is set in the paymentInfo parameter.

    {
     "description": "auto-renewal",
     "nodeAmount": 3,
     "instanceCategory": "x-pack",
     "esVersion": "7.10_with_X-Pack",
     "nodeSpec": {
     "spec": "elasticsearch.sn2ne.xlarge",
     "disk": 50,
     "diskType": "cloud_ssd"
     },
     "kibanaConfiguration": {
     "spec": "elasticsearch.sn1ne.large"
     },
     "networkConfig": {
     "type": "vpc",
     "vpcId": "vpc-8vbfu74bmw4m7m84a****",
     "vswitchId": "vsw-8vbnk6cmurbpump2f****",
     "vsArea": "cn-zhangjiakou-c"
     },
     "paymentType": "prepaid",
     "paymentInfo": {
     "duration": 1,
     "pricingCycle": "Month",
     "isAutoRenew": true,
     "autoRenewDuration": 1
     },
     "esAdminPassword": "yourPassword"
    }
    

Response parameters

Parameter

Type

Example

Description

RequestId

String

838D9D11-8EEF-46D8-BF0D-BC8FC2B0C2F3

The request ID.

Result

object

The returned data.

└instanceId

string

es-is-0u2ecp69tt****

The ID of the DTS instance.

Examples

Sample requests

POST /openapi/instances?clientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF**** HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

{
  "description": "xpack-hot-cold",
  "nodeAmount": 2,
  "esVersion": "7.10_with_X-Pack",
  "instanceCategory": "x-pack",
  "nodeSpec": {
    "spec": "elasticsearch.sn2ne.xlarge",
    "disk": 20,
    "diskType": "cloud_ssd"
  },
  "warmNodeConfiguration": {
    "spec": "elasticsearch.sn1ne.xlarge",
    "amount": 3,
    "diskType": "cloud_efficiency",
    "disk": 500
  },
  "networkConfig": {
    "type": "vpc",
    "vpcId": "vpc-8vbfu74bmw4m7m84a****",
    "vswitchId": "vsw-8vbnk6cmurbpump2f****",
    "vsArea": "cn-zhangjiakou-c"
  },
  "paymentType": "postpaid",
  "esAdminPassword": "yourPassword",
  "kibanaConfiguration": {
    "spec": "elasticsearch.sn1ne.large"
  }
}

Sample success responses

XML format

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

<createInstanceResponse>
    <RequestId>838D9D11-8EEF-46D8-BF0D-BC8FC2B0C2F3</RequestId>
    <Result>
        <instanceId>es-is-0u2ecp69tt****</instanceId>
    </Result>
</createInstanceResponse>

JSON format

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

{
  "RequestId" : "838D9D11-8EEF-46D8-BF0D-BC8FC2B0C2F3",
  "Result" : {
    "instanceId" : "es-is-0u2ecp69tt****"
  }
}

Error code

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