ModifyPrepayInstanceSpec_云服务器 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 产品的收费方式、价格以及降配退款规则

本接口属于异步操作,等待约 5~10 秒后配置变更完成。升级或者降低包年包月 ECS 实例规格前,您可以通过 DescribeResourcesModification 查询当前实例支持变配的实例规格。

注意事项

  • 已过期实例无法修改实例规格,您可以续费后重新操作。

  • 降低实例规格:

    • 实例必须处于已停止Stopped)状态。
    • 降低前后的实例规格价格差退款会退还到您的原付费方式中,已使用的代金券不退回。
    • 变配后的实例规格需要启动实例后生效。
  • 升级实例规格:

    • 实例必须处于已停止Stopped)或者运行中Running)状态。
    • 变配后的实例规格需要启动实例或者重启实例后生效。

流控信息

请求速率为1000/60(s)。

授权信息

当前云产品暂无权限信息透出。

请求参数

字段名称字段详情
InstanceIdstring

实例 ID。

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

实例所属的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
InstanceTypestring

需要变配的目标实例规格。取值请参见实例规格族或者调用 DescribeInstanceTypes

示例值:ecs.g5.xlarge参考取值来源:
    DescribeInstanceTypes
    CreateInstance
OperatorTypestring

操作类型。取值范围:展开详情

示例值:upgrade
ClientTokenstring

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

示例值:123e4567-e89b-12d3-a456-426655440000
AutoPayboolean

升级实例规格时,是否自动支付。取值范围:展开详情

示例值:true
MigrateAcrossZoneboolean

是否支持跨集群升级实例规格。取值范围:展开详情

示例值:false
SystemDisk.Categorystring

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

示例值:cloud_efficiency
RebootTimestring

实例的重启时间。按照ISO 8601标准表示,使用 UTC+0 时间。格式为:yyyy-MM-ddTHH:mmZ。

示例值:2018-01-01T12:05Z
EndTimestring

临时变更的终止时间。按照ISO 8601标准表示,使用 UTC+0 时间。格式为:yyyy-MM-ddTHH:mmZ。

示例值:2018-01-01T12:05Z
RebootWhenFinishedboolean

实例变配结束后是否立即重启。取值范围:展开详情

示例值:false
ModifyModestring
说明 该参数暂未开放使用。
示例值:null枚举值:OnlineOffline
Diskarray<object>
说明 该参数暂未开放使用。
子级条数 <= 128

返回参数

字段名称字段详情
OrderIdstring

生成的订单 ID。

示例值:1234567890
RequestIdstring

请求 ID。

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

返回示例

