You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
实例
ModifyInstanceAttribute - 修改实例信息
复制全文
下载 pdf
ModifyInstanceAttribute - 修改实例信息
调用 ModifyInstanceAttribute 接口修改一台ECS实例的信息,包括名称、描述、密码、主机名以及自定义数据等。​
使用说明​
修改实例的登录密码、主机名、自定义数据之前,请务必先查看相关文档,充分了解其中的约束限制和注意事项,以确保操作的准确性和合规性。​
重启实例后,实例上将展示新的自定义数据,但不会运行数据脚本。​
请求说明​
调用该接口时,如不传入可选参数,则保持原有配置。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ModifyInstanceAttribute​
要执行的操作,取值:ModifyInstanceAttribute。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
ClientToken string 可选 示例值:333456899ff****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
CpuOptions.TopologyType string 可选 示例值:DiscreteCoreToHTMapping​
CPU拓扑模式。取值:​
  • ContinuousCoreToHTMapping:HT连续模式。​
  • DiscreteCoreToHTMapping:HT离散模式。​
说明​
  • 该功能正在邀测中,如需使用,请联系客户经理申请。​
​
DeletionProtection boolean 可选 示例值:true​
实例删除保护属性,指定是否支持通过控制台或API删除实例。取值:​
  • true:开启实例删除保护。​
  • false:关闭实例删除保护。​
​
Description string 可选 示例值:ECS instance for testing.​
实例的描述。​
  • 必须以字母或中文开头。​
  • 只能包含中文、字母、数字、点“.”、空格、下划线“_”、中划线“-”、等号“=”、英文逗号“,”、中文逗号“,”和中文句号“。”​
  • 长度限制在255个字符以内。​
说明​
传入空字符串时,将清空原有描述信息。​
​
EnableJumboFrame boolean 可选 示例值:true​
实例是否开启巨型帧。取值:​
  • false:不开启巨型帧,该实例的所有网卡MTU值为1500。​
  • true:开启巨型帧,该实例的所有网卡MTU值为8500。​
说明​
该功能仅支持部分实例,支持巨型帧的实例请参见开启/关闭巨型帧。​
​
Hostname string 可选 示例值:instance-host-name​
实例主机名,即实例操作系统内部的计算机名。​
  • Linux实例:​
  • 允许使用字母、数字、点号“.”或中划线“-”。​
  • 不能以中划线、点号开头或结尾,且不能连续使用中划线和点号。​
  • Linux系统长度限制在2~63个字符之间。​
  • Windows实例:​
  • 允许使用字母、数字或中划线“-”,不能完全是数字。​
  • 不能以中划线开头或结尾,且不能连续使用中划线。​
  • Windows系统长度限制在2~15个字符之间。​
​
InstanceId string 必选 示例值:i-l8u10sauiu9qj0h*****​
实例ID。​
​
InstanceName string 可选 示例值:instance-test​
实例的名称。​
  • 以字母或中文开头。​
  • 只能包含中文、字母、数字、下划线“_”、中划线“-”和点号“.”。​
  • 长度限制为1~128个字符。​
​
Password string 可选 示例值:password@123​
使用“密码”方式登录实例时,请设置实例的登录密码。​
  • 长度限制在8~30之间。​
  • 密码只能由大写字母、小写字母、数字和特殊字符组成,且必须包含至少三项。​
  • 特殊字符可以使用:`~!@#$%^&*()_-+=|{}[]:;'<>,.?/​
  • 不能以“/”和“$6$”开头。​
​
UserData string 可选 示例值:IyEvYmluL2Jhc2gKdG91Y2ggL3RtcC91c2VyZG******​
实例自定义数据,提供一种自定义实例启动行为及传入数据的功能。​
  • 传入数据时,设置的自定义数据必须经过Base64编码,且Base64编码前的自定义数据大小不能超过16KB。​
  • 传入空字符串时,将清空自定义数据。​
​
​
​
返回参数​
本接口无特有的返回参数。更多信息请见返回结构。​
请求示例​
​
GET /?Action=ModifyInstanceAttribute&Version=2020-04-01&InstanceId=i-l8u10sauiu9qj0h*****&Password=password@123 HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20211104180426010194099035220C****",​
"Action": "ModifyInstanceAttribute",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {}​
}​
​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
IdempotentParameterMismatch​
The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.​
幂等参数不一致。​
400​
Insufficient.Balance​
The request is denied due to the lack of balance.​
账户余额不足。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的ClientToken不合法。​
400​
InvalidCpuAccelerator.Malformed​
The specified CpuAccelerator is malformed.​
指定的CpuAccelerator不合法。​
400​
InvalidDedicatedHostStatus.Unsupported​
The status of the specified dedicated host does not support this request.​
当前专有宿主机的状态不支持此操作。​
400​
InvalidEnableJumboFrameForModifyInstanceAttribute.Unsupported​
The specified EnableJumboFrame cannot be used for ModifyInstanceAttribute.​
当前不支持修改EnableJumboFrame配置。​
400​
InvalidHostname.Malformed​
The specified Hostname is malformed.​
指定的主机名不合法。​
400​
InvalidInstanceDescription.Malformed​
The specified InstanceDescription is malformed.​
指定的实例描述不合法。​
400​
InvalidInstanceName.Malformed​
The specified InstanceName is malformed.​
指定的实例名称不合法。​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
当前实例的状态不支持此操作。​
400​
InvalidPassword.Malformed​
The specified password is malformed.​
指定的密码格式不合法。​
400​
InvalidTopologyType.Malformed​
The specified TopologyType is malformed.​
指定的TopologyType不合法。​
400​
InvalidUserData.Malformed​
The specified UserData is malformed.​
指定的UserData不合法。​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
参数实例ID不能为空。​
400​
MissingParameter.InstanceName​
The required parameter InstanceName is not supplied.​
实例名称不能为空。​
403​
InvalidChargeTypeForDeletionProtection.Unsupported​
Deletion protection is only valid for postPaid instance.​
删除保护功能只能使用在普通按量付费资源上。​
403​
InvalidInstance.RequestForbidden​
Request is forbidden by the server.​
由于您的账户违反了相关规定,指定的资源已不再可以使用,如需恢复服务请提交工单联系服务人员处理。​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
指定的实例不存在。​
404​
InvalidResetAuthenticationAgent.NotFound​
The specified reset-authentication agent does not install on the instance.​
指定的密码重置插件不存在。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
先前的幂等请求仍在处理中,请稍后重试。​
412​
InvalidDisableJumboFrame.VrdmaMismatch​
The specified request includes an unsupported operation. It is not supported to disable jumbo frame with vRDMA ENI on the ECS.​
您在关闭JumboFrame前需先关闭vRDMA ENI。​
412​
OperationDenied.ResourceCreatedByOtherService​
The specified operation is denied as your resource is created by other service. You can check system tags to find the service.​
指定的操作被拒绝,因为您的资源被其他服务创建。您可以通过资源的系统标签查询对应服务。​
412​
OperationDenied.EnableJumboFrameForceDisabled​
The specified operation is denied because Jumbo Frame is force-disabled for the account.​
指定的操作被拒绝,因为当前账号强制关闭JumboFrame。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2026.08.20 15:14:37
这个页面对您有帮助吗?
有用
有用
无用
无用