阿里云如何使用重啟實(shí)例接口
來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2017-12-10 00:37┆點(diǎn)擊:
重啟指定的實(shí)例
只有狀態(tài)為 Running 的實(shí)例才可以進(jìn)行此操作。
接口調(diào)用成功后實(shí)例進(jìn)入 Starting 狀態(tài)。
支持強(qiáng)制重啟,強(qiáng)制重啟等同于傳統(tǒng)服務(wù)器的斷電重啟,可能丟失實(shí)例操作系統(tǒng)中未寫入磁盤的數(shù)據(jù)。
被安全控制在實(shí)例的 OperationLocks 中標(biāo)記了 "LockReason" : "security" 的鎖定狀態(tài)時(shí),不能重啟實(shí)例。
請求參數(shù)
名稱
類型
是否必須
描述
Action
String
是
系統(tǒng)規(guī)定參數(shù),取值:RebootInstance
InstanceId
String
是
指定實(shí)例的 ID
ForceStop
String
否
重啟機(jī)器時(shí)的是否強(qiáng)制關(guān)機(jī)策略。取值:
true
false
若為 false 則走正常關(guān)機(jī)流程;若為 true 則強(qiáng)制關(guān)機(jī)。
如果不指定,則默認(rèn)值為 false。
返回參數(shù)
全是公共返回參數(shù),詳見公共返回參數(shù)
錯(cuò)誤碼
錯(cuò)誤代碼
描述
Http 狀態(tài)碼
語義
InvalidInstanceId.NotFound
The InstanceId provided does not exist in our records.
404
指定的 InstanceId 不存在
MissingParameter
The input parameter "InstanceId" that is mandatory for processing this request is not supplied.
400
缺少 InstanceId 值
InvalidParameter
The specified parameter "ForceStop" is not valid.
400
指定的 ForceStop 不合法,(不在枚舉范圍內(nèi))
IncorrectInstanceStatus
The current status of the resource does not support this operation.
403
該資源目前的狀態(tài)不支持此操作
InstanceLockedForSecurity
The specified operation is denied as your instance is locked for security reasons.
403
該資源目前被安全鎖定被拒絕操作
DiskError
IncorrectDiskStatus
403
不正常的磁盤狀態(tài)
示例
請求示例
https://ecs.aliyuncs.com/?Action=RebootInstance
&InstanceId=i-instance1
&<公共請求參數(shù)>
返回示例
XML格式
F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A
JSON格式
{
"RequestId": "F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A"