ModifyAutoSnapshotPolicy

Last Updated: Mar 20, 2018

Description

Modifies an automatic snapshot policy.

Note: 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, see Regions and zones, or call DescribeRegions to obtain the latest region list.
AutoSnapshotPolicyId String Yes The ID of the target automatic snapshot policy. You can call DescribeAutoSnapshotPolicyEx to obtain all of your automatic snapshot policy IDs.
AutoSnapshotPolicyName String No The name of the automatic snapshot policy.
  • It can consist of [2, 128] English or Chinese characters.
  • Must begin with an uppercase or lowercase letter or a Chinese character.
  • Can contain numbers, periods (.), underscores (_), and hyphens (-).
  • Cannot start with http:// or https://.
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 an JSON array of ["0", "1", … "23"] 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], which represents from Monday to Sunday, 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 an JSON array of ["1", "2", … "7"] and the time points are separated by commas (,).
RetentionDays Integer No The snapshot retention time, and the unit of measurement is a day. Optional values:
  • -1: The automatic snapshots are retained permanently.
  • [1, 65536]: The number of days retained.
Default value: -1.
ClientToken String No To guarantee 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 response parameters. For more information, see Common parameters.

Examples

Request example

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

Response example

XML format

  1. <ModifyAutoSnapshotPolicyResponse>
  2. <RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
  3. </ModifyAutoSnapshotPolicyResponse>

JSON format

  1. {
  2. "RequestId":"F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
  3. }

Error codes

Error code Error message HTTP status code Meaning
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 parameter is invalid. 404 The specified AutoSnapshotPolicyId parameter is invalid.
ParameterInvalid The specified RegionId parameter is invalid. 404 The specified RegionId parameter is invalid.
Thank you! We've received your feedback.