Retrieves the pricing for upgrading an active subscription ECS instance to a target instance type and for adding a subscription data disk.
Operation description
You can query pricing for upgrading unexpired subscription ECS instances, but not for downgrading them.
You cannot query prices for resizing pay-as-you-go ECS instances. Because a resized instance is priced the same as a new one, call DescribePrice to get the current price.
Before upgrading an instance, call DescribeResourcesModification to find the instance types available for an upgrade in a specific availability 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 the DescribeRegions operation to get the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| InstanceId |
string |
Yes |
The ID of the instance for which to query the modification price. |
i-bp1f2o4ldh8l**** |
| InstanceType |
string |
No |
The target instance type for the instance upgrade. Call the DescribeResourcesModification operation to query the instance types available for upgrade in the specified availability zone. Note
You must specify at least one of the |
ecs.g6e.large |
| SystemDisk.Category |
string |
No |
The category of the system disk. This parameter is required only when you upgrade a non-I/O optimized instance of a retired instance type to an I/O optimized instance of an available instance type. For more information about instance types, see instance family and retired instance types. Valid values:
Default value: None. |
cloud_ssd |
| DataDisk |
array<object> |
No |
||
|
object |
No |
|
||
| PerformanceLevel |
string |
No |
|
PL1 |
| Size |
integer |
No |
cloud_efficiency (Ultra Disk): 20 to 32768.
- cloud_ssd (Standard SSD): 20 to 32768.
- cloud_essd: The value range varies based on the value of DataDisk.N.PerformanceLevel.
- PL0: 1 to 32768.
- PL1: 20 to 32768.
- PL2: 461 to 32768.
- PL3: 1261 to 32768.
- cloud (Basic Disk): 5 to 2000.
Default value: The minimum size supported by the specified data disk category. |
100 |
| Category |
string |
No |
- cloud_efficiency: Ultra Disk- cloud_ssd: Standard SSD- cloud_essd: ESSD- cloud: Basic DiskDefault value: None. |
cloud_essd |
| DiskId |
string |
No |
d-bf4rupt9**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
A3DC3196-379B-4F32-A2C5-B937134FAD8A |
| PriceInfo |
object |
Price information, including price details and promotional rules. |
|
| Rules |
object |
||
| Rule |
array<object> |
A list of promotional rules. |
|
|
object |
|||
| Description |
string |
The description of the rule. |
升级优惠 |
| RuleId |
integer |
The rule ID. |
1234567890 |
| Price |
object |
The price details. |
|
| OriginalPrice |
number |
The original price. |
175.200 |
| DiscountPrice |
number |
The discount amount. |
61.320 |
| Currency |
string |
The currency. Valid values:
|
CNY |
| TradePrice |
number |
The final price (original price - discount). |
113.880 |
| DetailInfos |
object |
||
| DetailInfo |
array<object> |
A list of price details for each resource in the configuration. Note
This parameter is returned only when |
|
|
array<object> |
Price details for a single resource. |
||
| Resource |
string |
The resource type. Valid values:
|
instanceType |
| OriginalPrice |
number |
The original price. |
4368 |
| DiscountPrice |
number |
The discount amount. |
655.2 |
| TradePrice |
number |
The final price. |
3712.8 |
| SubRules |
object |
||
| Rule |
array<object> |
Pricing rule subsets. |
|
|
object |
A single pricing rule subset. |
||
| Description |
string |
The rule subset description. |
买满1年,立享官网价格8.5折优惠 |
| RuleId |
integer |
The rule ID. |
315716429631488 |
| RelatedPrice |
object |
||
| MarketplaceImagePrice |
object |
||
| Currency |
string |
CNY |
|
| OriginalPrice |
number |
100 |
|
| DiscountPrice |
number |
0 |
|
| TradePrice |
number |
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. | |
| 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. | |
| 400 | InvalidPerformanceLevel.Malformed | The specified parameter DataDisk.n.PerformanceLevel is not valid. | |
| 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. | 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. |
| 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. | |
| 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. |
| 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.