本介面用於修改一台 ECS 執行個體的部分屬性資訊,支援修改密碼、執行個體名稱、主機名稱、所屬安全性群組、執行個體的 MTU 以及使用者自訂資料等。
介面說明
被安全鎖定的執行個體不支援呼叫該介面。更多資訊,請參見資源安全鎖定對呼叫 API 的影響。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:ModifyInstanceAttribute |
update |
*Instance
SecurityGroup
|
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| InstanceId |
string |
是 |
執行個體 ID。 |
i-bp67acfmxazb4ph**** |
| Password |
string |
否 |
執行個體的密碼。支援長度為 8~30 個字元,必須同時包含大小寫英文字母、數字和特殊符號中的三類字元。特殊符號可以是:()`~!@#$%^&*-_+=|{}[]:;'<>,.?/ 。Windows 執行個體不能以斜線號(/)為密碼首字元。使用該參數時請注意:
說明
如果傳入 |
Test123456&$ |
| HostName |
string |
否 |
作業系統的主機名稱。使用該參數時請注意:
不同作業系統主機名稱存在以下限制:
|
testHostName |
| InstanceName |
string |
否 |
執行個體名稱。長度為 2~128 個英文或中文字元。必須以大小寫字母或中文開頭,不能以 |
testInstanceName |
| Description |
string |
否 |
執行個體描述。長度為 2~256 個英文或中文字元,不能以 |
testInstanceDescription |
| UserData |
string |
否 |
執行個體自訂資料,建議 Base64 編碼後傳入。使用該參數時請注意:
說明
編碼前,原始資料不能超過 32 KB。建議不要明文傳入敏感資訊,例如密碼和私密金鑰等。如果必須傳入敏感資訊,建議您加密後再以 Base64 編碼傳入,在執行個體內部以同樣的方式解密。 |
ZWNobyBoZWxsbyBlY3Mh |
| Recyclable |
boolean |
否 |
說明
該參數正在邀測中,暫不開放使用。 |
true |
| CreditSpecification |
string |
否 |
修改突發效能執行個體的運行模式。取值範圍:
關於突發效能執行個體運行模式的更多資訊,請參見什麼是突發效能執行個體。 |
Standard |
| DeletionProtection |
boolean |
否 |
執行個體釋放保護屬性。指定是否支援透過控制台或 API( DeleteInstance )釋放執行個體。 說明
該屬性僅適用於隨用隨付執行個體,且只能限制手動釋放操作,對系統釋放操作不生效。 |
false |
| NetworkInterfaceQueueNumber |
integer |
否 |
主網路卡佇列數。使用該參數時請注意:
|
8 |
| SecurityGroupIds |
array |
否 |
執行個體重新加入的安全性群組 ID 陣列。使用該參數時請注意:
說明
修改安全性群組後很快會生效於對應的執行個體,但可能有較小的延遲。 |
sg-bp15ed6xe1yxeycg7o**** |
|
string |
否 |
安全性群組 ID。 |
sg-bp15ed6xe1yxeycg7o**** |
|
| RemoteConnectionOptions |
object |
否 |
說明
該參數正在邀測中,暫不開放使用。 |
|
| Password |
string |
否 |
說明
該參數正在邀測中,暫不開放使用。 |
hide |
| Type |
string |
否 |
說明
該參數正在邀測中,暫不開放使用。 |
hide |
| EnableJumboFrame |
boolean |
否 |
執行個體 MTU 是否開啟 Jumbo frame 通訊模式,取值範圍:
使用該參數時請注意:
|
false |
| CpuOptions.Core |
integer |
否 |
CPU 核心數。該參數不支援自訂設定,只能採用預設值。 |
2 |
| CpuOptions.ThreadsPerCore |
integer |
否 |
CPU 執行緒數。ECS 執行個體的 vCPU 數=
|
2 |
| CpuOptions.TopologyType |
string |
否 |
執行個體的 CPU 拓撲類型。取值範圍:
預設值:無。 使用該參數時請注意:
說明
僅部分執行個體規格族支援使用本參數,具體支援執行個體規格族請參見查看和修改 CPU 拓撲結構。 |
DiscreteCoreToHTMapping |
| PrivateDnsNameOptions |
object |
否 |
執行個體的私網網域名稱設定資訊集合。 關於私網網域名稱解析,請參見 ECS 私網網域名稱解析 。 |
|
| EnableInstanceIdDnsARecord |
boolean |
否 |
開啟/關閉執行個體 ID 類型的網域名稱到 IPv4 的解析。可能值:
預設值:false。 |
false |
| EnableInstanceIdDnsAAAARecord |
boolean |
否 |
開啟/關閉執行個體 ID 類型的網域名稱到 IPv6 的解析。可能值:
預設值:false。 |
false |
| EnableIpDnsARecord |
boolean |
否 |
開啟/關閉 IP 類型的網域名稱到 IPv4 的解析。可能值:
預設值:false。 |
false |
| EnableIpDnsPtrRecord |
boolean |
否 |
開啟/關閉 IPv4 到 IP 類型的網域名稱解析。可能值:
預設值:false。 |
false |
| HostnameType |
string |
否 |
主機名稱類型,可能值:
預設值:Custom。 |
Custom |
| CpuOptions |
object |
否 |
||
| NestedVirtualization |
string |
否 |
說明
該參數正在邀測中,暫未開放使用。 |
enabled |
| EnableNetworkEncryption |
boolean |
否 |
開啟/關閉 VPC 網路流量加密,可能值:
說明
該參數正在邀測中,暫未開放使用。 |
true |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidInstanceName.Malformed | The specified parameter "InstanceName" is not valid. | |
| 400 | InvalidDescription.Malformed | The specified parameter "Description" is not valid. | |
| 400 | InvalidRemoteConnectionOptions.Password | The remote connection password is invalid. | |
| 400 | InvalidRemoteConnectionOptions.Type | The remote connection type is invalid. | |
| 400 | InstanceType.ValueNotSupported | The instance type not supported. | |
| 400 | OSType.ValueNotSupported | The OS type is not supported. | |
| 400 | InvalidHostPassword.Malformed | The specified parameter "Password" is not valid. | |
| 400 | InvalidHostName.Malformed | The specified parameter "HostName" is not valid. | |
| 400 | InvalidPassword.Malformed | The specified parameter "Password" is not valid. | |
| 400 | InvalidUserData.SizeExceeded | The specified parameter "UserData" exceeds the size. | |
| 400 | InvalidUserData.NotSupported | TThe specified parameter "UserData" only support the vpc and IoOptimized Instance. | |
| 400 | ImageNotSupportCloudInit | The specified image does not support cloud-init. | |
| 400 | ChargeTypeViolation | Pay-As-You-Go instances do not support this operation. | |
| 400 | InvalidParameter.RecycleBin | You do not have permission to set recyclable properties. | |
| 400 | InvalidParameter.CreditSpecification | The specified CreditSpecification is not supported in this region. | |
| 400 | InvalidInstanceStatus.CreditSpecRestricted | The current status of the resource does not support this operation. | |
| 400 | InvalidInstanceStatus.NotRunning | The current status of the resource is invalid, you can only do this operation when instance is running. | |
| 400 | InvalidNetworkType.NotSupported | The classic networkType does not support to modify security group | |
| 400 | InvalidOperation.EniCountExceeded | =The maximum number of eni in a enterprise security group is exceeded. | |
| 400 | JoinedGroupLimitExceed | %s | |
| 400 | InvalidParameter | The specified parameter is not valid. | |
| 400 | InvalidOperation.InvalidEcsState | %s | |
| 400 | InvalidParam.NotSupportJumboFrame | Not support jumbo frame. | |
| 400 | InvalidOperation.InstanceStatusNotSupport | The instance status is not support modify mtu config. | |
| 400 | InvalidOperation.InstanceStatusUnsupported | The specified instance status does not support modification of cpu topology type. | |
| 400 | InvalidParameter.CpuOptionsTopologyType | The specified parameter CpuOptions.TopologyType: %s is not valid. | |
| 400 | InvalidInstanceType.NotSupportCpuOptionsTopologyType | The specified instance type does not support CpuOptions.TopologyType: %s. | |
| 400 | InvalidAdditionalInfoPvdConfig.SizeExceeded | The specified parameter AdditionalInfo.PvdConfig exceeds the size. | |
| 400 | InvalidInstanceType.NotSupportHighDensityMode | The specified instance type does not support the use of the high density mode. | |
| 400 | InvalidStatus.StoppedRequired | The current state of the resource does not support this operation, it can only be operated in a stopped state. | |
| 400 | InvalidParameter.CpuOptionsTurboMode | The specified parameter TurboMode is not valid. | |
| 400 | InvalidInstanceType.EnableNVSUnsupported | The specified instance type does not support EnableNVS. | |
| 400 | InvalidInstanceType.EnableVISSTUnsupported | The specified instance type does not support EnableVISST. | |
| 400 | InvalidInstanceType.EnableVRDTUnsupported | The specified instance type does not support EnableVRDT. | |
| 400 | InvalidInstanceType.SingleCoreMaxModeUnsupported | The specified instance type does not support TurboMode: "SINGLE CORE MAX". | |
| 400 | InvalidInstanceType.GpuOptionsConfidentialComputingUnsupported | The specified instance type does not support the confidential computing mode. | |
| 400 | InvalidParameter.GpuOptionsConfidentialComputing | The specified parameter confidential computing mode is not valid. | |
| 400 | InvalidParameterAuthorized.GpuOptionsConfidentialComputing | The specified parameter confidential computing mode is unauthorized. | |
| 400 | InvalidParameter.CpuOptionsNestedVirtualization | The specified parameter CpuOptions.NestedVirtualization: %s is not valid. | |
| 400 | InvalidInstanceType.NotSupportCpuOptionsNestedVirtualization | The specified instance type does not support CpuOptions.NestedVirtualization: %s. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | |
| 403 | OperationDenied | The instance amount in the specified SecurityGroup reach its limit. | |
| 403 | InvalidUserData.Forbidden | User not authorized to input the parameter "UserData"please apply for permission "UserData" | |
| 403 | InvalidUserData.Base64FormatInvalid | The specified UserData is not valid | |
| 403 | InvalidChargeType.ValueNotSupported | Deletion protection is only valid for postPaid instance, not for prePaid or spot instance. | |
| 403 | InvalidUser.Unauthorized | The user is not authorized | |
| 403 | EnterpriseGroupLimited.MutliGroupType | The specified instance can not join multi SecurityGroup types. | |
| 403 | SecurityGroupInstanceLimitExceed | %s | |
| 403 | InstanceNotInSecurityGroup | The instance not in the group. | |
| 403 | InvalidOperation.InvalidRegion | %s | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | |
| 403 | InvalidParameter.InvalidEniQueueNumber | %s | |
| 403 | InvalidOperation.MaxEniQueueNumberExceeded | %s | |
| 403 | InvalidOperation.ExceedInstanceTypeQueueNumber | %s | |
| 403 | InvalidOperation.InstanceTypeNotSupportHighPerformanceTrafficMode | %s | |
| 403 | InvalidParameter.InvalidQueuePairNumber | %s | |
| 403 | InvalidOperation.MaxEniQueuePairNumberExceed | %s | |
| 403 | InvalidOperation.EniQueuePairNumberOverflow | %s | |
| 403 | AclLimitExceed | %s | |
| 403 | InvalidInstanceType.CpuOptionsThreadsPerCoreUnsupported | The current instance type does not support setting or modifying the CpuOptions.ThreadsPerCore parameter. | |
| 403 | InvalidParameter.CpuOptionsCore | The specified parameter CpuOptions.Core is not valid. | |
| 403 | InvalidParameter.CpuOptionsThreadsPerCore | The specified parameter CpuOptions.ThreadsPerCore is not valid. | |
| 403 | InvalidOperation.UserNotSupportNetworkEncryption | User not support network encryption. | |
| 403 | InvalidOperation.InstanceTypeNotSupportNetworkEncryption | The specified instance type does not support network encryption. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | |
| 404 | Credit.NotFound | The specified credit information does not exist. | |
| 404 | InvalidInstanceStatus.NeedRestart | The current status of the resource is invalid, you can only do this operation after instance is restarted. | |
| 404 | InvalidParameter.SecurityGroupIdRepeated | The specified security group ids has repeated. | |
| 404 | InvalidSecurityGroupType.NotSupportClassic | The specified SecurityGroupIds have classic group type. | |
| 404 | InvalidSecurityGroupVpc.NotBelongToOneVpc | The specified SecurityGroupIds are belong to different vpc. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。