Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com> Co-authored-by: gtema <artem.goncharov@gmail.com> Co-committed-by: gtema <artem.goncharov@gmail.com>
48 KiB
Creating a Cluster
Function
This API is used to create a cluster.
URI
POST /v1.0/{project_id}/clusters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Request
Table 2 describes the request parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cluster |
Yes |
Object |
Cluster. For details about related parameters, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
instance |
Yes |
Object |
Instance. For details about related parameters, see Table 4. |
datastore |
Yes |
Object |
Type of the data search engine. For details about related parameters, see Table 7. |
name |
Yes |
String |
Cluster name. It contains 4 to 32 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The value must start with a letter. |
instanceNum |
Yes |
Integer |
Number of clusters. The value range is 1 to 32. |
backupStrategy |
No |
Object |
Automatic snapshot creation. This function is disabled by default. For details about related parameters, see Table 8. NOTE:
The automatic snapshot creation policy is enabled only if this parameter is specified. |
diskEncryption |
Yes |
Object |
Whether disks are encrypted. For details about related parameters, see Table 9. |
httpsEnable |
No |
String |
Whether communication is encrypted on the cluster. Available values include true and false. By default, communication is encrypted.
|
authorityEnable |
No |
Boolean |
Whether to enable authentication. Available values include true and false. Authentication is disabled by default. When authentication is enabled, httpsEnable must be set to true.
|
adminPwd |
No |
String |
Password of the cluster user admin in security mode. This parameter is mandatory only when authorityEnable is set to true. NOTE:
|
tags |
No |
Array of tags in Table 10 |
Tags in a cluster. NOTE:
For details about the tag feature, see the Tag Management Service Overview. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavorRef |
Yes |
String |
Instance flavor name. For example:
|
volume |
Yes |
Object |
Information about the volume. For details about related parameters, see Table 5. |
nics |
Yes |
Object |
Subnet information. For details about related parameters, see Table 6. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volume_type |
Yes |
String |
COMMON: Common I/O HIGH: High I/O ULTRAHIGH: Ultra-high I/O |
size |
Yes |
Integer |
Volume size. The minimum value is 40. The value must be 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. All instances in a cluster must have the same subnets and security groups. |
securityGroupId |
Yes |
String |
Security group ID. All instances in a cluster must have the same subnets and security groups. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version |
Yes |
String |
Engine version. For details about the supported versions, see Supported Cluster Versions. |
type |
Yes |
String |
Cluster type. The default value is Elasticsearch. Currently, the value can only be Elasticsearch. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
period |
Yes |
String |
Time when a snapshot is created every day. Snapshots can only be created on the hour. The time format is the time followed by the time zone, specifically, HH:mm z. In the format, 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. |
prefix |
Yes |
String |
Prefix of the name of the snapshot that is automatically created. |
keepday |
Yes |
Integer |
Number of days for which automatically created snapshots are reserved. Value range: 1 to 90 |
bucket |
No |
String |
OBS bucket used for storing backup. If there is snapshot data in an OBS bucket, only the OBS bucket will be used for backup storage and cannot be changed. |
basePath |
No |
String |
Storage path of the snapshot in the OBS bucket. |
agency |
No |
String |
IAM agency used to access OBS. NOTE:
If none of the bucket, basePath, and agency parameters are specified, the system will automatically create an OBS bucket and an IAM agency. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
systemEncrypted |
Yes |
String |
Value 1 indicates encryption is performed, and value 0 indicates encryption is not performed. |
systemCmkid |
Yes |
String |
Key ID.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. The value can contain 1 to 36 characters. Only digits, letters, hyphens (-) and underscores (_) are allowed. |
value |
Yes |
String |
Tag value. The value can contain 0 to 43 characters. Only digits, letters, hyphens (-) and underscores (_) are allowed. |
Response
Table 11 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
cluster |
Object |
Cluster. For details, see Table 12. |
Examples
Example request
POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters { "cluster": { "name": "ES-Test", "instanceNum": 4, "instance": { "flavorRef": "css.large.8", "volume": { "volume_type": "COMMON", "size": 100 }, "nics": { "vpcId": "fccd753c-91c3-40e2-852f-5ddf76d1a1b2", "netId": "af1c65ae-c494-4e24-acd8-81d6b355c9f1", "securityGroupId": "7e3fed21-1a44-4101-ab29-34e57124f614" } }, "httpsEnable": "false", "diskEncryption": { "systemEncrypted": "1", "systemCmkid": "42546bb1-8025-4ad1-868f-600729c341ae" } } }
{ "cluster": { "id": "ef683016-871e-48bc-bf93-74a29d60d214", "name": "ES-Test" } }
Status Code
Table 13 describes the status code.
Status Code |
Code |
Status Code Description |
---|---|---|
400 |
BadRequest |
Invalid request. The client should not repeat the request without modifications. |
409 |
Conflict |
The request could not be processed due to a conflict. This status code indicates that the resource that the client attempts to create already exits, or the request fails to be processed because of the update of the conflict request. |
412 |
Precondition Failed |
The server does not meet one of the preconditions that the requester puts on the request. |
200 |
OK |
The request is processed successfully. |