修改集群副本数量 (V2)
本接口可以设置指定集群的副本数量。对于全球集群,每个成员集群可以有不同的副本数量,本接口仅修改指定集群的副本数量。
POST/v2/clusters/{CLUSTER_ID}/modifyReplica
该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com
📘说明
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
shell
export BASE_URL="https://api.cloud.zilliz.com"
参数
Authorizationstringheader必填项
认证令牌,应为具备适当权限的 API 密钥。
示例值:Bearer {{TOKEN}}
Acceptstringheader
Use application/json.
示例值:application/json
CLUSTER_IDstringpath必填项
ID of the cluster to modify.
示例值:inxx-xxxxxxxxxxxxxxx
请求体application/json
replicainteger<int64>必填项
修改后的集群副本数量。
取值范围:≥ 1≤ 8
autoscalingobject
集群的自动扩缩容配置。
replicaobject
自动扩缩容的副本范围与调度。
mininteger<int64>
最小副本数量。
取值范围:≥ 1≤ 8
maxinteger<int64>
最大副本数量。
取值范围:≥ 1≤ 8
schedulesarray
副本的定时调整调度列表。
[]schedulesobject
定时自动扩缩容调整。
cronstring
调度的 Cron 表达式。
targetinteger<int64>
调度触发时应用的目标副本数量。
取值范围:≥ 1≤ 8
timezonestring
调度的时区。
bash
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/modifyReplica" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Accept: application/json" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"replica": 2
}'
bash
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/modifyReplica" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Accept: application/json" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"autoscaling": {
"replica": {
"min": 1,
"max": 2
}
}
}'
bash
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/modifyReplica" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Accept: application/json" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"autoscaling": {
"replica": {
"schedules": [
{
"cron": "10 0 0 0 0 ?",
"target": 2
}
]
}
}
}'
响应200 OK - application/json
Returns the ID of the modified cluster.
修改指定 Cluster 的副本后返回的成功响应体。
codeinteger<int32>
响应码。
dataobject
Response payload.
clusterIdstring
ID of the cluster that has been modified.
promptstring
Prompt message returned.
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
Successjson
{
"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."
}
}