Creating a Cluster
Function
This API is used to create a CDM cluster. Creating a CDM cluster is an asynchronous operation. You can query the creation progress and result by periodically calling the API in Querying Cluster Details.
URI
- URI format
POST /v1.1/{project_id}/clusters - Parameter description
Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID. For details about how to obtain the project ID, see Obtaining the Project ID, Account Name, and AK/SK.
Request
- Sample request
POST /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters { "cluster": { "instances": [{ "flavorRef": "fb8fe666-6734-4b11-bc6c-43d11db3c745", "nics": [{ "net-id": "2d120298-6130-44d4-a438-454912fff901", "securityGroupId": "c37852d2-2d12-41cb-af47-65c80e995c80" }], "availability_zone": "cn-north-1b", "type": "cdm" }], "name": "cdm-ab82", "datastore": { "version": "1.8.5", "type": "cdm" }, "vpcId": "67c06084-2212-4242-bcd4-d2144c2385a9", "isScheduleBootOff": false, "scheduleBootTime": "null", "scheduleOffTime": "null", "isAutoOff": false, "sys_tags": [{ "key": "_sys_enterprise_project_id", "value": "1ce45885-4033-40d2-bdde-d4dbaceb387d" }] }, "autoRemind": false, "phoneNum": "null", "email": "null" } - Parameter description
Parameter
Mandatory
Type
Description
cluster
Yes
List
Cluster object. For details, see Description of the cluster parameter.
autoRemind
No
Boolean
Whether to enable message notification. After the function is enabled, configure a maximum of five mobile numbers or email addresses. You will be notified of job failures (only table/file migration jobs) and EIP exceptions by SMS message or email.
phoneNum
No
String
Mobile number for receiving notifications
email
No
String
Email address for receiving notifications
- Description of the cluster parameter
Parameter
Mandatory
Type
Description
instances
Yes
List
Node list. For details, see Description of the instances parameter.
name
Yes
String
Cluster name
datastore
Yes
Dictionary
Cluster information. For details, see Description of the datastore parameter.
vpcId
Yes
String
VPC ID, which is used for configuring the cluster network
isScheduleBootOff
Yes
Boolean
Whether to enable the scheduled startup/shutdown function. The scheduled startup/shutdown and auto shutdown functions cannot be enabled at the same time.
scheduleBootTime
No
String
Time for scheduled startup of a CDM cluster. The CDM cluster starts at this time every day.
scheduleOffTime
No
String
Time for scheduled shutdown of a CDM cluster. During scheduled shutdown, the system does not wait for unfinished jobs to complete.
isAutoOff
Yes
Boolean
Whether to enable auto shutdown. The auto shutdown and scheduled startup/shutdown functions cannot be enabled at the same time. After auto shutdown is enabled, if no job is running in the cluster and no scheduled job is created, a cluster will automatically shut down 15 minutes later to reduce costs.
sys_tags
Yes
List
Enterprise project information. For details, see Description of the sys_tags parameter.
- Description of the datastore parameter
Parameter
Mandatory
Type
Description
version
Yes
String
Cluster version
type
Yes
String
Cluster type. Currently, only cdm is available.
- Description of the sys_tags parameter
Parameter
Mandatory
Type
Description
key
No
String
The value is fixed at _sys_enterprise_project_id.
value
No
String
Enterprise project ID
- Description of the instances parameter
Parameter
Mandatory
Type
Description
flavorRef
Yes
String
Instance flavor. The options are as follows:
- 5ddb1071-c5d7-40e0-a874-8a032e81a697: cdm.large with 8 vCPUs and 16 GB memory applicable to migration of a single database table with 10 million pieces of data or more
- 6ddb1072-c5d7-40e0-a874-8a032e81a698: cdm.xlarge with 16 vCPUs and 32 GB memory applicable to TB-level data migration requiring 10GE high-speed bandwidth
nics
Yes
List
NIC list. A maximum of two NICs are supported. For details, see Description of the nics parameter.
- Description of the nics parameter
Parameter
Mandatory
Type
Description
net-id
Yes
String
Subnet ID
securityGroupId
Yes
String
Security group ID
availability_zone
Yes
String
AZ where a cluster is located
type
Yes
String
Node type. Currently, only cdm is available.
Response
- Sample response
{ "id": "7d85f602-a948-4a30-afd4-e84f47471c15", "name": "cdm-ab82" } - Parameter description
Parameter
Mandatory
Type
Description
id
Yes
String
Cluster ID
name
Yes
String
Cluster name
Return Value
- Normal
- Abnormal
Return Value
Description
400 Bad Request
Request error. For details about the returned error code, see Error Code.
401 Unauthorized
Authentication failed.
403 Forbidden
No operation permission.
404 Not Found
The requested resource is not found.
500 Internal Server Error
Internal service error.
503 Service Unavailable
Service unavailable.
Last Article: Cluster Management
Next Article: Querying the Cluster List
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.