Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.
Creating a Cluster (V2)
Function
This API is used to create a cluster with multiple node types (for example, ess, ess-cold, ess-client, ess-master).
Calling Method
For details, see Calling APIs.
URI
POST /v2.0/{project_id}/clusters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cluster |
Yes |
CreateClusterBody object |
Cluster object. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Cluster name It can contain 4 to 32 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. |
backupStrategy |
No |
Automatic snapshot creation. The automatic snapshot creation policy is enabled only if backupStrategy is not left blank. |
|
roles |
Yes |
Array of CreateClusterRolesBody objects |
Cluster information |
nics |
Yes |
Subnet ID. |
|
enterprise_project_id |
No |
String |
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. |
tags |
No |
Array of CreateClusterTagsBody objects |
Cluster tag. |
availability_zone |
Yes |
String |
One or more AZs. You need to specify the AZ names. By default, a single AZ is specified. If multiple AZs are specified, use commas (,) to separate different AZ names. For example, if three AZs are selected under region-1, the value of availability_zone is region-1a,region-1b,region-1c. If a single AZ is used, the value of availability_zone is empty by default.
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 a multiple of the number of AZs, the nodes are evenly distributed to each AZ.
|
datastore |
Yes |
CreateClusterDatastoreBody object |
Engine type. Its value can be elasticsearch, opensearch, or logstash. |
authorityEnable |
No |
Boolean |
Whether to enable authentication. The value can be true or false. Authentication is disabled by default.
This parameter is supported in clusters 6.5.4 or later. |
httpsEnable |
No |
Boolean |
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.- true: Communication is encrypted on the cluster.- false: Communication is not encrypted for the cluster.This parameter is supported in clusters 6.5.4 or later. |
adminPwd |
No |
String |
Password of the cluster user admin in security mode. This parameter is mandatory only when authorityEnable is set to true. Input requirements:
|
publicIPReq |
No |
CreateClusterPublicIpReq object |
Public network access information. This parameter is valid only when httpsEnable is set to true. |
loadBalance |
No |
CreateClusterLoadBalance object |
VPC endpoint service information |
publicKibanaReq |
No |
CreateClusterPublicKibanaReq object |
Kibana public network access information. This parameter is valid only when authorityEnable is set to true. |
payInfo |
No |
PayInfoBody object |
Parameters used for purchasing a yearly/monthly cluster. |
ipv6_enable |
No |
Boolean |
Whether to enable automatic IPv6 address assignment for the cluster. The default value is false. |
diskEncryption |
No |
diskEncryptionInfo object |
Disk encryption information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
period |
Yes |
String |
Time when a snapshot is generated every day. Snapshots can only be generated on the hour. The format is HH:mm z: HH:mm refers to the hour time and z refers to the time zone. For example, 00:00 GMT+08:00 and 01:00 GMT+08:00.
The default value is 00:00 GMT+08:00. When frequency is set to HOUR, you do not need to specify period. By default, snapshot creation starts from the next hour after the settings are successful.
|
frequency |
No |
String |
Frequency of automatically creating snapshots.
The default value is DAY. If this parameter is set to HOUR, the scheduled task is executed every hour. If this parameter is set to DAY, the scheduled task is executed every day. If this parameter is set to SUN, MON, TUE, WED, THU, FRI or SAT, the scheduled task is executed at the specified day of every week. For example, SUN indicates that the task is executed once every Sunday. The number of retained snapshots depends on the execution frequency and indexes set in the automatic snapshot creation policy. If the execution interval is short or the index data volume is large, the number of retained automatic snapshots may not reach the preset value. Set this value based on actual conditions.
|
prefix |
Yes |
String |
Prefix of a snapshot that is automatically created, which is manually entered. Enter up to 32 characters and start with a lowercase letter. Lowercase letters, digits, hyphens (-), and underscores (_) are allowed. |
keepday |
Yes |
Integer |
Set the number of retained snapshots. The value ranges from 1 to 90. Expired snapshots will be automatically deleted on the half hour. The deletion policy applies only to automated snapshots that are executed at the same frequency as the current automatic snapshot creation policy. |
bucket |
No |
String |
Name of the OBS bucket used for backup. |
basePath |
No |
String |
Storage path of the snapshot in the OBS bucket. |
agency |
No |
String |
IAM agency used to access OBS. If none of the bucket, base_path, and agency parameters are specified, the system will automatically create an OBS bucket and an IAM agency. If the creation fails, you need to manually configure correct parameters. |
maxSnapshotBytesPerSeconds |
No |
String |
Parameter description: Configure the maximum backup rate (per second) of each node. When the backup rate exceeds the value, traffic is limited to prevent high resource usage and system stability. The actual backup rate may not reach this value. It is affected by OBS and disks. Constraints: N/A Value range: There are three filling rules:
The number ranges from 0 to 9999. The unit can be k, kb, m, mb, g, gb, t, tb, p, pb or b, which is case insensitive. If the value is set to 0mb, the backup rate is not limited. If the backup rate is too high, the backup may occupy too many resources, affecting system stability. Exercise caution when setting this parameter.
Indicates that the backup rate is not limited. If the backup rate is too high, the backup may occupy too many resources, affecting system stability. Exercise caution when setting this parameter. Indicates that the backup rate is not limited. If the backup rate is too high, the backup may occupy too many resources, affecting system stability. Exercise caution when setting this parameter. Default value: The default value is 40 MB. If no value is specified, the default value is used. |
maxRestoreBytesPerSeconds |
No |
String |
Parameter description: Configure the maximum recovery rate (per second) of each node. When the recovery rate exceeds the value of this parameter, traffic is limited to prevent high resource usage and system stability. The actual restoration speed may not reach this value. It is affected by OBS and disks. Constraints: For OpenSearch clusters and Elasticsearch clusters later than 7.6.2, the recovery rate is also limited by the indices.recovery.max_bytes_per_sec parameter. If the value of Max. recovery rate (per second) is less than the value of indices.recovery.max_bytes_per_sec, traffic is limited when the recovery rate reaches the value of Max. recovery rate (per second). If the value of Maximum recovery rate (per second) is greater than the value of indices.recovery.max_bytes_per_sec, traffic is limited when the recovery rate reaches the value of indices.recovery.max_bytes_per_sec. Value range: There are three filling rules:
The number ranges from 0 to 9999. The unit can be k, kb, m, mb, g, gb, t, tb, p, pb or b, which is case insensitive. If this parameter is set to 0mb, the restoration rate is not limited. However, for OpenSearch clusters and Elasticsearch clusters of version 7.6.2 or later, the restoration rate is also limited by the value of indices.recovery.max_bytes_per_sec. If the restoration rate is too high, the restoration may occupy too many resources, affecting system stability. Exercise caution when setting this parameter.
The restoration speed is not limited. However, the restoration speed of OpenSearch clusters and Elasticsearch clusters of version 7.6.2 or later is limited by the indices.recovery.max_bytes_per_sec parameter. If the restoration speed is too high, the restoration may occupy too many resources, affecting system stability. Exercise caution when setting this parameter. The restoration speed is not limited. However, the restoration speed of OpenSearch clusters and Elasticsearch clusters of version 7.6.2 or later is limited by the indices.recovery.max_bytes_per_sec parameter. If the restoration speed is too high, the restoration may occupy too many resources, affecting system stability. Exercise caution when setting this parameter. Default value: For Elasticsearch clusters of version 7.6.2 or earlier, the default value is 40 MB. For OpenSearch clusters and Elasticsearch clusters of version 7.6.2 or later, the default value is not limited, but the value is also limited by the indices.recovery.max_bytes_per_sec parameter. If no value is specified, the default value is used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavorRef |
Yes |
String |
Instance flavor. For details about the current instance flavor, see the name attribute in Obtaining the Instance Specifications List. |
volume |
Yes |
Volume information. If flavorRef is set to a local disk flavor, leave this parameter blank. Obtain the the local disk flavor by referring to the diskrange attribute in Obtaining the Instance Specifications List. Currently, the following local disk flavors are supported:
|
|
type |
Yes |
String |
[- chinese indicates a Chinese language model. |
instanceNum |
Yes |
Integer |
Number of instances.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volume_type |
Yes |
String |
Volume type
|
size |
Yes |
Integer |
Volume size. The value must be greater than 0 and a multiple of 4 and 10. Unit: GB |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
vpcId |
Yes |
String |
VPC ID, which is used for configuring cluster network. |
netId |
Yes |
String |
Subnet ID (network ID). |
securityGroupId |
Yes |
String |
Security group ID. |
ips |
No |
Array of strings |
Node IP address. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. The value can contain 1 to 36 characters. It can only contain digits, letters, hyphens (-), and underscores (_). |
value |
Yes |
String |
Tag value. The value can contain 0 to 43 characters. It can only contain digits, letters, hyphens (-), and underscores (_). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version |
Yes |
String |
Version of the CSS cluster engine. For details, see the supported versions in Before You Start. [For a serverless cluster, logs, search, and vector are supported.] (tag:white) |
type |
Yes |
String |
Engine type. Its value can be elasticsearch, opensearch, or logstash. [For a serverless cluster, serverless-opensearch is used.] (tag:white) |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
eip |
Yes |
CreateClusterPublicEip object |
Public network bandwidth. |
elbWhiteListReq |
Yes |
CreateClusterElbWhiteList object |
EIP whitelist. |
publicBindType |
Yes |
String |
Whether to automatically bind an EIP. Specifies whether to automatically bind an EIP. Currently, only auto_assign is supported. |
eipId |
No |
String |
EIP ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
bandWidth |
Yes |
CreateClusterPublicEipSize object |
Public network bandwidth. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
size |
Yes |
Integer |
Bandwidth range. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enableWhiteList |
Yes |
Boolean |
Whether to enable the public network access control. |
whiteList |
No |
String |
Public network access control whitelist. Separate the whitelisted network segments or IP addresses with commas (,), and each of them must be unique. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
endpointWithDnsName |
Yes |
Boolean |
Whether to enable the private domain name.
|
vpcPermissions |
No |
Array of strings |
Access control. |
professionVpcep |
No |
Boolean |
Create a professional VPC endpoint.
|
dualstackEnable |
No |
Boolean |
Whether to enable the IPv4/IPv6 dual-stack network. The IPv4/IPv6 dual-stack network can be enabled only when a professional VPC endpoint is created and the VPC of the cluster supports IPv6.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
eipSize |
Yes |
Integer |
Bandwidth range. |
elbWhiteList |
Yes |
Kibana whitelist information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
whiteList |
Yes |
String |
Whitelist. Separate the whitelisted network segments or IP addresses with commas (,), and each of them must be unique. |
enableWhiteList |
Yes |
Boolean |
Whether to enable the Kibana access control. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
payModel |
Yes |
Integer |
Subscription period type.
|
period |
Yes |
Integer |
Subscribed periods.
|
isAutoRenew |
No |
Integer |
Whether to automatically renew the subscription. If this parameter is not specified, the subscription is not automatically renewed.
|
isAutoPay |
No |
Integer |
Indicates whether to enable automatic payment from your Huawei Cloud account. This parameter takes effect only for yearly/monthly clusters.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
systemEncrypted |
No |
String |
Whether to enable disk encryption. The value can be 0 or 1. The default value is 0. 0: Disable disk encryption. 1: Enable disk encryption. |
systemCmkid |
No |
String |
KMS key ID. This parameter is valid only when systemEncrypted is set to 1. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
cluster |
CreateClusterResp object |
Cluster object. For a pay-per-use cluster, only the cluster parameter is returned. |
orderId |
String |
Order ID. This parameter is returned only when a yearly/monthly cluster is created. |
Example Requests
-
Example request for creating a yearly/monthly cluster.
POST /v2.0/6204a5bd270343b5885144cf9c8c158d/clusters { "cluster" : { "name" : "css-cluster", "backupStrategy" : { "period" : "16:00 GMT+08:00", "prefix" : "snapshot", "keepday" : 7, "frequency" : "DAY", "bucket" : "OBS-obsName", "basePath" : "css_repository/obs-path", "agency" : "css_obs_agency" }, "roles" : [ { "flavorRef" : "ess.spec-4u8g", "volume" : { "volume_type" : "COMMON", "size" : 100 }, "type" : "ess", "instanceNum" : 1 } ], "nics" : { "vpcId" : "{VPC ID}", "netId" : "{NET ID}", "securityGroupId" : "{Security group ID}" }, "enterprise_project_id" : 0, "tags" : [ { "key" : "k1", "value" : "v1" }, { "key" : "k2", "value" : "v2" } ], "availability_zone" : "{Az code}", "datastore" : { "version" : "{cluster-version}", "type" : "elasticsearch" }, "authorityEnable" : true, "httpsEnable" : true, "adminPwd" : "{password}", "publicIPReq" : { "eip" : { "bandWidth" : { "size" : 5 } }, "elbWhiteListReq" : { "enableWhiteList" : true, "whiteList" : "127.0.0.1" }, "publicBindType" : "auto_assign", "eipId" : null }, "loadBalance" : { "endpointWithDnsName" : false, "vpcPermissions" : [ "{Account ID}" ] }, "publicKibanaReq" : { "eipSize" : 5, "elbWhiteList" : { "whiteList" : "127.0.0.1", "enableWhiteList" : true } }, "payInfo" : { "payModel" : 2, "period" : 1, "isAutoRenew" : 1, "isAutoPay" : null } } }
-
Example request for creating a pay-per-use cluster.
{ "cluster" : { "name" : "css-cluster", "backupStrategy" : { "period" : "16:00 GMT+08:00", "prefix" : "snapshot", "keepday" : 7, "frequency" : "DAY", "bucket" : "OBS-obsName", "basePath" : "css_repository/obs-path", "agency" : "css_obs_agency" }, "roles" : [ { "flavorRef" : "ess.spec-4u8g", "volume" : { "volume_type" : "COMMON", "size" : 100 }, "type" : "ess", "instanceNum" : 1 } ], "nics" : { "vpcId" : "{VPC ID}", "netId" : "{NET ID}", "securityGroupId" : "{Security group ID}" }, "enterprise_project_id" : 0, "tags" : [ { "key" : "k1", "value" : "v1" }, { "key" : "k2", "value" : "v2" } ], "availability_zone" : "{Az code}", "datastore" : { "version" : "{cluster-version}", "type" : "elasticsearch" }, "authorityEnable" : true, "httpsEnable" : true, "adminPwd" : "{password}", "publicIPReq" : { "eip" : { "bandWidth" : { "size" : 5 } }, "elbWhiteListReq" : { "enableWhiteList" : true, "whiteList" : "127.0.0.1" }, "publicBindType" : "auto_assign", "eipId" : null }, "loadBalance" : { "endpointWithDnsName" : false, "vpcPermissions" : [ "{Account ID}" ] }, "publicKibanaReq" : { "eipSize" : 5, "elbWhiteList" : { "whiteList" : "127.0.0.1", "enableWhiteList" : true } } } }
Example Responses
Status code: 200
Request succeeded.
-
Example response for creating a pay-per-use cluster.
{ "cluster" : { "id" : "ef683016-871e-48bc-bf93-74a29d60d214", "name" : "ES-Test" } }
-
Example response for creating a yearly/monthly cluster.
{ "orderId" : "CS2208241141LY94J", "cluster" : { "id" : "ef683016-871e-48bc-bf93-74a29d60d214", "name" : "ES-Test" } }
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