本接口用于修改一台按量付费ECS实例的实例规格或者公网带宽大小。
接口说明
请确保在使用该接口前,已充分了解 ECS 产品的收费方式和价格。
更改按量付费实例规格前,您可以通过 DescribeResourcesModification 查询当前实例支持变配的实例规格。
注意事项
账号必须处于无欠费状态。
每次调用只能修改单项配置,即单次只能修改实例规格,或者只能调整公网带宽大小。
实例状态必须为运行中(
Running)或者已停止(Stopped)时才能调节公网带宽大小,修改后立即生效。实例状态必须为已停止(
Stopped)时才能修改实例规格,修改后需要启动实例后生效。
单个地域下,单个阿里云账号按固定带宽计费的公网带宽峰值总和存在限制,请参见公网带宽限制。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:ModifyInstanceSpec |
update |
*Instance
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
指定的实例 ID。 |
i-bp67acfmxazb4p**** |
| InstanceType |
string |
否 |
实例的目标规格。更多信息,请参见实例规格族,也可以调用 DescribeInstanceTypes 接口获得最新的规格表。 |
ecs.g6.large |
| InternetMaxBandwidthOut |
integer |
否 |
公网出带宽最大值,单位为 Mbit/s(Megabit per second)。取值范围:0~100。 说明
按使用流量计费模式下的出入带宽峰值都是带宽上限,不作为业务承诺指标。当出现资源争抢时,带宽峰值可能会受到限制。如果您的业务需要有带宽的保障,请使用按固定带宽计费模式。 |
10 |
| InternetMaxBandwidthIn |
integer |
否 |
公网入带宽最大值,单位为 Mbit/s(Megabit per second)。取值范围:
说明
按使用流量计费模式下的出入带宽峰值都是带宽上限,不作为业务承诺指标。当出现资源争抢时,带宽峰值可能会受到限制。如果您的业务需要有带宽的保障,请使用按固定带宽计费模式。 |
10 |
| Temporary.StartTime |
string |
否 |
说明
该参数正在邀测中,暂未开放使用。 |
null |
| Temporary.EndTime |
string |
否 |
说明
该参数正在邀测中,暂未开放使用。 |
null |
| Temporary.InternetMaxBandwidthOut |
integer |
否 |
说明
该参数正在邀测中,暂未开放使用。 |
null |
| Async |
boolean |
否 |
是否提交异步请求。取值范围:
默认值:false。 |
false |
| AllowMigrateAcrossZone |
boolean |
否 |
是否支持跨集群升级实例规格。
默认值:false。 当参数 经典网络类型实例:
专有网络 VPC 类型实例:对于已停售的实例规格,非 I/O 优化实例变配到 I/O 优化实例时,云服务器磁盘设备名和软件授权码会发生变化。Linux 实例的普通云盘( |
false |
| SystemDisk.Category |
string |
否 |
更换系统盘类型。取值范围:
说明
该参数只有在从已停售的实例规格升级到正常售卖的实例规格族,并将非 I/O 优化实例规格升级为 I/O 优化实例规格时有效。 |
cloud_ssd |
| ClientToken |
string |
否 |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| ModifyMode |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| Disk |
array<object> |
否 |
说明
该参数暂未开放使用。 |
|
|
object |
否 |
说明
该参数暂未开放使用。 |
||
| DiskId |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| Category |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| PerformanceLevel |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| DryRun |
boolean |
否 |
是否只预检此次请求。取值范围:
|
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
异常返回示例
JSON格式
{
"RequestId": "E69EF3CC-94CD-42E7-8926-F133B86387C0",
"HostId": "ecs.aliyuncs.com",
"Code": "InvalidInstance.UnpaidOrder",
"Message": "The specified instance has unpaid order."
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidInternetChargeType.ValueNotSupported | The specified InternetChargeType is not valid. | 暂不支持指定的网络付费类型的实例,请确认相关参数是否正确。 |
| 400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType does not exist or beyond the permitted range. | 您指定的实例规格不存在,或者您没有权限操作此规格的实例。 |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 您指定的实例规格不存在,或者您没有权限操作此规格的实例。 |
| 400 | InvalidParameter | The specified parameter "InternetMaxBandwidthOut" is not valid. | |
| 400 | InvalidParameter.Mismatch | Too many parameters in one request. | 请求中包含的参数过多。 |
| 400 | BandwidthUpgradeDenied.EipBoundInstance | The specified VPC instance has bound EIP, temporary bandwidth upgrade is denied. | 该实例已经绑定 EIP,不能进行临时升级。 |
| 400 | InvalidTemporary.StartTime | The specifed Temporary.StartTime is not valid. | 指定的临时升级开始时间无效。 |
| 400 | InvalidTemporary.EndTime | The specifed Temporary.EndTime is not valid. | 指定的临时升级结束时间无效。 |
| 400 | Downgrade.NotSupported | Downgrade operation is not supported. | 不支持降配。 |
| 400 | DependencyViolation.InstanceType | The current InstanceType cannot be changed to the specified InstanceType. | 当前实例的规格不能变更到指定的规格。 |
| 400 | Account.Arrearage | Your account has an outstanding payment. | 您的账号存在未支付的款项。 |
| 400 | InvalidParameter.Bandwidth | The specified parameter Bandwidth is not valid. | 指定的 Bandwidth 不合法。 |
| 400 | InvalidParameter.Conflict | The specified image does not support the specified instance type. | 指定的镜像不能用于指定的实例规格。 |
| 400 | InvalidParameter.AllowMigrateAcrossZone | The specified parameter CanMigrateAcrossZone is not valid. | 指定的参数 CanMigrateAcrossZone 无效。 |
| 400 | InvalidParam.SystemDiskCategory | The specified param SystemDisk.Category is not valid. | 指定的系统盘类型参数无效。 |
| 400 | Throttling | Request was denied due to request throttling, please try again after 5 minutes. | 您当前的请求被流控,请5分钟后重试。 |
| 400 | InvalidInstanceStatus.NotStopped | The specified Instance status is not stopped. | 指定实例的状态不是已停止。 |
| 400 | InvalidAction | Specified action is not valid. | 该操作无效。 |
| 400 | IdempotenceParamNotMatch | There is a idempotence signature mismatch between this and last request. | 该请求与上一个请求的 ClientToken 参数一致,但其它请求参数不一致。 |
| 400 | InvalidClientToken.ValueNotSupported | The ClientToken provided is invalid. | 指定的 ClientToken 不合法。 |
| 400 | Price.PricePlanResultNotFound | The internetMaxBandwidthIn or internetMaxBandwidthOut provided is invalid. | 提供的 internetMaxBandwidthIn 或 internetMaxBandwidthOut 无效。 |
| 400 | InvalidAction.NotSupport | The ecs on dedicatedHost not support modify instanceType. | 专用宿主机上的实例不支持变更实例规格。 |
| 400 | InvalidMarketImageStatus.NotSupported | The status of specified market image does not support this operation. | 指定的市场镜像的状态不支持该操作。 |
| 400 | InvalidOperation.VpcHasEnabledAdvancedNetworkFeature | The specified vpc has enabled advanced network feature. | 该VPC开启了高阶特性,不能创建低规格的ECS。 |
| 400 | Invalid.PrivatePoolOptions.MatchCriteria | Target mode does not support this operation. | Target模式不支持本次操作。 |
| 400 | InstanceTypeNotSupported.TooManyDisksAttached | %s | |
| 400 | InvalidDiskCategory.NotSupported | The upgrade operation of instance does not support this category of disk. | |
| 400 | InvalidParameter.CloudboxNotSupported | %s | |
| 400 | QuotaExceed.DiskCapacity | The used capacity of disk type has exceeded the quota in the zone, %s. | 指定磁盘类型的已用容量超出可用区配额限制,您可以前往配额中心查询和申请提升磁盘容量配额。 |
| 400 | InvalidParam.Async | The specified parameter async is not valid. | Async参数不合法。 |
| 400 | MissingParameter.DiskCategory | The specified parameter Disk.Category can not be null when Disk.DiskId is specified. | |
| 400 | InvalidParameter.DiskCategory | The specified parameter Disk.Category is not valid. | |
| 400 | InvalidPerformanceLevel.Malformed | The specified parameter Disk.n.PerformanceLevel is not valid. | |
| 400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. | 该操作需要价格权限。请向您的主账户申请权限,或将参数AutoPay设置为true进行自动支付。 |
| 400 | InvalidParameter.DedicatedRegionNotSupported | The specified action is rejected because the specified ECS instance in the dedicated region does not support public IP. | 专属云地域不支持的参数错误码 |
| 400 | InvalidOperation.OnlineModificationUnsupported | Online modification of instance type is not supported for the specified instance due to its CPU topology. | 当前CPU拓扑类型不支持热变配 |
| 400 | QuotaExceeded.InternetBandwidth | %s. | 您当前账号下,按量付费ECS实例的按固定带宽计费公网带宽超过了总带宽配额限制。 |
| 400 | InvalidOperation.InstanceTypeNotSupportRss | The ECS instance type does not support Rss. | 指定实例的规格不支持开启Rss |
| 401 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | 指定的实例规格未授权使用。 |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误,请重试。 |
| 403 | CategoryViolation | The specified instance does not support this operation because of its disk category. | |
| 403 | InvalidStatus.ValueNotSupported | 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 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | |
| 403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | |
| 403 | OperationDenied | The specified instance is out of usage. | 指定的实例库存不足。 |
| 403 | LastTokenProcessing | The last token request is processing. | |
| 403 | InvalidInstance.UnpaidOrder | The specified instance has unpaid order. | |
| 403 | InstanceSpecModification.NotEffective | The specified instance has been reserved for making a spec modification and not taken effective in the current contract period. | 指定的实例因规格调整被保留,在当前合同期内无法生效。 |
| 403 | InvalidInstanceType.ValueNotSupported | The specified zone does not offer the specified instancetype. | 指定的区域不提供此类型的实例。 |
| 403 | ImageNotSupportInstanceType | The specified image do not support the InstanceType instance. | 指定的镜像不支持此类实例规格。 |
| 403 | InstanceType.Offline | The specified InstanceType has been offline. | 指定的实例规格已下线 |
| 403 | InvalidParameter.NotMatch | %s | 您输入的参数无效,请检查参数之间是否冲突。 |
| 403 | InvalidInstance.EipNotSupport | The specified instance with eip is not supported, please unassociate eip first. | 已绑定 EIP 的实例不支持该操作,请先解绑此EIP。 |
| 403 | InvalidInstance.NatPortMapNotSupport | The special instance with nat port map not support operate, please remove nat port map first. | |
| 403 | InvalidOperation.StarterPackage | StarterPackage not support modification. | |
| 403 | OperationDenied.NoStock | The resource is out of usage. | |
| 403 | OperationDenied.UnpaidOrder | The specified instance has unpaid order. | 指定的实例ID已存在未支付订单,您可以登录ECS管理控制台支付。 |
| 403 | InvalidOperation.EipNotSupport | The special instance with eip not support operate, please unassociate eip first. | |
| 403 | InvalidParameter.InternetMaxBandwidthOut | The specified parameter InternetMaxBandwidthOut is invalid. | |
| 403 | InvalidOperation.EniCountExceeded | %s | |
| 403 | InvalidOperation.Ipv4CountExceeded | %s | IPv4 数量达到上限,导致该操作无效。 |
| 403 | InvalidOperation.Ipv6CountExceeded | %s | IPv6 数量达到上限,导致该操作无效。 |
| 403 | InvalidOperation.Ipv6NotSupport | %s | IPv6不支持当前操作。 |
| 403 | InvalidOperation.Ipv4NotSupport | %s | |
| 403 | InvalidOperation.InstanceWithEipNotSupport | The special instance with eip not support operate, please unassociate eip first. | 已绑定 EIP 的实例不支持该操作,请优先解绑 EIP。 |
| 403 | SecurityRisk.3DVerification | We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. | 我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。 |
| 403 | InvalidInstance.NotFoundSystemDisk | The specified instance has no system disk. | |
| 403 | InvalidInstanceType.NotSupportDiskCategory | The instanceType of the specified instance does not support this disk category. | 指定的实例规格(InstanceType)不支持当前实例的云盘类别。请尝试更换其它实例规格。关于实例规格支持的云盘类型,请参见实例规格族文档。 |
| 403 | QuotaExceed.ElasticQuota | No additional quota is available for the specified ECS instance type. | 您在当前地域选择的实例规格所要创建的台数超出系统限额,您可以选择其他地域、实例规格或减少台数重新购买,也可以前往ECS管理控制台或配额中心申请提高限额。 |
| 403 | InvalidResourceType.NotSupported | %s | 指定资源组合不存在,请更换其他可用区或规格 |
| 403 | InvalidOperation.NotAllowed | The specified vpc %s has enabled senior network feature. | |
| 403 | InvalidOperation.InstanceTypeNotSupportEniTrunking | %s | 不支持本次操作。具体信息请参见错误信息%s占位符的实际返回值。 |
| 403 | InvalidOperation.MaxEniQueueNumberExceeded | %s | 弹性网卡队列数超过上限,具体信息请参见错误信息%s占位符的实际返回结果。 |
| 403 | InvalidOperation.ExceedInstanceTypeQueueNumber | %s | 弹性网卡队列总数超过上限,具体信息请参见错误信息%s占位符的实际返回结果。 |
| 403 | InvalidParameter.InvalidEniQueueNumber | %s | 弹性网卡队列数有误,具体信息请参见错误信息%s占位符的实际返回结果。 |
| 403 | HibernationConfigured.InstanceOperationForbidden | The operation is not permitted due to limit of the hibernation configured instance. | 不符合开启休眠选项的实例的相关限制,操作不被允许。 |
| 403 | InvalidOperation.InstanceTypeNotSupportHighPerformanceTrafficMode | %s | 指定实例的实例规格不支持RDMA通信模式的网卡。 |
| 403 | InvalidOperation.EniQueuePairNumberOverflow | %s | |
| 403 | InvalidOperation.HighPerformanceEniPerInstanceLimitExceeded | %s | |
| 403 | InvalidOperation.MaxEniQueuePairNumberExceed | %s | |
| 403 | InvalidOperation.MaxModifyOnlineNumberExceeded | The specified instance has reached the maximum number of modify online attempts and needs to be rebooted. | |
| 403 | InvalidOperation.RebootingRequired | The specified instance needs to be rebooted. | |
| 403 | InvalidOperation.OSTypeNotSupported | The specified OS type is not supported. | |
| 403 | InvalidSystemDiskCategory.ValueNotSupported | The specified parameter SystemDisk.Category is not valid. | 指定的 SystemDisk.Category 值不受支持。 |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The specified Category of Data Disk is not valid. | 指定的数据盘磁盘类型不支持 |
| 403 | InvalidDiskCategory.NotSupported | The upgrade operation of instance does not support this category of disk. | 实例的升级操作不支持此类磁盘。 |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的实例ID无效。 |
| 404 | MissingTemporary.StartTime | Temporary.StartTime is not specified. | 未指定临时升级开始时间。 |
| 404 | MissingTemporary.EndTime | Temporary.EndTime is not specified. | 未指定临时升级结束时间。 |
| 404 | InvalidInstanceChargeType.NotFound | The InstanceChargeType does not exist in our records. | |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | 当前服务不可用。请稍后重试。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。