All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceModificationPrice

Last Updated:Nov 14, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeInstanceModificationPriceget
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
InstanceIdstringYes

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

i-bp1f2o4ldh8l****
InstanceTypestringNo

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

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.

cloud_ssd
DataDiskarray<object>No

The information about data disks.

objectNo

The information about the data disk.

PerformanceLevelstringNo

The performance level of data disk N that is an enhanced SSD (ESSD). The value of N 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 .

PL1
SizeintegerNo

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: vary based on the DataDisk.N.PerformanceLevel value.

    • Valid values when DataDisk.N.PerformanceLevel is set to PL0: 1 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.

100
CategorystringNo

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: utra 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.*.
cloud_essd

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

A3DC3196-379B-4F32-A2C5-B937134FAD8A
PriceInfoobject

Details about the prices and promotion rules.

Rulesarray<object>

The promotion rules.

Ruleobject
Descriptionstring

The description of the promotion rule.

Upgrade offers
RuleIdlong

The ID of the promotion rule.

1234567890
Priceobject

The price.

OriginalPricefloat

The original price.

175.200
DiscountPricefloat

The discount.

61.320
Currencystring

The currency unit.

Alibaba Cloud China site (aliyun.com): CNY

Alibaba Cloud International site (alibabacloud.com): USD

CNY
TradePricefloat

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

113.880

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400MissingParameter.InstanceTypeOrDataDiskYou must specify the parameter InstanceType or DataDisk.-
400InvalidSystemDiskCategory.ValueNotSupportedThe specified parameter "SystemDisk.Category" is not valid.-
400InvalidDiskCategory.MissingThe DataDisk.1.Category parameter that is mandatory for processing the request is not provided.The mandatory parameter DataDiskCategory is not provided.
400InvalidDataDiskCategory.ValueNotSupportedThe specified parameter "DataDisk.n.Category" is not valid.-
400InvalidDiskCategory.ValueNotSupportedThe specified parameter "DiskCategory" is not valid.-
400InvalidDataDiskSize.ValueNotSupportedThe specified DataDisk.n.Size beyond the permitted range.-
400InvalidPerformanceLevel.MalformedThe specified parameter DataDisk.n.PerformanceLevel is not valid.-
400InvalidDiskSize.TooSmallSpecified disk size is too small when choose PL0 of cloud_essd.-
400OperationDenied.PerformanceLevelNotMatchThe specified DataDisk.n.PerformanceLevel and DataDisk.n.Size do not match.-
400InvalidInstanceType.ValueNotSupportedThe 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.
400InstanceType.Offline%sThe operation is not supported while the instance type is retired or while resources of the instance type are insufficient.
400RegionUnauthorized%s-
400InvalidAction.WithActiveElasticUpgradeThe 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.
400PriceNotFoundThe 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.
403InvalidParameter.ResourceOwnerAccountResourceOwnerAccount is Invalid.The specified ResourceOwnerAccount parameter is invalid.
403ChargeTypeViolationPostPaid instance do not support this operation.-
403InvalidInstanceType.NotSupportUpgradeThe 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.
403InstanceExpiredThe PrePaid instance has been expired.-
403Throttling.UserRequest was denied due to user flow control.-
403ThrottlingRequest was denied due to request throttling.-
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId provided does not exist
404InvalidResourceGroup.NotFoundThe ResourceGroup provided does not exist in our records.The specified resource group does not exist.
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.
500InternalError%sAn internal error has occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history