阿里云如何使用回滾磁盤接口
來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2017-12-08 18:24┆點(diǎn)擊:
使用指定磁盤自身的快照回滾磁盤內(nèi)容。
實(shí)例狀態(tài)必須為 Stopped 時(shí),才可以執(zhí)行此操作。
磁盤狀態(tài)必須為使用中(In_use)的狀態(tài),才能執(zhí)行此操作。
指定的 SnapshotId 必須是由 DiskId 創(chuàng)建的快照,否則報(bào)錯(cuò)。
實(shí)例的 OperationLocks 中標(biāo)記了 "LockReason" : "security" 的鎖定狀態(tài),則報(bào)錯(cuò)。
請(qǐng)求參數(shù)
名稱
類型
是否必須
描述
Action
String
是
系統(tǒng)規(guī)定參數(shù),取值:ResetDisk
DiskId
String
是
指定的磁盤設(shè)備 ID
SnapshotId
String
是
恢復(fù)磁盤的快照 ID
返回參數(shù)
全是公共返回參數(shù),詳見公共返回參數(shù)
錯(cuò)誤碼
錯(cuò)誤代碼
描述
Http 狀態(tài)碼
語義
MissingParameter
The input parameter "DiskId" that is mandatory for processing this request is not supplied.
400
DiskId 參數(shù)未指定
MissingParameter
The input parameter "SnapshotId" that is mandatory for processing this request is not supplied.
400
SnapshotId 參數(shù)未指定
InvalidDiskId.NotFound
The specified disk does not exist.
404
指定的磁盤不存在
InvalidSnapshotId.NotFound
The specified snapshot does not exist.
404
指定的快照不存在
IncorrectDiskStatus
The current disk status does not support this operation.
403
磁盤狀態(tài)不正確
IncorrectInstanceStatus
The current status of the resource does not support this operation.
403
指定的實(shí)例狀態(tài)不正確
InstanceLockedForSecurity
The instance is locked due to security.
403
指定的實(shí)例被安全鎖定
InvalidParameter.Mismatch
The specified snapshot is not created from the specified disk.
403
指定的快照不是創(chuàng)建自指定的磁盤
InvalidSnapshot.TooOld
The snapshotId is created before 2013-07-15, it cannot be restored since the first time the disk detached.
403
指定的快照創(chuàng)建于 2013 年 7 月 15 日(含)之前,不能回滾磁盤
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
指定的快照未完成
示例
請(qǐng)求示例
https://ecs.aliyuncs.com/?Action=ResetDisk
&DiskId= d-23jbf2v5m
&SnapshotId=s-snapshot1
&<公共請(qǐng)求參數(shù)>
返回示例
XML格式
F3CD6886-D8D0-4FEE-B93E-1B73239673DE
JSON格式
{
"RequestId":"F3CD6886-D8D0-4FEE-B93E-1B73239673DE"