为一块或者多块云盘应用自动快照策略。
接口说明
每块云盘支持应用多条自动快照策略,最多 10 条。
若目标云盘已应用自动快照策略,在调用该接口时,将在原有基础上新增,不会更换已有策略。
请自主取消不需要的自动快照策略,以免产生非预期费用。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:ApplyAutoSnapshotPolicy |
update |
*Disk
*AutoSnapshotPolicy
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| regionId |
string |
是 |
自动快照策略和云盘所在的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。 |
cn-hangzhou |
| autoSnapshotPolicyId |
string |
是 |
目标自动快照策略 ID。 |
sp-bp14yziiuvu3s6jn**** |
| diskIds |
string |
是 |
一块或多块云盘的 ID。取值是 JSON 数组格式,云盘 ID 之间用半角逗号(,)隔开。 |
["d-bp14k9cxvr5uzy54****", "d-bp1dtj8v7x6u08iw****", "d-bp1c0tyj9tfli2r8****"] |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
异常返回示例
JSON格式
{
"RequestId":"F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | DiskCategory.OperationNotSupported | The type of the specified disk does not support creating a snapshot. | 当前磁盘类型不支持此操作。 |
| 400 | PartofDiskCategory.OperationNotSupported | The types of some disks in the disk list do not support creating snapshots. | 部分指定的磁盘不支持此操作。 |
| 400 | InvalidAutoSnapshotPolicyId.NotFound | The specified auto snapshot policy does not exist. Please verify the autoSnapshotPolicyId and try again. | |
| 400 | InvalidOperation.DiskReadOnlyNotSupportSnapshot | The specified disk "%s" is a read-only disk. The snapshot operation is not supported. Please remove the read-only disk from the request and try again. | |
| 500 | InternalError | The request processing has failed due to an internal error and you may retry later or contact support with the request ID. | |
| 403 | ParameterInvalid | The specified regionId does not exist. Please call DescribeRegions to query the supported regions and try again. | |
| 403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | |
| 403 | InvalidAccountStatus.SnapshotServiceUnavailable | The snapshot service has not been activated. Please activate it and try again. | |
| 403 | InvalidOperation.SnapshotAlreadyCreatedUnsupported | The current disk already has snapshots created by non-promotional activities. Snapshot policies bound to promotional activities are not supported. | 当前磁盘已有非促销活动创建的快照,不支持绑定到促销活动的快照策略。 |
| 403 | QuotaExceed.AppliedAutoSnapshotPolicyQuota | The number of auto snapshot policies applied to the specified disk %s has exceeded the quota %s. Please cancel any unused policies and try again. | 指定的云盘应用的自动快照策略数量已超过配额,请取消无用的策略后重试。 |
| 403 | InvalidOperation.AutoSnapshotPolicyConflict | The disk %s cannot apply the auto snapshot policy of promotional activities and other policies at the same time. | 云盘不允许同时应用免费运营活动快照策略和其他策略。 |
| 403 | InvalidOperation.AssociatedWithInstanceTagNotSupported | The disk cannot apply auto snapshot policies of the AssociatedWithInstanceTag type. | |
| 403 | InvalidOperation.StorageLocationMismatch | The specified parameter autoSnapshotPolicyId is configured with a storage location that does not match the storage location of the latest snapshot of the specified diskIds. Please apply a policy configured with the same storage location or select disks that match the storage location of the policy. | |
| 403 | InvalidParameter.UnauthorizedStorageLocationArn | The current account does not have permission to access the storage location configured in the specified parameter autoSnapshotPolicyId. Please use an automatic snapshot policy whose storage location your account is authorized to access. | |
| 403 | InvalidOperation.DiskNotSupportStorageLocation | The disk specified by diskIds is not in a cloud box so it does not support the storage location configured in the specified parameter autoSnapshotPolicyId. Please select disks in the cloud box that matches the storage location of the policy. | |
| 404 | ParameterInvalid | The specified auto snapshot policy does not exist. Please verify the autoSnapshotPolicyId and try again. | |
| 404 | InvalidDiskId.NotFound | The specified diskIds do not exist. Please verify the diskIds and the current region and try again. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。