跳到主要内容

修改集群配置 (V2)

Modify a dedicated cluster. You can increase or reduce the number of CUs allocated to the cluster.

POST
/v2/clusters/{CLUSTER_ID}/modify
Base URL

该 API 的 Base URL 格式如下:

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

📘说明

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

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

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

示例值:Bearer {{TOKEN}}
Acceptstringheader

使用 application/json

示例值:application/json
CLUSTER_IDstringpathrequired

待修改集群 ID。

示例值:inxx-xxxxxxxxxxxxxxx
请求体application/json
cuSizeinteger

修改后分配给指定集群的 CU 数量。此参数与 autoscaling.cu 互斥;您只能指定其中一个。此参数与 replica 的乘积不得超过 256。

取值范围:> 1≤ 256
replicainteger

修改后指定集群的副本数量。此参数与 autoscaling.replica 互斥;您只能指定其中一个。此参数与 cuSize 的乘积不得超过 256。

取值范围:> 1≤ 10
autoscalingobject

集群的自动扩缩容配置。此参数与 cuSizereplica 互斥;您只能指定其中一个。

cuobject

CU 的自动扩缩容配置。如果您已设置 cuSize,则无法使用此配置。最大 CU 数量与最大副本数量的乘积不得超过 256。

mininteger

自动扩缩容的最小 CU 数量。此参数与 schedules 互斥;您只能指定其中一个。

取值范围:> 1≤ 256
maxinteger

自动扩缩容的最大 CU 数量。此参数与 schedules 互斥;您只能指定其中一个。

取值范围:> 1≤ 256
schedulesarray

自动扩缩容的时间表。此参数与 min/max 互斥;您只能指定其中一个。

[]schedulesobject

An auto-scaling schedule.

cronstring

定义时间表的 Cron 表达式。

示例值:0 0 * * *
targetinteger

此时间表的目标 CU 数量。

replicaobject

Replica 的自动扩缩容配置。如果您已设置 replica,则无法使用此配置。最大 CU 数量与最大副本数量的乘积不得超过 256。

mininteger

自动扩缩容的最小 Replica 数量。此参数与 schedules 互斥;您只能指定其中一个。

取值范围:> 1≤ 10
maxinteger

自动扩缩容的最大 Replica 数量。此参数与 schedules 互斥;您只能指定其中一个。

取值范围:> 1≤ 10
schedulesarray

自动扩缩容的时间表。此参数与 min/max 互斥;您只能指定其中一个。

[]schedulesobject

An auto-scaling schedule.

cronstring

定义时间表的 Cron 表达式。

示例值:0 0 * * *
targetinteger

此时间表的目标 Replica 数量。

export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/modify" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
-d '{
"cuSize": 2,
"replica": 2
}'
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/modify" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
-d '{
"autoscaling": {
"cu": {
"min": 1,
"max": 2
},
"replica": {
"min": 1,
"max": 2
}
}
}'
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/modify" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
-d '{
"autoscaling": {
"cu": {
"schedules": [
{
"cron": "10 0 0 0 0 ?",
"target": 2
}
]
},
"replica": {
"schedules": [
{
"cron": "10 0 0 0 0 ?",
"target": 2
}
]
}
}
}'
响应200 - application/json
codeinteger

Response code.

dataobject

Response payload.

clusterIdstring

ID of the cluster that has been modified.

promptstring

Prompt message returned.

返回错误消息。

codeinteger

响应码。

messagestring

错误描述。

{
"code": 0,
"data": {
"clusterId": "inxx-xxxxxxxxxxxxxxx",
"prompt": "successfully submitted. Cluster is being upgraded, which is expected to take several minutes. You can access data about the creation progress and status of your cluster by DescribeCluster API. Once the cluster status is RUNNING, you may access your vector database using the SDK."
}
}