查詢未到期的包年包月 ECS 執行個體升級配置時目標執行個體規格的價格資訊、新增包年包月資料磁碟的價格資訊。
介面說明
僅支援查詢未到期的包年包月 ECS 執行個體升級配置的價格資訊,暫不支援查詢執行個體降級配置的價格資訊。
不支援查詢隨選付費 ECS 執行個體變更配置時的價格資訊。由於隨選付費 ECS 執行個體變更配置後的價格與新購執行個體的價格一致,因此您可以直接呼叫 DescribePrice 查詢 ECS 執行個體的最新價格。
執行個體升級配置前,建議您先呼叫 DescribeResourcesModification 查詢指定可用區內可升級配置的執行個體規格資訊。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:DescribeInstanceModificationPrice |
get |
*Instance
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域清單。 |
cn-hangzhou |
| InstanceId |
string |
是 |
需要查詢升級配置價格的執行個體 ID。 |
i-bp1f2o4ldh8l**** |
| InstanceType |
string |
否 |
執行個體升級配置的目標執行個體規格。建議您先呼叫 DescribeResourcesModification 查詢指定可用區內可升級配置的執行個體規格資訊。 說明
查詢時,執行個體規格參數( |
ecs.g6e.large |
| SystemDisk.Category |
string |
否 |
系統磁碟類型。僅當從已停售的執行個體規格升級至在售執行個體規格,並將非 I/O 最佳化執行個體規格升級為 I/O 最佳化執行個體規格時,才需要傳入參數值。關於執行個體規格的更多資訊,請參閱執行個體規格族以及已停售的執行個體規格。 取值範圍:
預設值:無。 |
cloud_ssd |
| SystemDisk |
object |
否 |
修改系統磁碟。 |
|
| Category |
string |
否 |
系統磁碟類型。 |
|
| PerformanceLevel |
string |
否 |
系統磁碟效能等級。 |
PL0 |
| Size |
integer |
否 |
系統磁碟大小。 |
40 |
| DataDisk |
array<object> |
否 |
資料磁碟類型資訊。 |
|
|
object |
否 |
資料磁碟類型資訊。 |
||
| PerformanceLevel |
string |
否 |
當資料磁碟類型為 ESSD 雲端硬碟時,設定雲端硬碟的效能等級。N 的取值必須和
預設值:PL1。 有關如何選擇 ESSD 效能等級,請參見ESSD 雲端硬碟。 |
PL1 |
| Size |
integer |
否 |
資料磁碟的容量大小。N 的取值範圍:1~16,記憶體單位為 GiB。取值範圍:
預設值:指定資料磁碟類型相應的容量大小的最小值。 |
100 |
| Category |
string |
否 |
資料磁碟類型。當您需要查詢 ECS 執行個體掛載的新包年包月資料磁碟的價格時,可以傳入該參數值。N 的取值範圍:1~16。取值範圍:
預設值:無。 說明
查詢時,執行個體規格參數( |
cloud_essd |
| DiskId |
string |
否 |
資料磁碟 ID。 |
d-bf4rupt9**** |
| ImageId |
string |
否 |
映像 ID。 |
aliyun_2_1903_x64_20G_alibase_20200324.vhd |
| InternetMaxBandwidthOut |
integer |
否 |
公網出方向頻寬最大值。 |
10 |
| ISP |
string |
否 |
網路營運商。 |
BGP |
| InternetChargeType |
string |
否 |
轉換網路計費方式。 |
PayByTraffic |
| StartTime |
string |
否 |
臨時頻寬變更開始時間。 |
2025-12-05T22:40Z |
| EndTime |
string |
否 |
臨時頻寬變更結束時間。 |
2025-12-06T22Z |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
A3DC3196-379B-4F32-A2C5-B937134FAD8A |
| PriceInfo |
object |
價格資訊類型(PriceInfo)組成的資料類型,包括價格和優惠規則資訊。 |
|
| Rules |
object |
||
| Rule |
array<object> |
活動規則。 |
|
|
object |
|||
| Description |
string |
活動規則描述。 |
升級優惠 |
| RuleId |
integer |
活動 ID。 |
1234567890 |
| Price |
object |
價格。 |
|
| OriginalPrice |
number |
原價。 |
175.200 |
| DiscountPrice |
number |
折扣。 |
61.320 |
| Currency |
string |
貨幣單位。可能值: |
CNY |
| TradePrice |
number |
最終價,為原價減去折扣。 |
113.880 |
| DetailInfos |
object |
||
| DetailInfo |
array<object> |
配置明細價格資訊。 |
|
|
array<object> |
配置明細價格資訊。 |
||
| Resource |
string |
配置名稱。可能值: |
instanceType |
| OriginalPrice |
number |
原價。 |
4368 |
| DiscountPrice |
number |
折扣價。 |
655.2 |
| TradePrice |
number |
成交價。 |
3712.8 |
| SubRules |
object |
||
| Rule |
array<object> |
定價規則子集。 |
|
|
object |
定價規則子集。 |
||
| Description |
string |
規則子集描述。 |
買滿1年,立享官網價格8.5折優惠 |
| RuleId |
integer |
活動規則 ID。 |
315716429631488 |
| RelatedPrice |
object |
關聯價格。 |
|
| MarketplaceImagePrice |
object |
市場映像價格。 |
|
| Currency |
string |
貨幣單位。 |
CNY |
| OriginalPrice |
number |
原價。 |
100 |
| DiscountPrice |
number |
優惠折扣。 |
0 |
| TradePrice |
number |
最終價,為原價減去優惠折扣。 |
100 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "A3DC3196-379B-4F32-A2C5-B937134FAD8A",
"PriceInfo": {
"Rules": {
"Rule": [
{
"Description": "升级优惠",
"RuleId": 1234567890
}
]
},
"Price": {
"OriginalPrice": 175.2,
"DiscountPrice": 61.32,
"Currency": "CNY",
"TradePrice": 113.88,
"DetailInfos": {
"DetailInfo": [
{
"Resource": "instanceType",
"OriginalPrice": 4368,
"DiscountPrice": 655.2,
"TradePrice": 3712.8,
"SubRules": {
"Rule": [
{
"Description": "买满1年,立享官网价格8.5折优惠",
"RuleId": 315716429631488
}
]
}
}
]
}
},
"RelatedPrice": {
"MarketplaceImagePrice": {
"Currency": "CNY",
"OriginalPrice": 100,
"DiscountPrice": 0,
"TradePrice": 100
}
}
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | MissingParameter.InstanceTypeOrDataDisk | You must specify the parameter InstanceType or DataDisk. | 執行個體規格和資料磁碟參數二擇一必須傳遞一個,不能都為空。 |
| 400 | InvalidSystemDiskCategory.ValueNotSupported | The specified parameter "SystemDisk.Category" is not valid. | 指定的參數系統磁碟規格無效。 |
| 400 | InvalidDiskCategory.Missing | The DataDisk.1.Category parameter that is mandatory for processing the request is not provided. | 沒有指定資料磁碟類型。 |
| 400 | InvalidDataDiskCategory.ValueNotSupported | The specified parameter "DataDisk.n.Category" is not valid. | |
| 400 | InvalidDiskCategory.ValueNotSupported | The specified parameter "DiskCategory" is not valid. | 指定資源上的磁碟類型不支援此操作。 |
| 400 | InvalidDataDiskSize.ValueNotSupported | The specified DataDisk.n.Size beyond the permitted range. | 指定的磁碟大小超出了允許的範圍,或者快照的容量超過了指定磁碟類別的大小限制。 |
| 400 | InvalidPerformanceLevel.Malformed | The specified parameter DataDisk.n.PerformanceLevel is not valid. | 指定資料磁碟的參數 PerformanceLevel 無效。 |
| 400 | InvalidDiskSize.TooSmall | Specified disk size is too small when choose PL0 of cloud_essd. | |
| 400 | OperationDenied.PerformanceLevelNotMatch | The specified DataDisk.n.PerformanceLevel and DataDisk.n.Size do not match. | 指定的資料磁碟效能等級與資料磁碟大小不相符。 |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 指定的執行個體規格不支援目前執行個體掛載的資料磁碟規格。 |
| 400 | InvalidAction.WithActiveElasticUpgrade | The instance has active Elastic Upgrade. | |
| 400 | PriceNotFound | The price of your queried resource is not available now, please try other resources. | 未找到價格,請修改相應的參數值後重試。 |
| 400 | InvalidBandwidth.ValueNotSupported | Instance upgrade bandwidth of temporary not allow less then existed. | 降配操作指定的頻寬值應該小於基礎頻寬值。 |
| 400 | InvalidParameter.InstanceTypeAndNetworkConflict | The current operation does not allow both InstanceType and network modification parameter to be set. | 目前請求不能同時設定執行個體規格和網路變更參數。 |
| 400 | InvalidParameter.InstanceTypeAndImageConflict | The current operation does not allow both InstanceType and ImageId parameter to be set. | 目前請求不能同時設定 InstanceType 和 ImageId 參數。 |
| 400 | InvalidParameter.InstanceTypeAndDiskConflict | The current operation does not allow both InstanceType and Disk parameter to be set. | 目前請求不能同時設定 InstanceType 和 Disk 參數。 |
| 400 | InvalidParameter.NetworkAndImageConflict | The current operation does not allow both network modification parameter and ImageId to be set. | 目前請求不能同時設定網路變更和 ImageId 參數。 |
| 400 | InvalidParameter.NetworkAndDiskConflict | The current operation does not allow both network modification parameter and disk parameter to be set. | 目前請求不能同時設定網路變更和 Disk 參數。 |
| 400 | InvalidParameter.ImageAndDiskConflict | The current operation does not allow both ImageId and DataDisk parameter to be set. | 目前請求不能同時設定 ImageId 和 Disk 參數。 |
| 400 | InvalidParameter.CategoryAndSizeConflict | The current operation does not allow both Category and Size parameter to be set. | 目前請求不能同時設定 Category 和 Size 參數。 |
| 400 | MissingParameter.Instance | The instance modification parameter can not be empty. | 執行個體變更規格的參數不能為空。 |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 傳送請求時發生錯誤,請稍後重試。 |
| 403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | 指定的 ResourceOwnerAccount 不合法。 |
| 403 | ChargeTypeViolation | PostPaid instance do not support this operation. | |
| 403 | InvalidInstanceType.NotSupportUpgrade | The specified InstanceType can only be downgraded. This API supports querying prices only of InstanceType that can be upgraded. | 指定的執行個體規格為降配的規格,該 API 僅支援查詢升配的執行個體規格的價格。建議您透過 DescribeResourcesModification 介面取得可升配的執行個體規格。 |
| 403 | InstanceExpired | The PrePaid instance has been expired. | 指定的預付費執行個體已經過期。 |
| 403 | Throttling.User | Request was denied due to user flow control. | |
| 403 | Throttling | Request was denied due to request throttling. | |
| 403 | InstanceType.Offline | The specified InstanceType has been offline | 指定的執行個體規格已下線。 |
| 403 | RegionUnauthorized | There is no authority to create instance in the specified region. | 在指定的地域內沒有建立私有池的權限。 |
| 403 | InvalidSystemDiskCategory.ValueNotSupported | The specified parameter SystemDisk.Category is not valid. | 指定的參數系統磁碟規格無效。 |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The specified Category of Data Disk is not valid. | 指定參數 DataDisk.Category 錯誤。 |
| 403 | OperationDenied.PerformanceLevelNotMatch | The specified PerformanceLevel and disk size do not match. | 指定的資料磁碟效能等級與資料磁碟大小不相符。 |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | 地域資訊錯誤。 |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | 找不到對應的資源群組。 |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的執行個體 ID 無效。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。