本介面用於修改一台包年包月 ECS 執行個體的執行個體規格,支援您升級或者降低執行個體規格,修改後的執行個體規格在執行個體整個生命週期內生效。
介面說明
請確保在使用該介面前,已充分了解 ECS 產品的收費方式、價格以及降配退款規則。
本介面屬於非同步操作,等待約 5~10 秒後配置變更完成。升級或者降低包年包月 ECS 執行個體規格前,您可以透過 DescribeResourcesModification 查詢當前執行個體支援變配的執行個體規格。
注意事項
-
如原執行個體規格到目標執行個體規格的 NVMe 屬性不一致( DescribelnstanceTypes 的
NvmeSupport欄位),且作業系統為 win( Describelnstances 的OStype欄位),則需要您參考預防措施完成操作後再進行變配。 -
已過期執行個體無法修改執行個體規格,您可以續費後重新操作。
-
降低執行個體規格:
執行個體必須處於已停止(
Stopped)狀態。降低前後的執行個體規格價格差退款會退還到您的原付費方式中,已使用的代金券不退回。
變配後的執行個體規格需要啟動執行個體後生效。
-
升級執行個體規格:
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:ModifyPrepayInstanceSpec |
update |
*Instance
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| InstanceId |
string |
是 |
執行個體 ID。 |
i-bp67acfmxazb4ph**** |
| RegionId |
string |
是 |
執行個體所屬的地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域列表。 |
cn-hangzhou |
| InstanceType |
string |
是 |
需要變配的目標執行個體規格。取值請參見執行個體規格族或者呼叫 DescribeInstanceTypes 。 |
ecs.g5.xlarge |
| OperatorType |
string |
否 |
操作類型。取值範圍: 說明
該參數可無需上傳,系統可自動判斷升配還是降配;如要上傳,請按照下面的邏輯規則操作。
說明
升級或降低執行個體規格的注意事項請參見上文介面說明章節。 |
upgrade |
| ClientToken |
string |
否 |
保證請求冪等性。從您的用戶端生成一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多資訊,請參見如何保證冪等性。 |
123e4567-e89b-12d3-a456-426655440000 |
| AutoPay |
boolean |
否 |
升級執行個體規格時,是否自動支付。取值範圍:
預設值:true。 說明
|
true |
| MigrateAcrossZone |
boolean |
否 |
是否支援跨叢集升級執行個體規格。取值範圍:
預設值:false。 當參數 專有網路 VPC 類型執行個體:對於已停售的執行個體規格,非 I/O 優化執行個體變配到 I/O 優化執行個體時,雲端伺服器磁碟裝置名和軟體授權碼會發生變化。Linux 執行個體的普通雲端硬碟(cloud)會被識別為 xvda 或者 xvdb 等,高效雲端硬碟(cloud_efficiency)和 SSD 雲端硬碟(cloud_ssd)會被識別為 vda 或者 vdb 等。 |
false |
| SystemDisk.Category |
string |
否 |
更換系統磁碟類型。取值範圍:
說明
該參數僅支援從已停售的執行個體規格升級到正常售賣的執行個體規格族,並將非 I/O 優化執行個體規格升級為 I/O 優化執行個體規格時有效。 |
cloud_efficiency |
| RebootTime |
string |
否 |
執行個體的重新啟動時間。按照ISO 8601標準表示,使用 UTC+0 時間。格式為:yyyy-MM-ddTHH:mmZ。 |
2018-01-01T12:05Z |
| EndTime |
string |
否 |
臨時變更的終止時間。按照ISO 8601標準表示,使用 UTC+0 時間。格式為:yyyy-MM-ddTHH:mmZ。 |
2018-01-01T12:05Z |
| RebootWhenFinished |
boolean |
否 |
執行個體變配結束後是否立即重新啟動。取值範圍:
預設值為 false。 說明
若執行個體處於已停止狀態,即使您設置了 |
false |
| ModifyMode |
string |
否 |
說明
該參數暫未開放使用。 |
null |
| Disk |
array<object> |
否 |
說明
該參數暫未開放使用。 |
|
|
object |
否 |
說明
該參數暫未開放使用。 |
||
| DiskId |
string |
否 |
說明
該參數暫未開放使用。 |
null |
| Category |
string |
否 |
說明
該參數暫未開放使用。 |
null |
| PerformanceLevel |
string |
否 |
說明
該參數暫未開放使用。 |
null |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| OrderId |
string |
生成的訂單 ID。 |
1234567890 |
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
樣本
正常返回樣本
JSON格式
{
"OrderId": "1234567890",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 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. | |
| 400 | InvalidInstanceType.NotSupportCpuOptionsNestedVirtualization | The specified instance type does not support CpuOptions.NestedVirtualization: %s. | |
| 401 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 500 | ImageOrderFailed | Create marketplace image order failed. | |
| 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. | |
| 403 | InvalidDiskCategory.NotSupported | The upgrade operation of instance does not support this category of disk. | |
| 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. | |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。