创建备份策略 (V2)
Set up the backup policy for the specified cluster so that Zilliz Cloud automatically backs up your cluster at the specified interval. Note that this API only applies to dedicated clusters.
POST
/v2/clusters/{CLUSTER_ID}/backups/policy该 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
frequencystring
备份执行的星期几。该值为 1 到 7 之间的逗号分隔数字列表,其中 1 代表星期一,7 代表星期日。
示例值:1,2,5
startTimestring
备份策略执行的开始时间段,格式为 HH:mm-HH:mm,采用 UTC 时间。
示例值:02:00-04:00
retentionDaysinteger
备份保留的天数。
取值范围:≥ 1≤ 30
示例值:7
enabledboolean必填项
是否启用自动备份。
示例值:
crossRegionCopiesarray
跨区域备份策略列表。
[]crossRegionCopiesobject
跨区域备份策略信息。
regionIdstring
目标云区域 ID。
示例值:ali-cn-hangzhou
retentionDaysinteger
跨区域备份保留的天数。
取值范围:≥ 1≤ 30
示例值:7
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/backups/policy" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"frequency": "1,2,3,5",
"startTime": "02:00-04:00",
"retentionDays": 7,
"enabled": true
}'
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/backups/policy" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"enabled": false
}'
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/backups/policy" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"frequency": "1,2,3,5",
"startTime": "02:00-04:00",
"retentionDays": 7,
"enabled": true,
"crossRegionCopies": [
{
"regionId": "ali-cn-hangzhou",
"retentionDays": 7
},
{
"regionId": "ali-cn-shanghai",
"retentionDays": 7
}
]
}'
响应200 - application/json
codeinteger
响应码。
dataobject
clusterIdstring
备份所属集群的 ID。
statusstring
备份策略的状态。
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
{
"code": 0,
"data": {
"clusterId": "inxx-xxxxxxxxxxxxxxx",
"status": "ENABLED"
}
}