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

當前位置:主頁 > 教程 > 服務器類 >

阿里云如何使用修改實例屬性接口

來源:技術員聯(lián)盟┆發(fā)布時間:2017-12-10 18:43┆點擊:

  修改實例屬性

  描述

  修改實例密碼、實例名稱、安全組等屬性信息。

  此操作只修改參數(shù)中顯式指定了的屬性,沒有指定的屬性將不會發(fā)生改變。

  重置實例的密碼,狀態(tài)為 Deleted 或 Starting 的實例不可以進行此操作。重置密碼需要重啟實例后才能生效。

  被安全控制在實例的 OperationLocks 中標記了 "LockReason" : "security"的鎖定狀態(tài)時,不能修改密碼。

  請求參數(shù)

名稱 類型 是否必須 描述
Action   String     系統(tǒng)規(guī)定參數(shù),取值:ModifyInstanceAttribute  
InstanceId   String     指定的實例 ID  
InstanceName   String     實例的顯示名稱,[2, 128] 英文或中文字符,必須以大小字母或中文開頭,可包含數(shù)字,".","_"或"-"。不能以 和 https:// 開頭。  
Description   String     實例的描述,[2, 256] 個字符。實例描述會顯示在控制臺。默認為空。不能以 和 https:// 開頭。  
Password   String     重置為用戶指定的密。8-30個字符,必須同時包含三項(大、小寫字母,數(shù)字和特殊符號)。支持以下特殊字符:( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' < > , . ? /
如果傳入 Password 參數(shù),請務必使用 HTTPS 協(xié)議調(diào)用 API 以避免可能發(fā)生的密碼泄露。
 
HostName   String     表示操作系統(tǒng)內(nèi)部的計算機名,最少 2 字符,"."和"-"是不能作為 hostname 的首尾字符,不能連續(xù)使用。
Windows 平臺最長為 15 字符,允許字母(不限制大小寫)、數(shù)字和"-"組成,不支持點號("."),不能全是數(shù)字。
其他(Linux 等)平臺最長為 30 字符,允許支持多個點號,點之間為一段,每段允許字母(不限制大小寫)、數(shù)字和"-"組成。
 

  返回參數(shù)

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

  錯誤碼

錯誤代碼 描述 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 值  
InvalidInstanceName.Malformed   The specified parameter "InstanceName" is not valid.   400   指定的 InstanceName 格式不合法  
InvalidDescription.Malformed   The specified parameter "Description" is not valid.   400   指定的 Description 格式不合法  
InvalidHostPassword.Malformed   The specified parameter "Password" is not valid.   400   指定的 Password 格式不合法  
InvalidHostName.Malformed   The specified parameter "HostName" is not valid.   400   指定的 HostName 格式不合法  
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   該資源目前被安全鎖定被拒絕操作  

  示例

  請求示例

  https://ecs.aliyuncs.com/?Action=ModifyInstanceAttribute

  &InstanceId=i-instance1

  &Password=pwd

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

  返回示例

  XML格式

  

  473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

  

  JSON格式

  {

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