Modifies an automatic snapshot policy. After you modify an automatic snapshot policy that is applied to specific disks, the modified policy immediately takes effect on the disks.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | ModifyAutoSnapshotPolicyEx |
The operation that you want to perform. Set the value to ModifyAutoSnapshotPolicyEx. |
| regionId | String | Yes | cn-hangzhou |
The region ID of the automatic snapshot policy to be modified. You can call the DescribeRegions operation to query the most recent region list. |
| autoSnapshotPolicyId | String | Yes | sp-bp12m37ccmxvbmi5**** |
The ID of the automatic snapshot policy. You can call the DescribeAutoSnapshotPolicyEx operation to query available automatic snapshot policies. |
| autoSnapshotPolicyName | String | No | SPTestName |
The name of the automatic snapshot policy. If this parameter is not specified, the original name of the automatic snapshot policy is retained. |
| timePoints | String | No | ["0", "1"] |
The points in time of the day at which to create automatic snapshots. The time must be in UTC+8. Unit: hours. Valid values are 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, a value of 1 indicates 01:00:00. To schedule multiple automatic snapshots to be created in a day, you can specify multiple hours.
|
| repeatWeekdays | String | No | ["1", "7"] |
The days of the week on which to create automatic snapshots. Valid values are 1 to 7, which correspond to the days of the week. For example, a value of 1 indicates Monday. To schedule multiple automatic snapshots to be created in a week, you can specify multiple days.
|
| retentionDays | Integer | No | 30 |
The retention period of the automatic snapshot. Unit: days. Valid values:
Default value: -1. |
| EnableCrossRegionCopy | Boolean | No | false |
Specifies whether to enable cross-region replication for the automatic snapshot.
|
| TargetCopyRegions | String | No | ["cn-hangzhou"] |
The destination region to which to copy the snapshot. You can specify only a single destination region. |
| CopiedSnapshotsRetentionDays | Integer | No | 30 |
The retention period of the snapshot copy in the destination region. Unit: days. Valid values:
Default value: -1. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=ModifyAutoSnapshotPolicyEx
&autoSnapshotPolicyId=sp-bp12m37ccmxvbmi5****
®ionId=cn-hangzhou
&<Common request parameters>Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyAutoSnapshotPolicyResponse>
<RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
</ModifyAutoSnapshotPolicyResponse>JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | ParameterInvalid | The specified RegionId parameter is invalid. | The error message returned because the specified regionId parameter is invalid. |
| 403 | ParameterInvalid | The specified RepeatWeekDays parameter is invalid. | The error message returned because the specified repeatWeekdays parameter is invalid. |
| 403 | ParameterInvalid | The specified TimePoints parameter is invalid. | The error message returned because the specified timePoints parameter is invalid. |
| 403 | ParameterInvalid | The specified AutoSnapshotPolicyId is invalid. | The error message returned because the specified autoSnapshotPolicyId parameter is invalid. |
| 403 | ParameterInvalid | The specified RetentionDays parameter is invalid. | The error message returned because the specified retentionDays parameter is invalid. |
| 404 | ParameterInvalid | The specified automatic snapshot policy does not exist. | The error message returned because the specified autoSnapshotPolicyId parameter does not exist. |
| 404 | ParameterInvalid | The specified automatic snapshot policy does not exist in the region. | The error message returned because the specified autoSnapshotPolicyId parameter does not exist. |
For a list of error codes, visit the API Error Center.