跳到主要内容

迁移数据至现有集群 (V2)

本接口可将数据从一个集群迁移至另一个集群。

POST/v2/migrations/toExisting
连接端点

该 API 的 Base URL 格式如下:

https://api.cloud.zilliz.com

📘说明

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

shell
export BASE_URL="https://api.cloud.zilliz.com"
参数
Authorizationstringheader必填项

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

示例值:Bearer {{TOKEN}}
请求体
sourceobject必填项

源集群信息。

clusterIdstring必填项

源集群 ID。

示例值:inxx-xxxxxxxxxxxxxxxxx
destinationobject必填项

目标集群信息。

clusterIdstring必填项

目标集群 ID。

示例值:inxx-xxxxxxxxxxxxxxxxxx
dbCollectionsarray

需要迁移的 Collection。

[]dbCollectionsobject

Collection 信息。

dbNamestring

源数据库名称。该字段可选;未指定时使用默认数据库。

destDbNamestring

目标数据库名称。

collectionsarray

上述源数据库中需要迁移的 Collection 名称。未指定时,将迁移源数据库中的所有 Collection。

[]collectionsobject

Collection 名称列表。

collectionNamestring

Collection 名称。

bash
export TOKEN="YOUR_API_KEY"

curl --request POST \
--url "${BASE_URL}/v2/migrations/toExisting" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"source": {
"clusterId": "inxx-xxxxxxxxxxxxxxx"
},
"destination": {
"clusterId": "inxx-xxxxxxxxxxxxxxx"
},
"dbCollections": [
{
"collections": [
{
"collectionName": "medium_articles"
}
]
}
]
}'
响应

返回任务 ID。

codeinteger

响应码。

dataobject

任务信息。

jobIdstring

根据请求创建的任务 ID。

返回错误消息。

codeinteger

响应码。

messagestring

错误描述。

Successjson
{
"code": 0,
"data": {
"jobId": "job-xxxxxxxxxxxxxxxxxxxxxx"
}
}
Ctrl I