跳到主要内容

创建备份策略

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
Base URL

该 API 的 Base URL 格式如下:

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

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

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

示例值:Bearer {{TOKEN}}
CLUSTER_IDstringpathrequired

The ID of the target cluster whose backup is in concern.

示例值:inxx-xxxxxxxxxxxxxxx
请求体application/json
frequencystring

The week days on which the backup is performed. The value is a comma-separated list of numbers from 1 to 7, where 1 represents Monday and 7 represents Sunday.

示例值:1,2,5
startTimestring

The start time is a two-hour duration for the backup policy to execute in the format of HH:mm-HH:mm UTC time.

示例值:02:00-04:00
retentionDaysinteger

The number of days to retain the backup.

取值范围:≥ 1≤ 30
enabledboolean必填项

Whether automatic backup is enabled or not.

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
}'
响应200 - application/json
codeinteger

Response code.

dataobject
clusterIdstring

The ID of the cluster whose backup policy is in concern.

statusstring

The status of the backup policy.

Returns an error message.

codeinteger

响应码。

messagestring

错误描述。

{
"code": 0,
"data": {
"clusterId": "inxx-xxxxxxxxxxxxxxx",
"status": "ENABLED"
}
}