ModifySnapshotCategory

更新时间:
复制 MD 格式

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

Operation description

请确保在使用该接口前,已充分了解归档快照产品的收费方式和价格

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

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

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ModifySnapshotCategory

update

*Snapshot

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

  • ecs:tag
None

Request parameters

Parameter

Type

Required

Description

Example

SnapshotId

string

Yes

The ID of the snapshot.

s-123**sd

Category

string

No

The type of the snapshot.

  • Archive: archive snapshot

Archive

RetentionDays

integer

No

The retention period of the snapshot. Unit: days. The retention period started at the point in time when the snapshot was created. You can archive only standard snapshots that have been retained for at least 14 days.

After the snapshot is archived, the minimum retention period (also called minimum archive period) is 60 days. When you calculate the retention period of archived snapshots, you must deduct the retention period of standard snapshots. 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.

Value range [74,65536]

Note

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

100

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

TaskId

string

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

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidRetentionDays.Malformed The specified RetentionDays is not valid. The specified RetentionDays parameter is invalid.
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. The specified snapshot is being created.
400 InvalidOperation.ArchiveSharedSnapshotUnsupported The specified shared snapshot is not support archive. Snapshots whose source is shared cannot be archived.
400 InvalidOperation.ArchiveCloudBoxSnapshotUnsupported The specified snapshot in CloudBox is not support archive. Snapshots stored in the cloud box do not support archiving.
400 InvalidStatus.SnapshotUnfinished The specified unfinished snapshot is not support archive. Archiving is not supported for incomplete snapshots.
400 InvalidStatus.SnapshotAgeLimit The specified snapshot created within 14 days is not support archive. Archiving is not supported for snapshots that are less than 14 days old.
400 InvalidStatus.SnapshotInArchive The specified snapshot is currently being archived. Specifies that the snapshot is being archived.
400 InvalidParameter.SnapshotCategory The specified parameter category is invalid. The specified parameter category is invalid
400 InvalidRetentionDays.LessThanLockExpiredTime The specified parameter RetentionDays is invalid. The RetentionDays should be greater than the snapshot LockExpiredTime. The specified parameter RetentionDays is invalid. The RetentionDays should be greater than the snapshot LockExpiredTime.
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. This operation is not supported because the resource is managed by cloud products. Contact the corresponding cloud product to confirm the reason.
403 InvalidOperation.InstantAccessEnabledUnsupport The specified snapshot with legacy Instant Access enabled does not support archive. The specified snapshot with legacy Instant Access enabled does not support archive.
403 InvalidOperation.EncryptedSnapshotUnsupport Archiving encrypted snapshots is not currently supported. Archiving encrypted snapshots is not 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. The number of parallel archive tasks associated with the current snapshot exceeds the quota limit. Try again later.
403 InvalidOperation.DefaultFreeSnapshotNotSupport The specified snapshot is a default free snapshot and does not support this operation. The specified snapshot is a default free snapshot and does not support the current operation.
404 InvalidSnapshotId.NotFound The specified SnapshotId does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.