Creating a Cluster (Discarded)
Function
This API can only be used to create clusters that contain a single type of nodes. To create clusters that contain multiple types of nodes (ess, ess-cold, ess-client, and ess-master), use the API for Creating a Cluster v2.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/clusters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. Constraints N/A Range Project ID of an account. The value contains 32 characters, consisting of lowercase letters and digits. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| cluster | Yes | CreateClusterBody object | Definition Cluster object. Constraints N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| instance | Yes | CreateClusterInstanceBody object | Definition Instance. Constraints N/A |
| datastore | Yes | CreateClusterDatastoreBody object | Definition Search engine type. Constraints N/A |
| name | Yes | String | Definition Cluster name. Constraints N/A Range The value can contain 4 to 32 characters and must start with a letter. Only letters, digits, hyphens (-), and underscores (_) are allowed. The name must be unique. Default Value N/A |
| desc | No | String | Definition Cluster description. Constraints N/A Range The value can contain at most 128 characters. Default Value N/A |
| instanceNum | Yes | Integer | Definition: Number of cluster instances. Constraints: N/A Value range: 1–32. Default value: N/A |
| backupStrategy | No | Definition Whether to enable automatic snapshot creation. Constraints An automatic snapshot creation policy can be enabled only if backupStrategy is not left blank. | |
| httpsEnable | No | Boolean | Definition Whether communication is encrypted on the cluster. Constraints This parameter is supported only by security-mode clusters of Elasticsearch 6.5.4 and later. HTTPS access can be disabled only for OpenSearch 1.3.6 and 2.19.0 security-mode clusters. For other versions, HTTPS access is forcibly enabled and cannot be disabled. When httpsEnable is set to true, authorityEnable must be set to true. Range Default Value false |
| authorityEnable | No | Boolean | Definition Whether to enable authentication. Constraints This parameter is supported only by security-mode clusters of Elasticsearch 6.5.4 and later. Range Default Value false |
| adminPwd | No | String | Definition Password of the administrator admin for a security-mode cluster. Weak password verification is required for a security-mode cluster. You are advised to set a strong password. Constraints This parameter is mandatory only when authorityEnable is set to true during cluster creation. Range
Default Value N/A |
| enterprise_project_id | No | String | Definition Enterprise project ID. When you create a cluster, associate the enterprise project ID with the cluster. 0 indicates the default enterprise project. For details about how to obtain the enterprise project ID, see . Constraints N/A Range The value can contain at most 36 characters. It is string 0 or in UUID format with hyphens (-). Default Value N/A |
| tags | No | Array of CreateClusterTagsBody objects | Definition Cluster tag. Each tag contains a key and a value, which are used to classify and filter clusters. Constraints N/A |
| ipv6_enable | No | Boolean | Definition Whether to enable automatic IPv6 address assignment for the cluster. Constraints N/A Range true: Automatically assign IPv6 address. false: Do not assign IPv6 address. Default Value false |
| diskEncryption | No | diskEncryptionInfo object | Definition Disk encryption information. Constraints N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| flavorRef | Yes | String | Parameter description: Instance flavor name. For details about the current instance flavor, see the name attribute in Obtaining the Instance Specifications List. Constraints: N/A Options: N/A Default value: N/A |
| volume | Yes | Definition Disk volume information of a node. Constraints You do not need to set this parameter when flavorRef is set to a local disk flavor. Currently, the following local disk flavors are supported: Range N/A Default Value N/A | |
| nics | Yes | Definition Subnet information. Constraints N/A | |
| availability_zone | Yes | String | Definition AZ where the node is located. You need to specify the AZ name. Obtain it from Regions and Endpoints. Constraints When specifying the AZs of nodes, use commas (,) to separate different AZ names. For example, if multiple AZs are selected for general AZs, the value of availability_zone is region-1a,region-1b,region-1c. NOTE: If multiple AZs are selected, the name of each AZ must be unique, and the number of nodes must be greater than or equal to the number of AZs. When selecting two AZs, each AZ must contain at least two data nodes (ess) or cold data nodes (ess-cold). If the number of nodes is evenly divisible by the number of AZs, the nodes will be evenly distributed among all AZs. If the number of nodes is not evenly divisible by the number of AZs, the absolute difference between node quantity in any two AZs is 1 at most. Range N/A Default Value availability_zone is empty by default, indicating that a single AZ is used. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| volume_type | Yes | String | Parameter description: Volume type. Constraints: N/A Options: Default value: N/A |
| size | Yes | Integer | Definition Storage space in GB. Constraints The value must be greater than 0 and a common multiple of 4 and 10, in GB. Range You can obtain the disk size from the diskrange attribute in Obtaining the Instance Specifications List. Default Value
NOTE: For ess and ess-cold nodes, 100 GB or a larger value is recommended. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| vpcId | Yes | String | Definition VPC ID, which is used for configuring cluster network. For details, see . Constraints N/A Range N/A Default Value N/A |
| netId | Yes | String | Definition Subnet ID (network ID). For details, see . Constraints N/A Range N/A Default Value N/A |
| securityGroupId | Yes | String | Definition Security group ID. For details, see . Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| version | Yes | String | Parameter description: Elasticsearch/Logstash engine version. For details, see the supported versions in Before You Start. Constraints: N/A Options: N/A Default value: N/A |
| type | Yes | String | Definition Engine type of the cluster to be created. Constraints N/A Range Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Definition Cluster tag key. Constraints N/A Range The value can contain 1 to 36 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. Default Value N/A |
| value | Yes | String | Definition Cluster tag value. Constraints N/A Range The value can contain at most 255 characters. UTF-8 letters, digits, spaces, and the following special characters are allowed: _.://=+-@ Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| systemEncrypted | No | String | Definition Whether to enable disk encryption. Constraints N/A Range Default Value 0 |
| systemCmkid | No | String | Definition KMS key ID. For details about how to obtain the key ID, see . Constraints This parameter is valid only when systemEncrypted is set to 1. Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| cluster | CreateClusterClusterResponse object | Definition Cluster object. |
Example Requests
-
Example request for creating a pay-per-use cluster.
POST https://{Endpoint}/v1.0/{project_id}/clusters { "cluster" : { "instance" : { "flavorRef" : "ess.spec-4u16g", "volume" : { "volume_type" : "COMMON", "size" : 120 }, "nics" : { "vpcId" : "{VPC ID}", "netId" : "{NET ID}", "securityGroupId" : "{Security group ID}" }, "availability_zone" : "{AZ CODE}" }, "datastore" : { "version" : "{cluster-version}", "type" : "elasticsearch" }, "name" : "cluster-name", "desc" : "Cluster testing", "instanceNum" : 3, "backupStrategy" : { "period" : "16:00 GMT+08:00", "prefix" : "snapshot", "keepday" : 7, "frequency" : "DAY", "bucket" : "css-obs-backup", "basePath" : "css_repository/obs-path", "agency" : "css_obs_agency", "maxSnapshotBytesPerSeconds" : "40MB", "maxRestoreBytesPerSeconds" : "40MB" }, "httpsEnable" : true, "authorityEnable" : true, "adminPwd" : "{password}", "enterprise_project_id" : "0", "tags" : [ { "key" : "k1", "value" : "v1" }, { "key" : "k2", "value" : "v2" } ] } }
Example Responses
Status code: 200
Request succeeded.
Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Invalid request. Modify the request before retry. |
| 409 | The request could not be completed due to a conflict with the current state of the resource. The resource that the client attempts to create already exists, or the update request fails to be processed because of a conflict. |
| 412 | The server did not meet one of the preconditions contained in the request. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot