Change the Automatic Snapshot Policy
Last Updated:2020-08-07
The automatic snapshot policy can be changed. You can enter the automatic snapshot policy ID to change the policy name, creation time, recurrence date and retention time.
Request Structure
PUT /v{version}/asp/update?clientToken={clientToken} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
{
"name":name,
"timePoints":timePoints,
"repeatWeekdays":repeatWeekdays,
"retentionDays":retentionDays,
"aspId":aspId
}
Request Header Field
There are no other special header fields except the public header field.
Request Parameters
Parameter Name | Type | Required | Parameter Position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number |
name | String | Yes | RequestBody parameter | Name of automatic snapshot policy, which supports uppercase and lowercase letters, numbers, Chinese, -, _ /and.. Special characters with length 1-65, it must begin with the letter |
timePoints | List<String> | Yes | RequestBody parameter | Time points for snapshot in a day, the value is 0-23 |
repeatWeekdays | List<String> | Yes | RequestBody parameter | Time for snapshot in a week, the value is within 0-6 |
retentionDays | String | Yes | RequestBody parameter | Automatic snapshot retention days, permanent retention when the value is -1 |
aspId | String | Yes | RequestBody parameter | Automatic snapshot policy ID |
Return Header Field
There are no other special header fields except the common header field.
Return Parameter
No specific parameters are returned.
Error Code
Error Code | Error Description | HTTP Status Code | Explanations |
---|---|---|---|
BadRequest | Bad request parameters or illegal request. | 400 | Invalid request parameter |
Asp.NameInvalid | asp name is invalid. | 400 | The snapshot name is invalid. |
Asp.RetentionDaysInvalid | RetentionDays should in [1,10000] | 400 | The days format of retention is invalid. |
Asp.TimePointsInvalid | TimePoints should in [0,23] | 400 | The time point parameter is abnormal. |
Asp.RepeatWeekdaysInvalid | RepeatWeekdays should in [1,7] | 400 | The date parameter is abnormal. |
Request Instance
PUT /v2/asp/update?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"name":"asp-num1",
"timePoints":["10","20"],
"repeatWeekdays":["1","5"],
"retentionDays":"7",
"aspId":"asp-0yykRGvU"
}
Return Instance
HTTP/1.1 200 OK
x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
Date: Wed, 03 Dec 2014 06:42:19 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS