全部產品
Search
文件中心

Elastic Compute Service:ModifySnapshotCategory - 修改快照類型

更新時間:Apr 04, 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 天的Archive Storage費用,請參見快照計費

取值範圍[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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情