错误返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidInstanceType.ValueUnauthorized
The specified InstanceType is not authorized.诊断
400
InvalidInstanceType.ValueNotSupported
The specified InstanceType does not exist or beyond the permitted range.诊断
400
InvalidBillingMethod.ValueNotSupported
The operation is not permitted due to an invalid billing method of the instance.诊断
400
InvalidInstance.PurchaseNotFound
The specified instance has no purchase history.诊断
400
InvalidInstance.UnpaidOrder
The specified instance has unpaid order.诊断
400
InvalidInstanceType.NotSupported
The specified InstanceType is not Supported.诊断
400
OrderCreationFailed
Order creation failed, please check your params and try it again later.诊断
400
Throttling
You have made too many requests within a short time; your request is denied due to request throttling.诊断
400
Account.Arrearage
Your account has an outstanding payment.诊断
400
InvalidInstanceId.NotFound
The specified InstanceId does not exist.诊断
400
InvalidRebootTime.MalFormed
The specified rebootTime is not valid.诊断
400
InvalidRebootTime.ValueNotSupported
The specified RebootTime is not valid.诊断
400
IdempotenceParamNotMatch
Request uses a client token in a previous request but is not identical to that request.诊断
400
InvalidInstanceChargeType.ValueNotSupported
%s诊断
400
InvalidStatus.NotStopped
Instance status must be stopped.诊断
400
InvalidAction
%s诊断
400
InstanceDowngrade.QuotaExceed
Quota of instance downgrade is exceed.诊断
400
InvalidParameter
%s诊断
400
OperationDenied
The current user does not support this operation.诊断
400
LastOrderProcessing
The previous order is still processing, please try again later.诊断
400
InvalidOperation.VpcHasEnabledAdvancedNetworkFeature
The specified vpc has enabled advanced network feature.诊断
400
InvalidAction.WithActiveElasticUpgrade
The instance has active Elastic Upgrade.诊断
400
InstanceTypeNotSupported.TooManyDisksAttached
%s诊断
400
QuotaExceed.DiskCapacity
The used capacity of disk type has exceeded the quota in the zone, %s.诊断
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
InvalidSystemDiskCategory.NotMatchInstanceType
The system disk category does not match the instance type.诊断
400
QuotaExceed.RufundVcpu
The maximum number of refunded vcpu is exceeded: %s .诊断
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
NoPermission.Refund
The operation requires refund permission. Please apply for permission from your main account.诊断
400
InvalidInstanceStatus
The current status of the instance does not support this operation.诊断
400
InvalidOperation.InstanceRenewWithDowngradeInPlan
The operation is denied due to the specified instance has renew with downgrade record in plan.诊断
400
InvalidOperation.OnlineModificationUnsupported
Online modification of instance type is not supported for the specified instance due to its CPU topology.诊断
403
OperationDenied.NoStock
The specified instance is out of usage.诊断
403
InvalidInstanceType.ValueNotSupported
The specified InstanceType does not exist or beyond the permitted range.诊断
403
InvalidUser.PassRoleForbidden
The RAM user does not have privilege to pass a role.诊断
403
ImageNotSupportInstanceType
The specified image does not support the specified InstanceType.诊断
403
InstanceType.Offline
%s诊断
403
IncorrectInstanceStatus
The current status of the resource does not support this operation.诊断
403
Throttling
You have made too many requests within a short time; your request is denied due to request throttling.诊断
403
InvalidParameter.InstanceId
%s诊断
403
OperationDenied
%s诊断
403
InvalidInstanceStatus
The current status of the instance does not support this operation.诊断
403
InvalidOperation.StarterPackage
StarterPackage not support modification.诊断
403
InvalidInstance.PreInstanceExpired
Instance business status is not Expired.诊断
403
InvalidInstance.EipNotSupport
The special instance with eip not support operate, please unassociate eip first.诊断
403
OperationDenied.ImageNotValid
The specified image is not authorized.诊断
403
OperationDenied.LocalDiskUnsupported
The configuration change is not allowed when the specified instance has local disks mounted.诊断
403
InvalidOperation.EniCountExceeded
%s诊断
403
InvalidOperation.Ipv4CountExceeded
%s诊断
403
InvalidOperation.Ipv6CountExceeded
%s诊断
403
InvalidOperation.Ipv6NotSupport
%s诊断
403
InvalidOperation.Ipv4NotSupport
%s诊断
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.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.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
OperationDenied.UnpaidOrder
The specified instance has unpaid order.诊断
403
InvalidDisk.DetachedSystemDisk
The specified resource is/has a detached system disk %s , not support current operation.诊断
403
InvalidDataDiskCategory.ValueNotSupported
The specified Category of Data Disk is not valid.诊断
404
InvalidRegionId.NotFound
The specified RegionId does not exist.诊断
404
BillingMethodNotFound
The account has not chosen any billing method.诊断
404
InvalidInstanceId.NotFound
The specified InstanceId does not exist.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断
500
ImageOrderFailed
Create marketplace image order failed.诊断

变更历史

变更时间变更内容概要操作
2024-10-14
变更错误码403
2023-12-14
变更错误码400
2023-10-18
变更错误码400
2023-07-28
变更错误码500
2023-07-21
变更错误码400
  • 1
  • 2
  • 10 条/页

相关示例

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