跳到主要内容

创建按需集群 (V2)
公测版

Create an on-demand cluster in the current project.

POST/v2/clusters/createOnDemandCluster
连接端点

该 API 的 Base URL 格式如下:

https://api.cloud.zilliz.com.cn

📘说明

控制面接口速率限制为单用户单接口每秒最多 20 个请求。

export BASE_URL="https://api.cloud.zilliz.com.cn"
参数
Authorizationstringheaderrequired

认证令牌,应为具备适当权限的 API 密钥。

示例值:Bearer {{TOKEN}}
请求体application/json
projectIdstring必填项

The ID of the project to create the cluster in.

regionIdstring必填项

The ID of the cloud region to create the cluster in.

cuSizeinteger必填项

The CU size to use for the cluster. The minimum CU size is 1.

clusterNamestring

The name of the cluster to create.

autoSuspendinteger

Auto-suspend idle window. The cluster will be automatically suspended if there is no request within the specified period. The value should be an integer representing the number of seconds. For example, 300 means 5 minutes.

export TOKEN="YOUR_API_KEY"

curl --request POST \
--url "${BASE_URL}/v2/clusters/createOnDemandCluster" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"projectId": "proj-xxxxxxxxxxxxxxxxxxx",
"regionId": "ali-cn-beijing",
"clusterName": "my-on-demand",
"cuSize": 8,
"autoSuspend": 60
}'
响应200 - application/json
codeinteger

响应码。

dataobject

响应负载。

clusterIdstring

已创建集群的 ID。

promptstring

返回的提示消息。

返回错误消息。

codeinteger

响应码。

messagestring

错误描述。

{
"code": 0,
"data": {
"clusterId": "inxx-xxxxxxxxxxxxxxx",
"prompt": "已成功提交,按需集群正在创建中。您可以使用 Describe On-Demand Cluster API 查看创建进度和集群状态。集群状态为 RUNNING 后,使用 API 密钥访问按需集群。"
}
}