Queries the price of upgrading an unexpired subscription ECS instance to a target instance type and the price of adding subscription data disks.
Operation description
Only supports querying the price information for upgrading unexpired subscription ECS instances. Querying the price information for downgrading instances is not supported.
Does not support querying the price information for changing the specifications of pay-as-you-go ECS instances. Because the price of a pay-as-you-go ECS instance after a specification change is the same as the price of a new instance, you can directly call DescribePrice to query the latest price of an ECS instance.
Before upgrading an instance, call DescribeResourcesModification to query the instance types available for upgrade in a specified zone.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeInstanceModificationPrice |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| InstanceId |
string |
Yes |
The instance ID of the instance for which you want to query the upgrade price. |
i-bp1f2o4ldh8l**** |
| InstanceType |
string |
No |
The target instance type for the upgrade. We recommend that you call DescribeResourcesModification to query the instance types available for upgrade in a specified zone. |
ecs.g6e.large |
| SystemDisk.Category |
string |
No |
The category of the system disk. You need to specify this parameter only when you upgrade from a retired instance type to an available instance type and upgrade from a non-I/O optimized instance type to an I/O optimized instance type. For more information about instance types, see Instance families and Retired instance types. Valid values:
Default value: null. |
cloud_ssd |
| SystemDisk |
object |
No |
The system disk modification settings. |
|
| Category |
string |
No |
The category of the system disk. |
|
| PerformanceLevel |
string |
No |
The performance level (PL) of the system disk. |
PL0 |
| Size |
integer |
No |
The size of the system disk. |
40 |
| DataDisk |
array<object> |
No |
The information about data disk types. |
|
|
object |
No |
The information about data disk types. |
||
| PerformanceLevel |
string |
No |
The performance level of the data disk when the disk type is enterprise SSD. The value of N must be the same as that in
Default value: PL1. For information about how to select an ESSD performance level, see ESSD. |
PL1 |
| Size |
integer |
No |
The capacity of the data disk. Valid values of N: 1 to 16. Unit: GiB. Valid values:
Default value: the minimum capacity for the specified data disk type. |
100 |
| Category |
string |
No |
The type of the data disk. Specify this parameter to query the price of a new subscription data disk attached to an ECS instance. Valid values of N: 1 to 16. Valid values:
Default value: null. Note
When you call this operation, the instance type parameter ( |
cloud_essd |
| DiskId |
string |
No |
The ID of the data disk. |
d-bf4rupt9**** |
| ImageId |
string |
No |
The image ID. |
aliyun_2_1903_x64_20G_alibase_20200324.vhd |
| InternetMaxBandwidthOut |
integer |
No |
The maximum outbound public bandwidth. |
10 |
| ISP |
string |
No |
The Internet Service Provider. |
BGP |
| InternetChargeType |
string |
No |
The network billing method to convert to. |
PayByTraffic |
| StartTime |
string |
No |
The start time of the temporary bandwidth upgrade. |
2025-12-05T22:40Z |
| EndTime |
string |
No |
The end time of the temporary bandwidth upgrade. |
2025-12-06T22Z |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
A3DC3196-379B-4F32-A2C5-B937134FAD8A |
| PriceInfo |
object |
The price information, including the price and discount rule details. |
|
| Rules |
object |
||
| Rule |
array<object> |
The promotion rule. |
|
|
object |
|||
| Description |
string |
The description of the promotion rule. |
Upgrade discount |
| RuleId |
integer |
The ID of the promotion. |
1234567890 |
| Price |
object |
The price. |
|
| OriginalPrice |
number |
The original price. |
175.200 |
| DiscountPrice |
number |
The discount. |
61.320 |
| Currency |
string |
The currency unit. Valid values: |
CNY |
| TradePrice |
number |
The transaction price, which is the original price minus the discount. |
113.880 |
| DetailInfos |
object |
||
| DetailInfo |
array<object> |
The price details of the configuration. |
|
|
array<object> |
The price details of the configuration. |
||
| Resource |
string |
The name of the configuration. Valid values: |
instanceType |
| OriginalPrice |
number |
The original price. |
4368 |
| DiscountPrice |
number |
The discount price. |
655.2 |
| TradePrice |
number |
The transaction price. |
3712.8 |
| SubRules |
object |
||
| Rule |
array<object> |
The pricing rule subset. |
|
|
object |
The pricing rule subset. |
||
| Description |
string |
The description of the rule subset. |
15% discount for a one-year subscription |
| RuleId |
integer |
The ID of the promotion rule. |
315716429631488 |
| RelatedPrice |
object |
The related price. |
|
| MarketplaceImagePrice |
object |
The Alibaba Cloud Marketplace image price. |
|
| Currency |
string |
The currency unit. |
CNY |
| OriginalPrice |
number |
The original price. |
100 |
| DiscountPrice |
number |
The discount. |
0 |
| TradePrice |
number |
The transaction price, which is the original price minus the discount. |
100 |
Examples
Success response
JSON format
{
"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
}
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter.InstanceTypeOrDataDisk | You must specify the parameter InstanceType or DataDisk. | Either the instance type or data disk parameters must be specified. Both cannot be empty. |
| 400 | InvalidSystemDiskCategory.ValueNotSupported | The specified parameter "SystemDisk.Category" is not valid. | The specified parameter system disk specification is invalid. |
| 400 | InvalidDiskCategory.Missing | The DataDisk.1.Category parameter that is mandatory for processing the request is not provided. | The mandatory parameter DataDiskCategory 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. | The specified cloud disk type DiskCategory is invalid. |
| 400 | InvalidDataDiskSize.ValueNotSupported | The specified DataDisk.n.Size beyond the permitted range. | The specified disk size exceeds the allowed range, or the snapshot size exceeds the size limit of the specified disk category. |
| 400 | InvalidPerformanceLevel.Malformed | The specified parameter DataDisk.n.PerformanceLevel is not valid. | The specified PerformanceLevel parameter for the data disk is invalid. |
| 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. | The specified data disk performance level does not match the data disk size. |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | The specified instance type does not exist or you are not authorized to manage instances of this instance type. |
| 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. | The price of the specified resource does not exist. Modify the parameter value and try again later. |
| 400 | InvalidBandwidth.ValueNotSupported | Instance upgrade bandwidth of temporary not allow less then existed. | The bandwidth value specified for the downgrade operation must be less than the baseline bandwidth value. |
| 400 | InvalidParameter.InstanceTypeAndNetworkConflict | The current operation does not allow both InstanceType and network modification parameter to be set. | The instance type and network change parameters cannot be set at the same time for the current request. |
| 400 | InvalidParameter.InstanceTypeAndImageConflict | The current operation does not allow both InstanceType and ImageId parameter to be set. | The current request cannot set InstanceType and ImageId parameters at the same time. |
| 400 | InvalidParameter.InstanceTypeAndDiskConflict | The current operation does not allow both InstanceType and Disk parameter to be set. | The InstanceType and Disk parameters cannot be set at the same time in the current request. |
| 400 | InvalidParameter.NetworkAndImageConflict | The current operation does not allow both network modification parameter and ImageId to be set. | The current request cannot set network changes and ImageId parameters at the same time. |
| 400 | InvalidParameter.NetworkAndDiskConflict | The current operation does not allow both network modification parameter and disk parameter to be set. | The current request cannot set the network change and the Disk parameter at the same time. |
| 400 | InvalidParameter.ImageAndDiskConflict | The current operation does not allow both ImageId and DataDisk parameter to be set. | The ImageId and Disk parameters cannot be specified at the same time in the current request. |
| 400 | InvalidParameter.CategoryAndSizeConflict | The current operation does not allow both Category and Size parameter to be set. | The Category and Size parameters cannot be specified at the same time in the current request. |
| 400 | MissingParameter.Instance | The instance modification parameter can not be empty. | The parameter of the instance configuration cannot be empty. |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error has occurred. Try again later. |
| 403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | The specified ResourceOwnerAccount parameter is invalid. |
| 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. | The specified instance type can be used only for a configuration downgrade of the specified instance, and this API operation can be used to query pricing information about instance types only for instance configuration upgrades. We recommend that you call the DescribeResourcesModification operation to query the instance types available for instance configuration upgrades. |
| 403 | InstanceExpired | The PrePaid instance has been expired. | The specified subscription instance has 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 | The specified instance type is retired. Select another instance type. |
| 403 | RegionUnauthorized | There is no authority to create instance in the specified region. | You are not authorized to create instances in the specified region. |
| 403 | InvalidSystemDiskCategory.ValueNotSupported | The specified parameter SystemDisk.Category is not valid. | The specified SystemDisk.Category value is not supported. |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The specified Category of Data Disk is not valid. | The specified data disk type is not supported. |
| 403 | OperationDenied.PerformanceLevelNotMatch | The specified PerformanceLevel and disk size do not match. | The specified performance level and disk size do not match. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | The specified resource group does not exist. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.