All Products
Search
Document Center

Elastic Compute Service:ModifySnapshotCategory

Last Updated:Mar 10, 2025

Changes the type of a snapshot. You can call this operation to convert a standard snapshot into an archive snapshot.

Operation description

  • Archive snapshots cannot be restored to standard snapshots.
  • You can archive only standard snapshots that have been retained for at least 14 days.
  • You cannot archive encrypted snapshots.
  • You cannot archive snapshots that are shared to you, snapshots managed by Cloud Backup, or snapshots in cloud boxes.
  • The archive snapshot feature is available only in the China (Hohhot), Malaysia (Kuala Lumpur), South Korea (Seoul), Philippines (Manila), Thailand (Bangkok), and Mexico regions. The availability of the feature in other regions is subject to notice.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:ModifySnapshotCategoryupdate
*Snapshot
acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId}
  • ecs:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
SnapshotIdstringYes

The ID of the snapshot.

s-123**sd
CategorystringNo

The new type of the snapshot.

  • Archive: archive snapshot
Archive
RetentionDaysintegerNo

The retention period of the snapshot. Unit: days. The retention period started at the point in time when the snapshot was created. After the snapshot is archived, the minimum retention period (also called minimum archive period) is 60 days. If you delete the snapshot within 60 days after the snapshot is archived, you are charged archive tier storage fees for the snapshot for 60 days. For more information about the billing of snapshots, see Snapshots .

Valid values: 60 to 65536.

Note If you do not specify this parameter, the snapshot is permanently retained.
60

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

The ID of the archive task. You can call the DescribeTasks operation to query the status and progress of the archive task.

t-dxh34xds**d

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidRetentionDays.MalformedThe specified RetentionDays is not valid.The specified RetentionDays parameter is invalid.
400InvalidOperation.DecreaseRetentionDaysUnsupportedThe requested operation to decrease retention days for the snapshot is not supported.-
400InvalidSnapshotId.NotReadyThe specified snapshot has not completed yet.The specified snapshot is being created.
400InvalidOperation.ArchiveSharedSnapshotUnsupportedThe specified shared snapshot is not support archive.Snapshots whose source is shared cannot be archived.
400InvalidOperation.ArchiveCloudBoxSnapshotUnsupportedThe specified snapshot in CloudBox is not support archive.Snapshots stored in the cloud box do not support archiving.
400InvalidStatus.SnapshotUnfinishedThe specified unfinished snapshot is not support archive.Archiving is not supported for incomplete snapshots.
400InvalidStatus.SnapshotAgeLimitThe specified snapshot created within 14 days is not support archive.Archiving is not supported for snapshots that are less than 14 days old.
400InvalidStatus.SnapshotInArchiveThe specified snapshot is currently being archived.Specifies that the snapshot is being archived.
400InvalidParameter.SnapshotCategoryThe specified parameter category is invalid.The specified parameter category is invalid
403InvalidOperation.ResourceManagedByCloudProductThe current operation is not supported because the resource is managed by a cloud product. Please contact the relevant cloud product to confirm the reason.This operation is not supported because the resource is managed by cloud products. Contact the corresponding cloud product to confirm the reason.
403InvalidOperation.InstantAccessEnabledUnsupportThe specified snapshot with legacy Instant Access enabled does not support archive.The specified snapshot with legacy Instant Access enabled does not support archive.
403InvalidOperation.EncryptedSnapshotUnsupportArchiving encrypted snapshots is not currently supported.Archiving encrypted snapshots is not supported
404InvalidSnapshotId.NotFoundThe specified SnapshotId does not exist.The specified snapshot ID does not exist.

For a list of error codes, visit the Service error codes.