全部产品
Search
文档中心

云服务器 ECS:ModifySnapshotCategory - 修改快照类型

更新时间:Aug 28, 2026

修改快照类型,可以通过该接口将标准快照转换为归档快照。

接口说明

  • 归档快照不支持还原为标准快照。

  • 标准快照创建完成之后,必须至少已保留 14 天,才能进行归档。

  • 共享来的快照、云产品托管的快照、云盒内的快照不支持归档。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ecs:ModifySnapshotCategory

update

*Snapshot

acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId}

  • ecs:tag

请求参数

名称

类型

必填

描述

示例值

SnapshotId

string

快照 ID。

s-123**sd

Category

string

快照类型。

  • Archive:归档快照

Archive

RetentionDays

integer

快照保留天数。起始时间为快照资源创建时间 CreationTime。标准快照创建完成之后,必须至少已保留 14 天,才能进行归档。

归档类型快照有保留时间限制,需要在归档类型中至少保留 60 天。计算归档快照保留时间时,需扣除标准快照已保留时间。不足 60 天删除归档快照会收取 60 天的归档存储费用,请参见快照计费

取值范围[74,65536]

说明

不填写该参数则表示永久保留。

100

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

B48A12CD-1295-4A38-A8F0-0E92C937****

TaskId

string

归档任务 ID。您可以通过 DescribeTasks 接口查询任务的状态、进度。

t-dxh34xds**d

示例

正常返回示例

JSON格式

{
  "RequestId": "B48A12CD-1295-4A38-A8F0-0E92C937****",
  "TaskId": "t-dxh34xds**d"
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidRetentionDays.Malformed The specified RetentionDays is not valid. 指定的保留天数无效。请检查 RetentionDays 参数值是否正确。
400 InvalidOperation.DecreaseRetentionDaysUnsupported The requested operation to decrease retention days for the snapshot is not supported. 不支持缩短快照保留天数。
400 InvalidSnapshotId.NotReady The specified snapshot has not completed yet. 指定的快照未完成。
400 InvalidOperation.ArchiveSharedSnapshotUnsupported The specified shared snapshot is not support archive. 来源为共享的快照无法进行归档。
400 InvalidOperation.ArchiveCloudBoxSnapshotUnsupported The specified snapshot in CloudBox is not support archive. 存储在云盒的快照不支持归档。
400 InvalidStatus.SnapshotUnfinished The specified unfinished snapshot is not support archive. 未完成的快照不支持归档。
400 InvalidStatus.SnapshotAgeLimit The specified snapshot created within 14 days is not support archive. 创建时间不足14天的快照不支持归档。
400 InvalidStatus.SnapshotInArchive The specified snapshot is currently being archived. 指定快照正在归档中。
400 InvalidParameter.SnapshotCategory The specified parameter category is invalid. 指定参数category无效
400 InvalidRetentionDays.LessThanLockExpiredTime The specified parameter RetentionDays is invalid. The RetentionDays should be greater than the snapshot LockExpiredTime. 指定的参数 RetentionDays 无效。保留时间应大于快照锁定过期时间。
403 InvalidOperation.ResourceManagedByCloudProduct The current operation is not supported because the resource is managed by a cloud product. Please contact the relevant cloud product to confirm the reason. 此次操作不支持因为资源被云产品托管。请联系对应的云产品确认原因。
403 InvalidOperation.InstantAccessEnabledUnsupport The specified snapshot with legacy Instant Access enabled does not support archive. 启用了旧版极速可用的快照不支持归档
403 InvalidOperation.EncryptedSnapshotUnsupport Archiving encrypted snapshots is not currently supported. 暂不支持归档加密快照
403 QuotaExceed.ConcurrentArchiveSnapshotQuota The number of concurrent archiving tasks associated with the disk of the current snapshot has exceeded the quota limit. Please try again later. 当前快照关联的磁盘并行的归档任务数量超过配额限制,请稍后重试。
403 InvalidOperation.DefaultFreeSnapshotNotSupport The specified snapshot is a default free snapshot and does not support this operation. 指定的快照是一个默认免费快照,不支持当前操作。
404 InvalidSnapshotId.NotFound The specified SnapshotId does not exist.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情