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.

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeInstanceModificationPrice

The operation that you want to perform. Set the value to DescribeInstanceModificationPrice.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

InstanceId String Yes i-bp1f2o4ldh8l****

The ID of the instance for which you want to query pricing information for a configuration upgrade.

InstanceType String No ecs.g6e.large

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.*.
SystemDisk.Category String No cloud_ssd

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:

  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD

This parameter is empty by default.

DataDisk.N.PerformanceLevel String No PL1

The performance level of data disk N that is an enhanced SSD (ESSD). The N value must be the same as that in DataDisk.N.Category when DataDisk.N.Category is set to cloud_essd. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Default value: PL1.

For more information about ESSD performance levels, see ESSDs.

DataDisk.N.Size Integer No 100

The capacity of data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values:

  • Valid values when DataDisk.N.Category is set to cloud_efficiency: 20 to 32768.
  • Valid values when DataDisk.N.Category is set to cloud_ssd: 20 to 32768.
  • Valid values when DataDisk.N.Category is set to cloud_essd: depend on the DataDisk.N.PerformanceLevel value.
    • Valid values when DataDisk.N.PerformanceLevel is set to PL0: 40 to 32768.
    • Valid values when DataDisk.N.PerformanceLevel is set to PL1: 20 to 32768.
    • Valid values when DataDisk.N.PerformanceLevel is set to PL2: 461 to 32768.
    • Valid values when DataDisk.N.PerformanceLevel is set to PL3: 1261 to 32768.
  • Valid values when DataDisk.N.Category is set to cloud: 5 to 2000.

The default value is the minimum capacity allowed for the specified data disk category.

DataDisk.N.Category String No cloud_essd

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:

  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
  • cloud: basic disk

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.*.

Response parameters

Parameter Type Example Description
RequestId String A3DC3196-379B-4F32-A2C5-B937134FAD8A

The ID of the request.

PriceInfo Object

Details about the prices and discount rules.

Rules Array of Rule

Details about the promotion rules.

Rule
Description String Upgrade offers

The description of the promotion rule.

RuleId Long 1234567890

The ID of the promotion rule.

Price Object

The price.

OriginalPrice Float 175.200

The original price.

DiscountPrice Float 61.320

The discount.

Currency String CNY

The currency unit.

Alibaba Cloud China site (aliyun.com): CNY.

Alibaba Cloud International site (alibabacloud.com): USD.

TradePrice Float 113.880

The transaction price, which is equal to the original price minus the discount.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeInstanceModificationPrice
&RegionId=cn-hangzhou
&InstanceId=i-bp1f2o4ldh8l****
&InstanceType=ecs.g6e.large
&SystemDisk.Category=cloud_ssd
&DataDisk=[{"PerformanceLevel":"PL1","Size":100,"Category":"cloud_essd"}]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeInstanceModificationPriceResponse>
    <RequestId>A3DC3196-379B-4F32-A2C5-B937134FAD8A</RequestId>
    <PriceInfo>
        <Rules>
            <Rule>
                <Description>Upgrade offers</Description>
                <RuleId>1234567890</RuleId>
            </Rule>
        </Rules>
        <Price>
            <OriginalPrice>175.200</OriginalPrice>
            <Currency>CNY</Currency>
            <DiscountPrice>61.320</DiscountPrice>
            <TradePrice>113.880</TradePrice>
        </Price>
    </PriceInfo>
</DescribeInstanceModificationPriceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "A3DC3196-379B-4F32-A2C5-B937134FAD8A",
  "PriceInfo" : {
    "Rules" : {
      "Rule" : [ {
        "Description": "Upgrade offers",
        "RuleId" : "1234567890"
      } ]
    },
    "Price" : {
      "OriginalPrice" : "175.200",
      "Currency" : "CNY",
      "DiscountPrice" : "61.320",
      "TradePrice" : "113.880"
    }
  }
}

Error codes

HttpCode Error codes Error message Description
400 MissingParameter.InstanceTypeOrDataDisk You must specify the parameter InstanceType or DataDisk. The error message returned because InstanceType and disk-related parameters (DataDisk.N.*) are all empty.
400 InvalidSystemDiskCategory.ValueNotSupported The specified parameter "SystemDisk.Category" is not valid. The error message returned because the specified SystemDisk.Category parameter is invalid.
400 InvalidDiskCategory.Missing The DataDisk.1.Category parameter that is mandatory for processing the request is not provided. The error message returned because the data disk category is not specified.
400 InvalidDataDiskCategory.ValueNotSupported The specified parameter "DataDisk.n.Category" is not valid. The error message returned because the specified DataDisk.N.Category parameter is invalid.
400 InvalidDiskCategory.ValueNotSupported The specified parameter "DiskCategory" is not valid. The error message returned because the specified SystemDisk.Category parameter is invalid.
400 InvalidInstanceType.ValueNotSupported The specified InstanceType does not exist or beyond the permitted range. The error message returned because the specified InstanceType parameter does not exist or because you are not authorized to manage instances of the specified instance type.
400 InstanceType.Offline %s The error message returned because the operation is not supported while the instance type is retired or while resources of the instance type are insufficient.
400 RegionUnauthorized %s The error message returned because you are not authorized to perform the operation in the specified region. %s is a variable. An error message is dynamically returned based on call conditions.
400 InvalidAction.WithActiveElasticUpgrade The instance has active Elastic Upgrade. The error message returned because the operation is not supported while the configurations of the instance are being temporarily upgraded. The configurations of the instance go through a temporary upgrade if the ModifyPrepayInstanceSpec operation is called with EndTime set.
400 PriceNotFound The price of your queried resource is not available now, please try other resources. The error message returned because the price of the specified resource is not found. Modify the parameter value and try again later.
403 InvalidParameter.ResourceOwnerAccount ResourceOwnerAccount is Invalid. The error message returned because the specified ResourceOwnerAccount parameter is invalid.
403 ChargeTypeViolation PostPaid instance do not support this operation. The error message returned because this operation cannot be used to query pricing information for configuration changes of pay-as-you-go ECS instances.
403 InvalidInstanceType.NotSupportUpgrade The specified InstanceType can only be downgraded. This API supports querying prices only of InstanceType that can be upgraded. The error message returned because the specified instance type can be used only for a configuration downgrade of the specified instance and this operation can be used to query pricing information 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 error message returned because the operation is not supported for expired instances.
403 Throttling Request was denied due to request throttling. The error message returned because the request is denied due to throttling. Try again later.
404 InvalidResourceGroup.NotFound The ResourceGroup provided does not exist in our records. The error message returned because the specified resource group does not exist.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The error message returned because the specified InstanceId parameter does not exist.
500 InternalError %s The error message returned because an internal error has occurred.

For a list of error codes, visit the API Error Center.