Creates an automatic snapshot policy. After you modify an automatic snapshot policy, the new policy takes effect immediately on the disks that have previously applied the policy.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: ModifyAutoSnapshotPolicyEx.
RegionId String Yes The region ID. For more information, call DescribeRegions to obtain the latest region list.
AutoSnapshotPolicyId String Yes The ID of the automatic snapshot policy.  You can call DescribeAutoSnapshotPolicyEx to view all your automatic snapshot policies.
AutoSnapshotPolicyName String No The name of the automatic snapshot policy. Default value: null.
TimePoints String No The automatic snapshot creation time, and the unit of measurement is hour. Value range: [0, 23], which represents from 00:00 to 24:00, for example 1 indicates 01:00. When you want to schedule multiple automatic snapshot tasks for a disk in a day, you can set the TimePoints to an array.
  • A maximum of 24 time points can be selected.
  • The format is similar to ["0", "1", … "23"]  JSON array and the time points are separated by commas (,).
RepeatWeekdays String No The automatic snapshot repetition dates. The unit of measurement is a day and the repeating cycle is a week. Value range: [1, 7], for example 1  indicates Monday. When you want to schedule multiple automatic snapshot tasks for a disk in a week, you can set the RepeatWeekdays to an array.
  • A maximum of seven time points can be selected.
  • The format is ["1", "2", … "7"] JSON array and the time points are separated by commas (,).
RetentionDays Integer No The snapshot retention time, and the unit of measurement is day. Optional values:
  • -1: Permanent saved.
  • [1, 65536]: The number of days retained.
Default: -1.
ClientToken String No Guarantees the idempotence of the request. The value is generated by a client. It must be unique among all requests and contains a maximum of 64 ASCII characters. For more information, see How to ensure idempotence.

Response parameters

All are common parameters. For more information, see Common parameters.

Examples

Request example
https://ecs.aliyuncs.com/?Action=ModifyAutoSnapshotPolicyEx
&RegionId=cn-hangzhou
&AutoSnapshotPolicyId=p-233e6ylv0
&SettingTimePoints=[“0”, “11”, “21”]
&SettingRepeatWeekdays=[“1”, “2”, “4”, “7”]
&RetentionDays=30
&<Common Request Parameters>
Response example

XML format

<ModifyAutoSnapshotPolicyResponse>
    <RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
</ModifyAutoSnapshotPolicyResponse>
JSON format
{
    "RequestId":"F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
}

Error codes

Error codes specific to this interface are as follows. For more error codes, see API Error Center.

Error code Error message HTTP status code Note
ParameterInvalid The specified automatic snapshot policy does not exist. 404 The specified AutoSnapshotPolicyId does not exist.
ParameterInvalid The specified automatic snapshot policy does not exist in the region. 404 The specified AutoSnapshotPolicyId does not exist in the specified region.
ParameterInvalid The specified AutoSnapshotPolicyId is invalid. 404 The specified AutoSnapshotPolicyId is not legal.
ParameterInvalid The specified RegionId parameter is invalid. 404 The specified RegionId is not valid.