閱讀429 返回首頁    go 魔獸


卸載磁盤__磁盤相關接口_API 參考_雲服務器 ECS-阿裏雲

描述

Portable 屬性為 True 的磁盤,且磁盤所掛載的實例的狀態必須為 running 或者 stopped,且實例的 OperationLocks 中沒有標記 "LockReason" : "security" 的鎖定狀態,磁盤可以執行此操作。

當一塊獨立普通雲盤通過這個接口從一台實例上卸載後,DeleteWithInstance 會被置為 False

如果 DiskId 的磁盤不掛載在 InstanceId 的實例上,該操作失敗。

該接口是異步操作,請求返回後,仍然需要等待一段時間才能完成卸載,預計在 1 分鍾左右。

請求參數

名稱 類型 是否必須 描述
Action String 操作接口名,係統規定參數,取值:DetachDisk
InstanceId String 目標雲服務器 ID
DiskId String 磁盤 ID

返回參數

全是公共返回參數,詳見公共返回參數

錯誤碼

錯誤代碼 描述 Http 狀態碼 語義
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 磁盤狀態不正確
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 指定的磁盤未係統盤不能卸載

示例

請求示例

https://ecs.aliyuncs.com/?action=DetachDisk
&InstanceId=i-23jggx34b 
&DiskId=d-23jbf2v5m
&<公共請求參數>

返回示例

XML格式

<DetachDiskResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</DetachDiskResponse>

JSON格式

{
    "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

最後更新:2016-11-23 16:03:50

  上一篇:go 掛載磁盤__磁盤相關接口_API 參考_雲服務器 ECS-阿裏雲
  下一篇:go 修改磁盤屬性__磁盤相關接口_API 參考_雲服務器 ECS-阿裏雲