ApplyAutoSnapshotPolicy

Last Updated: Mar 20, 2018

Description

Applies automatic snapshot policies to one or more disks. If an automatic snapshot policy has been applied to a disk, calling ApplyAutoSnapshotPolicy can change the automatic snapshot policy for the specified disks. When you call this interface, consider the following:

  • One disk can be applied to only one automatic snapshot policy.

  • You can apply an automatic snapshot policy to multiple disks.

  • A short queuing waiting time exists if there are many automatic snapshot tasks at a certain time point. Consequently, the automatic snapshot tasks at the specified time point cannot be carried out at the same time.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: ApplyAutoSnapshotPolicy.
RegionId String Yes The region ID of the automatic snapshot policy and the disks. For more information, see Regions and zones, or call DescribeRegions to obtain the latest region list.
AutoSnapshotPolicyId String Yes The ID of the automatic snapshot policy. You can call DescribeAutoSnapshotPolicyEx to obtain all of your automatic snapshot policy IDs.
DiskIds String Yes The disk ID. When you want to apply the automatic snapshot policy to multiple disks, you can set the DiskIds to an array. The format is a JSON array of ["d-xxxxxxxxx", "d-yyyyyyyyy", … "d-zzzzzzzzz"] and the IDs are separated by commas (,).

Response parameters

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

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=ApplyAutoSnapshotPolicy
  2. &RegionId=cn-hangzhou
  3. &AutoSnapshotPolicyId=p-233e6ylv0
  4. &DiskIds=[“d-233e6ylv0”, d-23vbpbi03”, d-23vasz3ds”]
  5. &<Common Request Parameters>

Response example

XML format

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

JSON format

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

Error codes

Error code Error message HTTP status code Meaning
DiskCategory.OperationNotSupported The type of the specified disk type does not support creating a snapshot. 400 You cannot apply automatic policy to a local disk. For more information, see Local disks.
DiskCategory.OperationNotSupported The types of some disks in the disk list do not support creating snapshots. 400 IDs of local disks exist in the DiskIds.
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 invalid.
ParameterInvalid The specified RegionId parameter is invalid. 404 The specified RegionId is invalid.
ParameterInvalid The specified DiskIds are invalid. 404 The specified DiskIds are invalid.
Thank you! We've received your feedback.