创建备份策略 (V2)
本接口可为指定集群创建自动备份策略。仅适用于 Dedicated 集群。
POST/v2/clusters/{CLUSTER_ID}/backups/policy
该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com
📘说明
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
shell
export BASE_URL="https://api.cloud.zilliz.com"
参数
Authorizationstringheader必填项
认证令牌,应为具备适当权限的 API 密钥。
示例值:Bearer {{TOKEN}}
CLUSTER_IDstringpath必填项
备份所属集群的 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
bash
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 "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"frequency": "1,2,3,5",
"startTime": "02:00-04:00",
"retentionDays": 7,
"enabled": true
}'
bash
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 "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"enabled": false
}'
bash
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 "Request-Timeout: 5" \
--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 OK - application/json
response
codeinteger
响应码。
dataobject
clusterIdstring
备份所属集群的 ID。
statusstring
备份策略的状态。
返回错误消息。
codeinteger
响应码。
messagestring
错误描述。
Successjson
{
"code": 0,
"data": {
"clusterId": "inxx-xxxxxxxxxxxxxxx",
"status": "ENABLED"
}
}