阿里云如何使用卸載磁盤接口
來源:技術(shù)員聯(lián)盟┆發(fā)布時間:2017-05-04 13:58┆點擊:
Portable 屬性為 True 的磁盤,且磁盤所掛載的實例的狀態(tài)必須為 running 或者 stopped,且實例的 OperationLocks 中沒有標記 "LockReason" : "security" 的鎖定狀態(tài),磁盤可以執(zhí)行此操作。
當一塊獨立普通云盤通過這個接口從一臺實例上卸載后,DeleteWithInstance 會被置為 False。
如果 DiskId 的磁盤不掛載在 InstanceId 的實例上,該操作失敗。
該接口是異步操作,請求返回后,仍然需要等待一段時間才能完成卸載,預計在 1 分鐘左右。
請求參數(shù)
名稱
類型
是否必須
描述
Action
String
是
操作接口名,系統(tǒng)規(guī)定參數(shù),取值:DetachDisk
InstanceId
String
是
目標云服務(wù)器 ID
DiskId
String
是
磁盤 ID
返回參數(shù)
全是公共返回參數(shù),詳見公共返回參數(shù)
錯誤碼
錯誤代碼
描述
Http 狀態(tài)碼
語義
MissingParameter
The input parameter "InstanceId" that is mandatory for processing this request is not supplied.
400
InstanceId 未指定
MissingParameter
The input parameter "DiskId" that is mandatory for processing this request is not supplied.
400
DiskId 未指定
InvalidInstanceId.NotFound
The specified instance does not exist.
404
指定的實例不存在
InvalidDiskId.NotFound
The specified disk does not exist.
404
指定的磁盤不存在
IncorrectDiskStatus
The current disk status does not support this operation.
403
磁盤狀態(tài)不正確
DiskNotPortable
It is not a portable disk.
403
指定磁盤不是可卸載的磁盤
InstanceLockedForSecurity
The instance is locked due to security.
403
指定的實例被安全鎖定
DependencyViolation
The specified disk has not been attached on the specified instance.
403
指定磁盤沒有掛載在指定的實例上
DiskTypeViolation
The specified disk is a system disk and cannot support the operation.
403
指定的磁盤未系統(tǒng)盤不能卸載
示例
請求示例
https://ecs.aliyuncs.com/?action=DetachDisk
&InstanceId=i-23jggx34b
&DiskId=d-23jbf2v5m
&<公共請求參數(shù)>
返回示例
XML格式
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"