创建备份 (V2)
Back up the specified cluster or collection. Note that this API only applies to dedicated clusters.
POST
/v2/clusters/{CLUSTER_ID}/backups/create该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com.cn
📘说明
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
export BASE_URL="https://api.cloud.zilliz.com.cn"
参数
Authorizationstringheaderrequired
认证令牌,应为具备适当权限的 API 密钥。
示例值:Bearer {{TOKEN}}
CLUSTER_IDstringpathrequired
需要备份的集群的 ID。
示例值:inxx-xxxxxxxxxxxxxxx
请求体application/json
backupTypestring必填项
需要备份的资源类型。
dbCollectionsarray
需要备份的 Collection 列表。当 backupType 设置为 COLLECTION 时,该字段为必填项。注意,该字段中列出的所有 Collection 必须属于同一个数据库。
[]dbCollectionsobject
Collection 信息。
dbNamestring
包含 collectionNames 字段中列出的 Collection 的数据库名称。
collectionNamesarray
需要备份的 Collection 名称列表。
[]collectionNamesstring
Collection 名称
crossRegionCopiesarray
备份将被复制到的云区域列表。注意,Zilliz Cloud 会默认在与集群相同的区域创建备份,因此您只需指定您希望备份复制到的其他区域。列表中的每条记录都会在指定区域创建一个永久保留的备份副本。
[]crossRegionCopiesobject
目标云区域信息。
regionIdstring
目标云区域 ID,当前集群的备份将被复制到该区域。
示例值:ali-cn-hangzhou
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/backups/create" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"backupType": "CLUSTER"
}'
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/backups/create" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"backupType": "COLLECTION",
"dbCollections": [
{
"dbName": "my_database",
"collectionNames": [
"collection_1",
"collection_2"
]
}
]
}'
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/backups/create" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"backupType": "COLLECTION",
"dbCollections": [
{
"dbName": "my_database",
"collectionNames": [
"collection_1",
"collection_2"
]
}
],
"crossRegionCopies": [
{
"regionId": "ali-cn-hangzhou"
},
{
"regionId": "ali-cn-shanghai"
}
]
}'
响应200 - application/json
codeinteger
Response code
dataobject
backupIdstring
The ID of the backup that has been created.
示例值:backupx_xxxxxxxxxxxxxxx
backupNamestring
The name of the backup that has been created.
jobIdstring
The ID of the asynchronous job that has created this backup.
示例值:job-xxxxxxxxxxxxxxxxxxxx
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
{
"code": 0,
"data": {
"backupId": "backupx_xxxxxxxxxxxxxxx",
"backupName": "Dedicated_01",
"jobId": "job-xxxxxxxxxxxxxxxxxxxxxx"
}
}