You can call this operation to create an Elasticsearch instance.

Note the following before calling:

  • Make sure that you have read and understand the billing and pricing standards of Alibaba Cloud Elasticsearch.

    For more information, see Alibaba Cloud Elasticsearch pricing .

  • Before you create an instance, you must complete the real-name authentication.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request header

This operation uses only common request headers. For more information, see Common parameters.

Request structure


     POST /openapi/instances HTTPS|HTTP 
   

Request parameters

Parameter Type Position Required Example Description
clientToken String Query No 5A2CFF0E-5718-45B5-9D4D-70B3FF****

A unique token generated by the client to guarantee the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

RequestBody

You must also specify the following parameters in RequestBody to specify the instance to be created:

Field

Type

Required

Example

Description

paymentType

String

Yes

postpaid

Payment type. Valid values: postpaid and prepaid.

paymentInfo

Map

No

postpaid

The billing details of the instance.

└duration

Integer

No

1

Purchase time. Subscriptions can be purchased on a monthly or yearly basis.

└pricingCycle

String

No

Month

The unit of the subscription. Valid values: Year and Month.

└isAutoRenew

Boolean

No

true

Specifies whether to enable auto-renewal. Valid values: true and false.

└autoRenewDuration

Integer

No

3

Auto-renewal period, in months.

nodeAmount

int

Yes

3

The number of data nodes.

instanceCategory

String

No

advanced

Version type. advanced and x-pack are supported. When setting to advanced, you must purchase the Master node and CPFS shared storage.

esAdminPassword

String

Yes

es_password

The password for the Elasticsearch instance. It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. @ ****** ()_+-=, which must be 8 to 32 characters in length.

esVersion

String

Yes

5.5.3_with_X-Pack

The version of the PolarDB-X instance. Valid values: 5.5.3 _with_X-Pack, 6.3 _with_X-Pack, 6.7 _with_X-Pack, 6.7 _with_A-Pack, 6.8 _with_X-Pack, 7.4 _with_X-Pack, 7.7 _with_X-Pack.

nodeSpec

Map

Yes

The configuration of data nodes.

└spec

String

Yes

elasticsearch.sn2ne.xlarge

The specification of the node.

└disk

String

Yes

20

The storage space per data node. Unit: GB.

└diskType

String

Yes

cloud_ssd

The storage type. Valid values: cloud_ssd(SSD cloud disk), cloud_essd (Enhanced SSD), cloud_efficiency (ultra cloud disk)

└performanceLevel

String

No

PL1

The performance level of the Enhanced SSD. This parameter is required when the storage type is cloud_essd. Valid values: PL1, PL2, and pl3.

└diskEncryption

Boolean

No

true

Specifies whether to enable disk encryption. Valid values: true and false.

advancedDedicateMaster

boolean

No

false

Whether to create dedicated master nodes. Yes if the master node is deployed in multiple zones.

masterConfiguration

Map

No

The configuration of dedicated master nodes. Required when advancedDedicateMaster is true.

└spec

String

Yes

elasticsearch.sn2ne.xlarge

The specification of the node.

└amount

int

Yes

3

The number of nodes. Currently, the value is fixed to 3.

└disk

int

Yes

20

The storage space per data node. Only 20GB is supported.

└diskType

string

Yes

cloud_ssd

The storage type of the node. Valid values: cloud_ssd and cloud_essd. Valid values: cloud_ssd and Enhanced SSD.

warmNode

boolean

No

false

Whether to purchase warm data nodes.

warmNodeConfiguration

Map

No

The configuration of warm nodes. Required when warmNode is true.

└spec

string

Yes

elasticsearch.ic5.large

The specification of the node.

└amount

Integer

Yes

2

The number of nodes.

└diskType

string

Yes

cloud_efficiency

The storage type of the node. Valid values: cloud_efficiency (ultra disk)

└disk

Integer

Yes

500

The storage space per data node.

└diskEncryption

Boolean

No

true

Specifies whether to enable disk encryption. Valid values: true and false.

haveClientNode

boolean

No

false

Specifies whether to purchase client nodes.

clientNodeConfiguration

Map

No

The client node configuration. This parameter is required when haveClientNode is set to true.

└spec

string

Yes

elasticsearch.ic5.large

The specification of the node.

└amount

Integer

Yes

2

The number of nodes.

└diskType

string

Yes

cloud_efficiency

The storage type of the node. Valid values: cloud_efficiency (ultra disk)

└disk

Integer

