This topic describes how to call the CancelAutoSnapshotPolicy operation by using Alibaba Cloud command-line interface (CLI) to cancel the automatic snapshot policy for one or more disks.

Background information

You can call the CancelAutoSnapshotPolicy operation to cancel the automatic snapshot policy for one or more disks. For more information, see CancelAutoSnapshotPolicy.

When you call an API operation through Alibaba Cloud CLI, make sure that request parameter values of different data types are in required formats. For more information, see Parameter format overview.

Request examples

  1. Call the DescribeDisks operation to query the ID of the disk for which you want to cancel the automatic snapshot policy.
    In this example, query the ID of the disk by using its name.
    aliyun ecs DescribeDisks --RegionId cn-hangzhou --DiskName demoname --output cols=Disks.Disk[].DiskId
    Sample response:
    Disks.Disk[].DiskId
    -------------------
    [d-bp15hfgq0pb85p37****]
  2. In this example, cancel the automatic snapshot policy for disk d-bp15hfgq0pb85p37****.
    aliyun ecs CancelAutoSnapshotPolicy --regionId cn-hangzhou --diskIds '["d-bp15hfgq0pb85p37****"]'

Result

{
        "RequestId": "7D453425-5229-4D50-BE06-D16CD92A3E7C"
}