跳到主要内容

切换全球集群 (V2)

Performs a planned switch from the current primary cluster to a specified secondary cluster.

POST/v2/globalClusters/{globalClusterId}/switchover
连接端点

该 API 的 Base URL 格式如下:

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

📘说明

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

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

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

示例值:Bearer {{TOKEN}}
globalClusterIdstringpathrequired

全球集群 ID。

示例值:glo-xxxxxxxxxxxxxxx
请求体application/json
newPrimaryClusterIdstring必填项

要提升为新主集群的从集群 ID。

示例值:in01-secondary
export TOKEN="YOUR_API_KEY"
export globalClusterId="glo-xxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/globalClusters/${globalClusterId}/switchover" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"newPrimaryClusterId": "in01-secondary"
}'
响应200 - application/json
globalClusterIdstring

全球集群 ID。

示例值:glo-xxxxxxxxxxxxxxx
oldPrimaryClusterIdstring

原主集群 ID。

示例值:in01-primary
newPrimaryClusterIdstring

新主集群 ID。

示例值:in01-secondary
jobIdstring

异步操作的任务 ID。

示例值:job-xxxxxxxxxxxxxxx

返回错误消息。

codeinteger

响应码。

示例值:400
messagestring

错误描述。

示例值:Invalid request parameters.
{
"globalClusterId": "glo-xxxxxxxxxxxxxxx",
"oldPrimaryClusterId": "in01-primary",
"newPrimaryClusterId": "in01-secondary",
"jobId": "job-xxxxxxxxxxxxxxx"
}