Yes

20

The storage space per data node.

haveElasticDataNode

boolean

No

false

Whether to purchase elastic nodes. Before purchasing elastic nodes, you must purchase dedicated master nodes.

elasticDataNodeConfiguration

Map

No

The configuration of elastic nodes. Required when haveElasticDataNode is true.

└spec

string

Yes

elasticsearch.ic5.large

The name of the specifications.

└amount

Integer

Yes

2

Calculates the number of rows.

└diskType

string

Yes

cloud_efficiency

The storage type of the node. Valid values: cloud_ssd(SSD cloud disk), cloud_essd (Enhanced SSD), cloud_efficiency (ultra cloud disk)

└disk

Integer

Yes

20

The storage space per data node.

└performanceLevel

String

No

PL1

The performance level of the Enhanced SSD. This parameter is required when the storage type is cloud_essd. Valid values: PL1, PL2, and pl3.

└diskEncryption

Boolean

No

true

Specifies whether to enable disk encryption. Valid values: true and false.

haveKibana

boolean

No

true

Whether to purchase kibana nodes.

kibanaConfiguration

Map

No

The configuration of kibana nodes. This parameter is required when savekibana is set to true.

└spec

String

Yes

elasticsearch.n4.small

The specification of data nodes.

└amount

Integer

Yes

1

The number of nodes. Currently, the value is fixed to 1.

└disk

Integer

Yes

0

The storage size. It is currently fixed to 0.

networkConfig

Map

Yes

Set up network connections.

└type

string

Yes

VPC

The network type. Valid values: Only VPC is supported.

└vpcId

string

Yes

vpc-bp16k1dvzxtmagcva****

The ID of the VPC.

└vsArea

string

Yes

cn-hangzhou-i

The ID of the zone to which the VSwitch belongs.

└vswitchId

string

Yes

vsw-bp1k4ec6s7sjdbudw****

The ID of the vSwitch to which the instance is connected.

extendConfigs

list

No

Instance extended configuration.

└configType

string

Yes

sharedDisk

The configuration type, which is fixed to sharedDisk (shared storage). This parameter is only applicable to the advanced edition instances.

└disk

Integer

Yes

5120

The size of the shared storage disk.

dryRun

boolean

No

true

Specifies whether to verify the configuration when you create an instance. Valid values: true and false. A value of true indicates that the system will not create the instance. A value of false indicates that the system will verify and create the instance.

Note

Examples are as follows:


{
    "paymentType": "postpaid",
    "nodeAmount": "3",
    "instanceCategory": "x-pack",
    "esAdminPassword": "es_password",
    "esVersion": "6.7_with_X-Pack",
    "nodeSpec": {
        "spec": "elasticsearch.sn2ne.xlarge",
        "disk": "20",
        "diskType": "cloud_ssd"     
    },
    "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-bp16k1dvzxtmagcva****",
        "vsArea": "cn-hangzhou-i",
        "vswitchId": "vsw-bp1k4ec6s7sjdbudw****"
    }
}
            

Response parameters

Parameter Type Example Description
RequestId String 838D9D11-8EEF-46D8-BF0D-BC8FC2B0C2F3

The ID of the request.

Result Struct

The return results.

instanceId String es-cn-t57p81n7ai89v****

The ID of the instance.

Examples

Sample requests

POST /openapi/instances HTTP/1.1
common request header
{
    "paymentType": "postpaid",
    "nodeAmount": "3",
    "instanceCategory": "x-pack",
    "esAdminPassword": "es_password",
    "esVersion": "6.7_with_X-Pack",
    "nodeSpec": {
        "spec": "elasticsearch.sn2ne.xlarge",
        "disk": "20",
        "diskType": "cloud_ssd"     
    },
    "networkConfig": {
        "type": "vpc",
        "vpcId": "vpc-bp16k1dvzxtmagcva****",
        "vsArea": "cn-hangzhou-i",
        "vswitchId": "vsw-bp1k4ec6s7sjdbudw****"
    }
}

Sample success responses

XML format

<Result>
    <instanceId>es-cn-t57p81n7ai89v****</instanceId>
</Result>
<RequestId>838D9D11-8EEF-46D8-BF0D-BC8FC2B0****</RequestId>

JSON

{
    "Result": {
        "instanceId": "es-cn-t57p81n7ai89v****"
    },
    "RequestId": "838D9D11-8EEF-46D8-BF0D-BC8FC2B0****"
}

Error codes

For more information about error codes, see error center.