調用ResetDisk使用云盤的歷史快照回滾至某一階段的云盤狀態。
接口說明
調用該接口時,您需要注意:
- 云盤的狀態必須為使用中(In_Use)或空閑(Available)的狀態。
- 云盤掛載的實例的狀態必須為已停止(Stopped)。您可以調用 StopInstances 停止實例。
- 指定的參數 SnapshotId 必須是由 DiskId 創建的歷史快照。
- 通過 DescribeInstances 查詢 ECS 實例信息時,如果返回數據中包含
{"OperationLocks": {"LockReason" : "security"}}
,則禁止一切操作。
調試
您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
授權信息
當前API暫無授權信息透出。
請求參數
名稱 | 類型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
DiskId | string | 是 | 待回滾數據的云盤 ID。 | d-bp199lyny9b3**** |
SnapshotId | string | 是 | 需要恢復到某一云盤階段的歷史快照 ID。 | s-bp199lyny9b3**** |
DryRun | boolean | 否 | 是否預檢本次請求。取值范圍:
默認值:false。 | false |
返回參數
示例
正常返回示例
JSON
格式
{
"RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}
錯誤碼
HTTP status code | 錯誤碼 | 錯誤信息 | 描述 |
---|---|---|---|
400 | DiskCategory.OperationNotSupported | The operation is not supported to the specified disk due to its disk category. | 由于磁盤種類限制,指定的磁盤不支持該操作。 |
400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | 指定的地域不存在,請檢查該參數是否正確。 |
400 | DryRunOperation | Request validation has been passed with DryRun flag set. | 通過“DryRun”校驗,您的請求已通過驗證。 |
403 | IncorrectDiskStatus | The current disk status does not support this operation. | 當前的磁盤不支持此操作,請您確認磁盤處于正常使用狀態,是否欠費。 |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 該資源目前的狀態不支持此操作。 |
403 | InstanceLockedForSecurity | The instance is locked due to security. | 您的資源被安全鎖定,拒絕操作。 |
403 | InvalidParameter.Mismatch | The specified snapshot is not created from the specified disk. | 未加密的磁盤無法通過加密的快照重置。 |
403 | InvalidParameter.Mismatch | Non-encrypted disk can not be reset by encrypted snapshot. | - |
403 | InvalidSnapshot.TooOld | The snapshotId is created before 2013-07-15, it cannot be restored since the first time the disk detached. | 創建于2013年7月15日之前的快照不支持此操作。 |
403 | InstanceExpiredOrInArrears | The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). | 實例已過期或者欠費,請您續費或者結清后再進行操作。 |
403 | OperationDenied | The specified snapshot dees not support ResetDisk. | 指定的快照不支持重置磁盤。 |
403 | InvalidSnapshotId.NotReady | The specified snapshot has not completed yet. | 指定的快照未完成。 |
403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | 賬號余額不足,請您先充值再進行該操作。 |
403 | InvalidAccountStatus.SnapshotServiceUnavailable | Snapshot service has not been opened yet. | 快照服務未開通,操作無法執行。 |
403 | Operation.Conflict | The operation may conflicts with others. | 該操作與其他操作沖突。 |
403 | UserNotInTheWhiteList | The user is not in disk white list. | 您不在磁盤白名單中,請加入白名單后重試。 |
403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | CMK 未授權 |
403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | 加密云盤設置了 KMSKeyId 后,CMK必須處于啟用狀態。您可以調用密鑰管理服務的 DescribeKey 接口查詢指定CMK的相關信息。 |
403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | ECS 服務無權訪問您的 KMS。 |
403 | IncorrectDiskStatus.HasUnfinishedSnapshot | The current disk has unfinished snapshot. | 當前磁盤有未完成快照。 |
404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | 指定的參數 KMSKeyId 不存在。 |
404 | InvalidDiskId.NotFound | The specified disk does not exist. | 指定的磁盤不存在。請您檢查磁盤 ID 是否正確。 |
404 | Disk.NotFound | The specified disk does not exist. | 指定的磁盤不存在,請您檢查磁盤是否正確。 |
404 | InvalidSnapshotId.NotFound | The specified SnapshotId does not exist. | 指定的快照不存在,請您檢查快照是否正確。 |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的實例ID未找到。 |
500 | InternalError | The request processing has failed due to some unknown error. | 內部錯誤,請重試。 |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 內部錯誤,請重試。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
變更時間 | 變更內容概要 | 操作 |
---|---|---|
2023-08-25 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |