技術(shù)員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機(jī)純凈版,64位旗艦版,綠色軟件,免費(fèi)軟件下載基地!

當(dāng)前位置:主頁(yè) > 教程 > 服務(wù)器類(lèi) >

阿里云如何使用掛載磁盤(pán)接口

來(lái)源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2017-05-23 15:52┆點(diǎn)擊:

  實(shí)例的狀態(tài)必須為 running 或者 stopped,且實(shí)例的 OperationLocks 中沒(méi)有標(biāo)記 "LockReason" : "security" 的鎖定狀態(tài),且不欠費(fèi)。

  在該接口中設(shè)置的 DeleteWithInstance 屬性,在實(shí)例的 OperationLocks 中標(biāo)記為"LockReason" : "security" 的鎖定狀態(tài)時(shí),釋放實(shí)例時(shí)會(huì)忽略磁盤(pán)的 DeleteWithInstance 屬性而被同時(shí)釋放。

  請(qǐng)求參數(shù)

名稱(chēng) 類(lèi)型 是否必須 描述
Action   String     操作接口名,系統(tǒng)規(guī)定參數(shù),取值:AttachDisk  
InstanceId   String     目標(biāo)云服務(wù)器 ID  
DiskId   String     磁盤(pán) ID,磁盤(pán)和 Instance 必須在同一個(gè) Zone  
Device   String     空表示由系統(tǒng)默認(rèn)分配,/dev/xvdb 開(kāi)始到 /dev/xvdz
默認(rèn)值:空
 
DeleteWithInstance   String     磁盤(pán)是否隨實(shí)例釋放:

true 表示 Instance 釋放時(shí),這塊磁盤(pán)隨 Instance 一起釋放;

false 表示 Instance 釋放時(shí),這塊磁盤(pán)保留不釋放。

默認(rèn)值:無(wú),表示保留當(dāng)前值不做修改。
 

  返回參數(shù)

  全是公共返回參數(shù),詳見(jiàn)公共返回參數(shù)

  錯(cuò)誤碼

錯(cuò)誤代碼 描述 Http 狀態(tài)碼 語(yǔ)義
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   指定的實(shí)例不存在  
InvalidDiskId.NotFound   The specified disk does not exist.   404   指定的磁盤(pán)不存在  
InvalidDevice.Malformed   The specified device is not valid.   400   指定的磁盤(pán)不存在  
InvalidParameter   The specified parameter "DeleteWithInstance" is not valid.   400   指定的 DeleteWithInstance 參數(shù)不合法  
InstanceDiskLimitExceeded   The amount of the disk on instance in question reach its limits.   403   指定實(shí)例已經(jīng)達(dá)到可掛載磁盤(pán)的最大值  
InvalidDevice.InUse   The specified device has been occupied.   403   指定的設(shè)備已經(jīng)掛載了磁盤(pán)  
IncorrectDiskStatus   The operation is not supported in this status.   403   磁盤(pán)狀態(tài)不正確  
DiskNotPortable   It is not a portable disk.   403   指定磁盤(pán)不是可卸載的磁盤(pán)  
InstanceLockedForSecurity   The instance is locked due to security.   403   指定的實(shí)例被安全鎖定  
ResourcesNotInSameZone   The specified instance and disk are not in the same zone.   403   指定磁盤(pán)和實(shí)例不在同一個(gè)可用區(qū)  
InstanceExpiredOrInArrears   The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).   403   指定的實(shí)例已欠費(fèi)  
DiskInArrears   The specified operation is denied as your disk owing fee.   403   指定的磁盤(pán)已欠費(fèi)  
IncorrectInstanceStatus   The current status of the resource does not support this operation.   400   指定的實(shí)例狀態(tài)不正確  
DiskError   IncorrectDiskStatus   403   不正常的磁盤(pán)狀態(tài)  

  示例

  請(qǐng)求示例

  https://ecs.aliyuncs.com/?action=AttachDisk

  &InstanceId=i-23jggx34b

  &DiskId=d-23jbf2v5m

  &<公共請(qǐng)求參數(shù)>

  返回示例

  XML格式:

  

  473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

  

  JSON格式:

  {

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