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 Value range: Project ID of the account. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
cluster |
Yes |
CreateClusterBody object |
Parameter description: Cluster object. Constraints: N/A Options: N/A Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
instance |
Yes |
CreateClusterInstanceBody object |
Parameter description: Array of Buffer instances, whose memory is to be shared. Constraints: N/A Options: N/A Default value: N/A |
|
datastore |
Yes |
CreateClusterDatastoreBody object |
Definition: Search engine. Constraints: N/A Value range: N/A Default value: N/A |
|
name |
Yes |
String |
Definition: Cluster name. Constraints: N/A Value range: It can contain 4 to 32 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
|
desc |
No |
String |
Definition: Cluster description. Constraints: Enter a maximum of 128 characters. Value range: The value can contain digits, letters, periods (.), hyphens (-), underscores (_), and other special 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 |
Parameter description: Automatic snapshot creation policy, which is disabled by default. The automatic snapshot creation policy is enabled only when backupStrategy is not left blank. Constraints: N/A Options: N/A Default value: N/A |
|
|
httpsEnable |
No |
Boolean |
Definition: Whether communication is encrypted on the cluster. The value can be true or false. By default, communication encryption is disabled. When httpsEnable is set to true, authorityEnable must be set to true. Constraints: Only Elasticsearch 6.5.4 security-mode clusters and later support this parameter. 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. Value range: Default value: false |
|
authorityEnable |
No |
Boolean |
Definition: Whether to enable authentication. Available values include true and false. Authentication is disabled by default. Constraints: Only Elasticsearch 6.5.4 security-mode clusters and later support this parameter. Value range: Default value: false |
|
adminPwd |
No |
String |
Parameter description: Password of the cluster user admin in security mode. This parameter is mandatory only when authorityEnable is set to true. Weak password verification is required for a security cluster. You are advised to set a strong password. Constraints: The administrator password must meet the following requirements:
Options: See Constraints. Default value: N/A |
|
enterprise_project_id |
No |
String |
Parameter description: Enterprise project ID. When creating a cluster, associate the enterprise project ID with the cluster. The value can contain a maximum of 36 characters. It is string 0 or in UUID format with hyphens (-). Value 0 indicates the default enterprise project. Constraints: N/A Options: N/A Default value: N/A |
|
tags |
No |
Array of CreateClusterTagsBody objects |
Parameter description: Cluster tags. Constraints: N/A Options: N/A Default value: N/A |
|
ipv6_enable |
No |
Boolean |
Definition: Whether to enable automatic IPv6 address assignment for the cluster. The default value is false. Constraints: N/A Value range: N/A Default value: false |
|
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 |
Parameter description: Volume information. 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: Constraints: N/A Options: N/A Default value: N/A |
|
|
nics |
Yes |
Parameter description: Subnet information. Constraints: N/A Options: N/A Default value: N/A |
|
|
availability_zone |
Yes |
String |
Definition: AZ of the node. The AZ name needs to be specified. 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. Value range: N/A Default value: availability_zone is empty by default, indicating that a single AZ is used.
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. 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. AZ name. Obtain it from Regions and Endpoints in section "Before You Start". |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volume_type |
Yes |
String |
Parameter description: Volume type. Constraints: N/A Options: Default value: N/A |
|
size |
Yes |
Integer |
Definition: Disk size. Constraints: The value must be greater than 0 and a common multiple of 4 and 10, in GB. Value 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 |
Parameter description: VPC ID, which is used for configuring cluster network. Constraints: N/A Options: N/A Default value: N/A |
|
netId |
Yes |
String |
Parameter description: Subnet ID (network ID). Constraints: N/A Options: N/A Default value: N/A |
|
securityGroupId |
Yes |
String |
Parameter description: Security group ID Constraints: N/A Options: 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 Value range: Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Tag key. Constraints: N/A Value 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: Tag value. Constraints: N/A Value range: Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
cluster |
CreateClusterClusterResponse object |
Parameter description: Cluster object. For a pay-per-use cluster, only the cluster parameter is returned. Options: N/A |
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" : 40, "maxRestoreBytesPerSeconds" : 40 }, "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.
Feedback
Was this page helpful?
Provide feedbackThank 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