调用createInstance,创建Elasticsearch实例。

在调用接口前,请注意:

  • 请确保在使用该接口前,已充分了解Elasticsearch产品的收费方式和价格。

    详情请参见阿里云Elasticsearch定价

  • 创建实例需要通过实名认证。

    详情请参见实名认证

  • 创建实例时不需要指定可用区,实例默认与所选VPC在同一可用区中。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

POST /openapi/instances HTTP/1.1

请求参数

名称 类型 位置 是否必选 示例值 描述
clientToken String Query 5A2CFF0E-5718-45B5-9D4D-70B3FF****

用于保证请求的幂等性。由客户端生成该参数值,要保证在不同请求间唯一,最大不超过64个ASCII字符。

Object Body

请求体参数。

zoneCount Integer Body 2

实例的可用区数量。可选值:1、2、3,默认值:1。

paymentType String Body postpaid

付费类型。可选值:

  • postpaid:按量计费
  • prepaid:包年包月
paymentInfo PaymentInfo Body

包年包月实例的付费详情。创建包年包月实例时必填。

nodeAmount Integer Body 3

数据节点个数,取值范围为2~50。

instanceCategory String Body advanced

版本类型。可选值:

  • x-pack:商业版实例
  • advanced:增强版实例
  • IS:开启Indexing Service的增强版实例
  • community:基础版实例
说明 创建增强版开启OpenStore的实例需要同时开启Indexing Service。
esAdminPassword String Body es_password

实例的访问密码。要求包含以下字符中的三种:大写字母、小写字母、数字、特殊字符:!@#$%^&*()_+-=,长度为8~32位。

esVersion String Body 5.5.3_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
说明 以上所列版本不一定包含Elasticsearch实例支持的所有版本,实际支持的版本可调用GetRegionConfiguration接口查看。
nodeSpec NodeSpec Body

数据节点配置。

masterConfiguration MasterNodeConfiguration Body

专有主节点配置。

warmNodeConfiguration WarmNodeConfiguration Body

冷数据节点配置。

clientNodeConfiguration ClientNodeConfiguration Body

协调节点配置。

elasticDataNodeConfiguration ElasticDataNodeConfiguration Body

弹性节点配置。

kibanaConfiguration KibanaNodeConfiguration Body

Kibana节点配置。

networkConfig NetworkConfig Body

网络配置。

说明 阿里云Elasticsearch支持的节点规格列表,请参见阿里云Elasticsearch定价信息产品规格

请求体参数示例如下:

  • 创建通用商业版实例,同时包含冷、热节点。
    
    {
      "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"
      }
    }
    
  • 创建Indexing Service系列实例,只包含热节点。
    
    {
      "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"
      }
    }
    
  • 创建Indexing Service系列实例,只包含冷节点。
    
    {
      "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"
      }
    }
    
  • 创建Indexing Service系列实例,同时包含冷、热节点。
    
    {
      "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"
      }
    }
    
  • 创建Indexing Service系列实例,开启OpenStore存储,同时包含冷、热节点。
    
    {
      "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"
      }
    }
    
  • 创建Indexing Service系列实例,开启OpenStore存储,包含冷热共享型节点。
    
    {
      "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"
      }
    }
    

返回数据

名称 类型 示例值 描述
RequestId String 838D9D11-8EEF-46D8-BF0D-BC8FC2B0C2F3

请求ID。

Result Object

返回结果。

instanceId String es-is-0u2ecp69tt****

实例ID。

示例

请求示例

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"
  }
}

正常返回示例

XML格式

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格式

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

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

错误码

访问错误中心查看更多错误码。