ModifyInstanceSpec_云服务器 ECS_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

请确保在使用该接口前,已充分了解 ECS 产品的收费方式和价格

更改按量付费实例规格前,您可以通过 DescribeResourcesModification 查询当前实例支持变配的实例规格。

注意事项

  • 账号必须处于无欠费状态。
  • 每次调用只能修改单项配置,即单次只能修改实例规格,或者只能调整公网带宽大小。
  • 实例状态必须为运行中Running)或者已停止Stopped)时才能调节公网带宽大小,修改后立即生效。
  • 实例状态必须为已停止Stopped)时才能修改实例规格,修改后需要启动实例后生效。
说明 单个地域下,单个阿里云账号按固定带宽计费的公网带宽峰值总和存在限制,请参见公网带宽限制

流控信息

请求速率为1000/60(s)。更多流控信息,请前往配额中心查看

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
ecs:ModifyInstanceSpec
Update
Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

请求参数

字段名称字段详情
InstanceIdstring

指定的实例 ID。

示例值:i-bp67acfmxazb4p****参考取值来源:
    RunInstances
    StopInstances
    CreateInstance
    StartInstances
    RebootInstances
    DescribeInstances
    ModifyManagedInstance
    RenewReservedInstances
    AttachInstanceRamRole
    DetachInstanceRamRole
    DeregisterManagedInstance
    PurchaseReservedInstancesOffering
InstanceTypestring

实例的目标规格。更多信息,请参见实例规格族,也可以调用 DescribeInstanceTypes 接口获得最新的规格表。

示例值:ecs.g6.large参考取值来源:
    DescribeInstanceTypes
    CreateInstance
InternetMaxBandwidthOutinteger<int32>

公网出带宽最大值,单位为 Mbit/s(Megabit per second)。取值范围:0~100。展开详情

示例值:10
InternetMaxBandwidthIninteger<int32>

公网入带宽最大值,单位为 Mbit/s(Megabit per second)。取值范围:展开详情

示例值:10取值 <= 200
Temporary.StartTimestring
说明 该参数正在邀测中,暂未开放使用。
示例值:null
Temporary.EndTimestring
说明 该参数正在邀测中,暂未开放使用。
示例值:null
Temporary.InternetMaxBandwidthOutinteger<int32>
说明 该参数正在邀测中,暂未开放使用。
示例值:null取值 <= 100
Asyncboolean

是否提交异步请求。取值范围:展开详情

示例值:false
AllowMigrateAcrossZoneboolean

是否支持跨集群升级实例规格。展开详情

示例值:false
SystemDisk.Categorystring

更换系统盘类型。取值范围:展开详情

示例值:cloud_ssd
ClientTokenstring

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性

示例值:0c593ea1-3bea-11e9-b96b-88e9fe637760
ModifyModestring
说明 该参数暂未开放使用。
示例值:null枚举值:OnlineOffline
Diskarray<object>
说明 该参数暂未开放使用。
子级条数 <= 128
DryRunboolean

是否只预检此次请求。取值范围:展开详情

示例值:false

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

返回示例

错误返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
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.诊断
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.诊断
400
InvalidParameter.Conflict
The specified image does not support the specified instance type.诊断
400
InvalidParameter.AllowMigrateAcrossZone
The specified parameter CanMigrateAcrossZone is not valid.诊断
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.诊断
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.诊断
400
InvalidClientToken.ValueNotSupported
The ClientToken provided is invalid.诊断
400
Price.PricePlanResultNotFound
The internetMaxBandwidthIn or internetMaxBandwidthOut provided is invalid.诊断
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.诊断
400
Invalid.PrivatePoolOptions.MatchCriteria
Target mode does not support this operation.诊断
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.诊断
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.诊断
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.诊断
400
QuotaExceeded.InternetBandwidth
%s.诊断
400
InvalidOperation.InstanceTypeNotSupportRss
The ECS instance type does not support Rss.诊断
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.诊断
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.诊断
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诊断
403
InvalidOperation.Ipv6CountExceeded
%s诊断
403
InvalidOperation.Ipv6NotSupport
%s诊断
403
InvalidOperation.Ipv4NotSupport
%s诊断
403
InvalidOperation.InstanceWithEipNotSupport
The special instance with eip not support operate, please unassociate eip first.诊断
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.诊断
403
QuotaExceed.ElasticQuota
No additional quota is available for the specified ECS instance type.诊断
403
InvalidResourceType.NotSupported
%s诊断
403
InvalidOperation.NotAllowed
The specified vpc %s has enabled senior network feature.诊断
403
InvalidOperation.InstanceTypeNotSupportEniTrunking
%s诊断
403
InvalidOperation.MaxEniQueueNumberExceeded
%s诊断
403
InvalidOperation.ExceedInstanceTypeQueueNumber
%s诊断
403
InvalidParameter.InvalidEniQueueNumber
%s诊断
403
HibernationConfigured.InstanceOperationForbidden
The operation is not permitted due to limit of the hibernation configured instance.诊断
403
InvalidOperation.InstanceTypeNotSupportHighPerformanceTrafficMode
%s诊断
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.诊断
403
InvalidDataDiskCategory.ValueNotSupported
The specified Category of Data Disk is not valid.诊断
404
InvalidInstanceId.NotFound
The specified InstanceId does not exist.诊断
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.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断

变更历史

变更时间变更内容概要操作
2025-01-09
变更错误码400
2024-09-27
变更错误码400
2024-09-12
变更错误码403
2024-02-01
新增请求参数DryRun
2023-12-14
变更错误码400
2023-10-10
变更错误码400
  • 1
  • 2
  • 10 条/页

相关示例

本文介绍如果通过阿里云ECS SDK调用ModifyInstanceSpec变更一台按量付费ECS实例的实例规格,调用ModifyPrepayInstanceSpec变更一台包年包月ECS实例的实例规格。
2024-07-26
调用ModifyInstanceSpec调整一台按量付费ECS实例的实例规格和公网带宽大小。
2024-07-26