创建按需集群 (V2)
公测版Create an on-demand cluster in the current project.
POST/v2/clusters/createOnDemandCluster
该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com
📘说明
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
shell
export BASE_URL="https://api.cloud.zilliz.com"
参数
Authorizationstringheader必填项
认证令牌,应为具备适当权限的 API 密钥。
示例值:Bearer {{TOKEN}}
请求体application/json
projectIdstring必填项
待创建集群所属项目 ID。
regionIdstring必填项
待创建集群所属地域。
cuSizeinteger必填项
分配给待创建集群的 CU 大小。
clusterNamestring
待创建集群名称。
descriptionstring
按需集群描述。
示例值:Ad hoc analytics query cluster
autoSuspendinteger
自动挂起空闲时间。如果指定的时间段内无任何请求,集群将自动挂起。该值应为一个整数,表示秒数。例如,300 表示 5 分钟。
Examplebash
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,
"description": "用于向量搜索工作负载的集群描述。"
}'
响应200 OK - application/json
返回已创建的集群的详细信息。
codeinteger
响应码。
dataobject
响应负载。
clusterIdstring
已创建集群的 ID。
promptstring
返回的提示消息。
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
Successjson
{
"code": 0,
"data": {
"clusterId": "inxx-xxxxxxxxxxxxxxx",
"prompt": "已成功提交,按需集群正在创建中。您可以使用 Describe On-Demand Cluster API 查看创建进度和集群状态。集群状态为 RUNNING 后,使用 API 密钥访问按需集群。"
}
}