Queries the pricing information about newly attached subscription data disks or about the new instance types when you upgrade the configurations of unexpired subscription Elastic Compute Service (ECS) instances.
Operation description
- Pricing information can be queried for unexpired subscription ECS instances only when you upgrade their configurations. The pricing information cannot be queried when the instance configurations are downgraded.
- Pricing information cannot be queried for pay-as-you-go ECS instances when you change their configurations. Prices of existing pay-as-you-go ECS instances whose configurations are changed are the same as those of new pay-as-you-go instances. You can call the DescribePrice operation to query the latest prices of ECS instances.
- Before you upgrade the configurations of an instance, we recommend that you call the DescribeResourcesModification operation to query the instance types available for configuration upgrades in a specified zone.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:DescribeInstanceModificationPrice | get | *Instance acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
InstanceId | string | Yes | The ID of the instance for which you want to query pricing information for a configuration upgrade. | i-bp1f2o4ldh8l**** |
InstanceType | string | No | The new instance type. We recommend that you call the DescribeResourcesModification operation to query the instance types available for configuration upgrades in a specified zone. Note
When you call the DescribeInstanceModificationPrice operation, you must specify at least one of the following parameters: InstanceType and DataDisk.N.* .
| ecs.g6e.large |
SystemDisk.Category | string | No | The category of the system disk. You must specify this parameter 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 families and Retired instance types. Valid values:
This parameter is empty by default. | cloud_ssd |
DataDisk | array<object> | No | The information about data disks. | |
object | No | The information about the data disk. | ||
PerformanceLevel | string | No | The performance level of data disk N that is an enhanced SSD (ESSD). The value of N must be the same as that in
Default value: PL1. For more information about ESSD performance levels, see ESSDs . | PL1 |
Size | integer | No | The capacity of data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values:
The default value is the minimum capacity allowed for the specified data disk category. | 100 |
Category | string | No | The category of data disk N. You can specify this parameter if you want to query the pricing information about newly attached subscription data disks. Valid values of N: 1 to 16. Valid values:
This parameter is empty by default. Note
When you call the DescribeInstanceModificationPrice operation, you must specify at least one of the following parameters: InstanceType and DataDisk.N.* .
| cloud_essd |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "A3DC3196-379B-4F32-A2C5-B937134FAD8A",
"PriceInfo": {
"Rules": {
"Rule": [
{
"Description": "Upgrade offers\n",
"RuleId": 1234567890
}
]
},
"Price": {
"OriginalPrice": 175.2,
"DiscountPrice": 61.32,
"Currency": "CNY",
"TradePrice": 113.88
}
}
}
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. | - |
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. | - |
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 | InstanceType.Offline | %s | The operation is not supported while the instance type is retired or while resources of the instance type are insufficient. |
400 | RegionUnauthorized | %s | - |
400 | InvalidAction.WithActiveElasticUpgrade | The instance has active Elastic Upgrade. | The operation is not supported while the instance are being temporarily upgraded. The instance goes through a temporary configuration upgrade if the EndTime parameter is specified to call the ModifyPrepayInstanceSpec operation. |
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. |
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. | - |
404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | The RegionId provided does not exist |
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 instance does not exist. |
500 | InternalError | %s | An internal error has occurred. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|