(Under internal preview) You can call this operation to query the most recent prices of ECS resources.

Description

You need to submit ticket to apply for using the inquiry function. Otherwise, an InvalidAction error will be reported.

  • The required parameters vary with the resource types of which prices you are querying.
    • If you set the value of the ResourceType parameter to instance, you must also specify InstanceType.
    • If you set the value of the ResourceType parameter to be disk, you must also specify the DataDisk.1.Category and DataDisk.1.Size parameters. When you query the price of a disk, only the pay-as-you-go price of the disk is returned, that is, the PriceUnit parameter can only be set to Hour.
    • If you query the price of the bandwidth resource, only the pay-by-traffic (PayByTraffic) price is returned.
  • If you set the value of the ResourceType parameter to instance, you can query the price of a maximum of four data disks.

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 of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
RegionId String Yes cn-hangzhou

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

Action String No DescribePrice

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

Amount Integer No 1

The number of ECS instances that you want to purchase. You can specify this parameter when you want to query the prices of multiple instances with certain specifications. Valid values: 1 to 1000.

Default value: 1.

DataDisk.1.Category String No cloud_ssd

The category of the first data disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: enhanced SSD
DataDisk.1.PerformanceLevel String No PL1

The performance level of the first data disk when it is an enhanced SSD. Only when DataDisk.1.Category=cloud_essd, this parameter is valid. Valid values:

  • Default value: PL1
  • PL2
  • PL3
DataDisk.1.Size Integer No 2000

The size of the first data disk. Unit: GiB. Valid values:

  • cloud: 5 to 2000
  • cloud_efficiency: 20 to 32768
  • cloud_ssd: 20 to 32768
  • cloud_essd: 20 to 32768
  • ephemeral_ssd: 5 to 800
DataDisk.2.Category String No cloud_ssd

The category of the second data disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: enhanced SSD
DataDisk.2.PerformanceLevel String No PL1

The performance level of the second data disk when it is an enhanced SSD. Only when DataDisk.2.Category=cloud_essd, this parameter is valid. Valid values:

  • Default value: PL1
  • PL2
  • PL3
DataDisk.2.Size Integer No 200

The size of the second data disk. Unit: GiB. Valid values:

  • cloud: 5 to 2000
  • cloud_efficiency: 20 to 32768
  • cloud_ssd: 20 to 32768
  • cloud_essd: 20 to 32768
  • ephemeral_ssd: 5 to 800
DataDisk.3.Category String No cloud_ssd

The category of the third data disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: enhanced SSD
DataDisk.3.PerformanceLevel String No PL1

The performance level of the third data disk when it is an enhanced SSD. Only when DataDisk.3.Category=cloud_essd, this parameter is valid. Valid values:

  • Default value: PL1
  • PL2
  • PL3
DataDisk.3.Size Integer No 2000

The size of the third data disk. Unit: GiB. Valid values:

  • cloud: 5 to 2000
  • cloud_efficiency: 20 to 32768
  • cloud_ssd: 20 to 32768
  • cloud_essd: 20 to 32768
  • ephemeral_ssd: 5 to 800
DataDisk.4.Category String No cloud_ssd

The category of the fourth data disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: enhanced SSD
DataDisk.4.PerformanceLevel String No PL1

The performance level of the fourth data disk when it is an ESSD. Only when DataDisk.4.Category=cloud_essd, this parameter is valid. Valid values:

  • Default value: PL1
  • PL2
  • PL3
DataDisk.4.Size Integer No 2000

The size of the fourth data disk. Unit: GiB. Valid values:

  • cloud: 5 to 2000
  • cloud_efficiency: 20 to 32768
  • cloud_ssd: 20 to 32768
  • cloud_essd: 20 to 32768
  • ephemeral_ssd: 5 to 800
ImageId String No centos_7_05_64_20G_alibase_20181212.vhd

The ID of the image in which the instance is launched. You can call the DescribeImages operation to view the available images. If you do not specify the parameter, the system queries the price of the Linux-based images by default.

InstanceNetworkType String No vpc

The network type of the instance. Valid values:

  • classic: the classic network
  • vpc: Virtual Private Cloud (VPC)

Default value: vpc

InstanceType String No ecs.n1.tiny

The instance type. For more information, see Instance families or call the DescribeInstanceTypes operation to query the most recent instance type list.

InternetChargeType String No PayByTraffic

The billing method for the network usage. Valid values:

  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-traffic

Default value: PayByTraffic

InternetMaxBandwidthOut Integer No 5

The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100.

Default value: 0

IoOptimized String No optimized

Specifies whether the instance is I/O optimized. Valid values:

  • none: The instance is non-I/O optimized.
  • optimized: The instance is I/O optimized.

If the value of the InstanceType parameter specifies a Generation I type, the instance is non-I/O optimized by default.

If the value of the InstanceType parameter does not specify a Generation I type, the instance is I/O optimized by default.

Period Integer No 1

The billing duration of the ECS instance. The values that are valid for this parameter depend on the value specified in the PriceUnit parameter. Valid values:

  • The value is 1, 2, 3, 4, 5, 6, 7, 8, or 9 when the PriceUnit parameter is set to Month.
  • The value is 1, 2 or 3 when the PriceUnit parameter is set to Year.
  • The value is 1 when the PriceUnit parameter is set to Hour.

Default value: 1.

PriceUnit String No Year

The pricing unit for ECS instance usage. Valid values:

  • Month
  • Year
  • Default value: Hour
ResourceType String No instance

The type of the resource. Valid values:

  • instance
  • disk
  • bandwidth

Default value: instance

SystemDisk.Category String No cloud_ssd

The category of the system disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: enhanced SSD

When the InstanceType parameter is set to one of the Phased-out instance types and the IoOptimized parameter is set to none, the default value is cloud.

In other cases, the default value is cloud_efficiency.

SystemDisk.PerformanceLevel String No PL1

The performance level of the system disk when it is an enhanced SSD. Only when SystemDiskCategory=cloud_essd, this parameter is valid. Valid values:

  • Default value: PL1
  • PL2
  • PL3
SystemDisk.Size Integer No 80

The size of the system disk. Unit: GiB. Valid values: 20 to 500.

The value of this parameter must be at least 20 GiB and greater than or equal to the size of the image.

Default value: 40 or the size of the image, depending on whichever is greater.

Response parameters

Parameter Type Example Description
PriceInfo

An array of price data, including price and discount rules.

Price

The price.

Currency String USD

The currency unit.

DetailInfos Array

The details about the price.

ResourcePriceModel

The details about the price.

DiscountPrice Float 655.2

The discount.

OriginalPrice Float 4368

The original price.

Resource String instance

The name of the resource.

SubRules Array

A subset of pricing rules.

Rule

A pricing rule.

Description String Get 15% discount on 1-year subscription

The description of the rule subset.

RuleId Long 587

The ID of the rule.

TradePrice Float 3712.8

The transaction price.

DiscountPrice Float 655.2

The discount.

OriginalPrice Float 4368

The original price.

TradePrice Float 3712.8

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

Rules Array

The promotion rules.

Rule

The promotion rule.

Description String Get 15% discount on 1-year subscription

The description of the promotion rule.

RuleId Long 587

The ID of the rule.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Samples

Sample request

https://ecs.aliyuncs.com/?Action=DescribePrice
&RegionId=cn-hangzhou
&ResourceType=instance
&InstanceType=ecs.g5.large
&ImageId=centos_7_05_64_20G_alibase_20181212.vhd
&InstanceNetworkType=vpc
&InternetChargeType=PayByTraffic
&InternetMaxBandwidthOut=5
&<Common request parameters>

Sample success response

XML format

<DescribePriceResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
      <PriceInfo>
            <Price>
                  <Currency>CNY</Currency>
                  <DiscountPrice>655.2</DiscountPrice>
                  <OriginalPrice>4368</OriginalPrice>
                  <TradePrice>3712.8</TradePrice>
            </Price>
            <Rules>
                  <Rule>
                        <Description> Get 15% discount on 1-year subscription</Description>
                        <RuleId>ONE_YEAR_85_PERCENT</RuleId>
                  </Rule>
            </Rules>
      </PriceInfo>
</DescribePriceResponse>

JSON format

{
	"PriceInfo":{
		"Price":{
			"DiscountPrice":655.2,
			"OriginalPrice":4368,
			"TradePrice":3712.8,
			"Currency":"CNY"
		},
		"Rules":{
			"Rule":[
				{
					"Description":"Get 15% discount on 1-year subscription",
					"RuleId":"ONE_YEAR_85_PERCENT"
				}
			]
		}
	},
	"RequestId":"04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized. The error message returned because you are not authorized to use the specified instance type.
400 InvalidInstanceType.ValueNotSupported The specified InstanceType does not exist or beyond the permitted range. The error message returned because the specified instance type is not supported.
400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is not valid. The error message returned because the specified billing method for network usage does not exist.
400 InvalidInternetMaxBandwidthOut.ValueNotSupported The specified parameter "InternetMaxBandwidthOut" is not valid. The error message returned because the value specified for the InternetMaxBandwidthOut parameter is invalid.
400 InvalidSystemDiskCategory.ValueNotSupported The specified parameter "SystemDisk.Category" is not valid. The error message returned because the specified system disk category is invalid.
400 InvalidDataDiskSize.ValueNotSupported The specified DataDisk.n.Size beyond the permitted range, or the capacity of snapshot exceeds the size limit of the specified disk category. The error message returned because the maximum size of the specified data disk has been reached.
400 InvalidDataDiskCategory.ValueNotSupported The specified parameter "DataDisk.n.Category" is not valid. The error message returned because the value specified for the DataDisk.n.Category parameter is invalid.
400 InvalidParameter.Conflict The specified image does not support the specified instance type. The error message returned because the specified image cannot be used for the specified instance type.
403 ImageNotSubscribed The specified image has not be subscribed. The error message returned because you have not subscribed to the specified Alibaba Cloud Marketplace image.
403 OperationDenied The specified Image is disabled or is deleted. The error message returned because the specified image is disabled or deleted.
403 InvalidSystemDiskCategory.ValueUnauthorized The disk category is not authorized. The error message returned because you are not authorized to use the specified disk category.
403 InstanceDiskCategoryLimitExceed The total size of specified disk category in an instance exceeds. The error message returned because the total size of the specified disks exceeds the maximum capacity that is allowed for the disk category.
403 ImageRemovedInMarket The specified market image is not available, Or the specified user defined image includes product code because it is based on an image subscribed from marketplace, and that image in marketplace includeing exact the same product code has been removed. The error message returned because the specified Alibaba Cloud Marketplace image is unavailable.
403 QuotaExceed.PortableCloudDisk The quota of portable cloud disk exceeds. The error message returned because the maximum number of removable disks has been reached.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket.
400 InvalidNetworkType.Mismatch Specified parameter "InternetChargeType" conflict with instance network type. The error message returned because the network type of the instance does not support the specified network billing method.
400 InvalidDiskCategory.Mismatch The specified disk categories' combination is not supported. The error message returned because the combination of the specified disk categories is not supported.
403 Forbbiden User not authorized to operate on the specified resource. The error message returned because you are not authorized to perform operations on the specified resource.
404 InvalidImageId.NotFound The specified ImageId does not exist. The error message returned because the specified image does not exist under this account. Check whether the image ID is valid.
403 InstanceDiskNumLimitExceed The number of specified disk in an instance exceeds. The error message returned because the maximum number of disks attached to the instance has been reached.
403 IoOptimized.NotSupported The specified image is not support IoOptimized Instance. The error message returned because the specified image does not support I/O optimized instances.
403 ImageNotSupportInstanceType The specified image don't support the InstanceType instance. The error message returned because the specified image does not support the instance type.
400 InvalidIoOptimizedValue.ValueNotSupported IoOptimized value not supported. The error message returned because the specified IoOptimized parameter is invalid.
404 IoOptimized.NotSupported The specified instancetype is not support IoOptimized instance The error message returned because the specified instance type does not support I/O optimization.
403 InvalidDiskSize.TooSmall Specified disk size is less than the size of snapshot The error message returned because the size of the specified disk is smaller than that of the snapshot.
403 OperationDenied The type of the disk does not support the operation The error message returned because the disk type does not support the specified operation.
404 InvalidInstanceChargeType.NotFound The InstanceChargeType does not exist in our records The error message returned because the specified billing method for network usage does not exist.
400 InvalidPeriod The specified period is not valid. The error message returned because the specified period is invalid.
403 InvalidDiskCategory.Mismatch The specified disk categories combination is not supported. The error message returned because the combination of the specified disk categories is not supported.
400 InvalidDataDiskCategory.ValueNotSupported The specified parameter " DataDisk.n.Category " is not valid. The error message returned because the specified disk category is invalid.
400 InvalidSystemDiskCategory.ValueNotSupported The specified parameter " SystemDisk.Category " is not valid. The error message returned because the specified disk category is invalid.
403 InvalidDiskCategory.NotSupported The specified disk category is not support the specified instance type. The error message returned because the specified disk category does not support the instance type.
403 InvalidDiskCategory.NotSupported The upgrade operation of instance does not support this category of disk. The error message returned because the disks attached to the instance do not support instance specifications upgrades.
400 InstanceDiskCategoryLimitExceed The specified DataDisk.n.Size beyond the permitted range, or the capacity of snapshot exceeds the size limit of the specified disk category. The error message returned because the maximum size of the specified data disk has been reached.
404 DependencyViolation.IoOptimized The specified instancetype must be IoOptimized instance. The error message returned because the specified instance type must be I/O optimized. Check whether the instance type is valid.
404 InvalidSystemDiskSize.LessThanImageSize The specified parameter SystemDisk.Size is less than the image size. The error message returned because the specified system disk size is smaller than the size of the image.
404 InvalidSystemDiskSize.LessThanMinSize The specified parameter SystemDisk.Size is less than the minimum size. The error message returned because the specified system disk size is smaller than the lower limit.
404 InvalidSystemDiskSize.MoreThanMaxSize The specified parameter SystemDisk.Size is more than the maximum size The error message returned because the specified system disk size exceeds the upper limit.
400 InvalidInternetMaxBandwidthOut.ValueNotSupported The specified vm bandwidth is not valid. The error message returned because the specified virtual machine bandwidth is invalid.
400 InvalidSystemDiskCategory.ValueNotSupported The specified parameter SystemDisk.Category is not valid. The error message returned because the specified system disk category is invalid.
403 InvalidParameter.ResourceOwnerAccount ResourceOwnerAccount is Invalid. The error message returned because the specified resource owner account is invalid.
403 RegionUnauthorized There is no authority to create instance in the specified region. The error message returned because you are not authorized to create instances in the specified region.
404 InvalidSystemDiskSize.ValueNotSupported The specified parameter SystemDisk.Size is invalid. The error message returned because the specified system disk size is invalid.
400 InvalidInternetMaxBandwidthOut.ValueNotSupported The specified parameter Bandwidth is not valid. The error message returned because the specified bandwidth is invalid.
400 InstanceDiskNumber.LimitExceed The total number of specified disk in an instance exceeds. The error message returned because the maximum number of disks attached to the instance has been reached.
400 InvalidDiskCategory.ValueNotSupported The specified parameter "DiskCategory" is not valid. The error message returned because the specified disk category is invalid.
403 OperationDenied The resource is out of usage. The error message returned because the instance is not in the running state. Start the instance or check whether the operation is proper.
400 InvalidInternetMaxBandwidthOut.ValueNotSupported %s The error message returned because the specified InternetMaxBandwidthOut parameter is invalid.
400 InvalidDataDiskCategory.ValueNotSupported %s The error message returned because the parameter is not supported.
400 InvalidSystemDiskCategory.ValueNotSupported %s The error message returned because the parameter is not supported.
400 InvalidParameter.Conflict %s The error message returned because the parameter conflicts with another parameter.
400 InvalidInternetChargeType.ValueNotSupported %s The error message returned because the parameter is not supported.
400 InvalidInstanceType.ValueNotSupported %s The error message returned because the instance type is incorrect.
403 InstanceType.Offline %s The error message returned because the specified instance type is unavailable.
400 RegionUnauthorized %s The error message returned because the specified region is not supported.
500 InternalError %s The error message returned because an unknown internal error has occurred.
400 InvalidSystemDiskSize.ValueNotSupported %s The error message returned because the parameter is not supported.
400 InvalidDataDiskSize.ValueNotSupported %s The error message returned because the parameter is not supported.
404 InvalidInstanceType.Missing The InstanceType parameter that is mandatory for processing the request is not provided. The error message returned because the InstanceType parameter is required.
404 InvalidNetworkType.ValueNotSupported The specified parameter NetworkType is not valid. The error message returned because the specified network type is invalid.
404 InvalidDiskCategory.Missing The DataDisk.1.Category parameter that is mandatory for processing the request is not provided. The error message returned because the category of the data disk is not specified.
400 InvalidSystemDiskCategory.ValueNotSupported The specified parameter "SystemDisk.Size" is not valid. The error message returned because the specified system disk size is invalid.
400 InvalidSystemDiskSize.LessThanImageSize The specified parameter "SystemDisk.Size" is less than the image size. The error message returned because the specified system disk size is smaller than the image size.
400 InvalidDataDiskCategory.ValueNotSupported The specified parameter "DataDisk.Category" is not valid. The error message returned because the specified data disk category is invalid.
400 InvalidDataDiskSize.ValueNotSupported The specified parameter "DataDisk.Size" is not valid. The error message returned because the specified data disk size is invalid.
400 Throttling Request was denied due to request throttling. The operation is too frequent. Try again later.
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 resource cannot be queried for the moment. Try again later.
400 InvalidResourceType.ValueNotSupported The specified parameter ResourceType is not valid. The error message returned because the specified resource type is invalid.
400 InvalidPriceUnit.ValueNotSupported The specified parameter PriceUnit is not valid. The error message returned because the specified pricing unit is invalid.
403 OperationDenied The specified parameter InstanceNetworkType is not authorized. The error message returned because you are not authorized to use the specified network type.
400 InvalidInternetMaxBandwidthOut.ValueNotSupported The specified parameter InternetMaxBandwidthOut is not valid. The error message returned because the specified maximum outbound public bandwidth is invalid.
403 InvalidAmount.Malformed The specified parameter Amount is not valid. The error message returned because the format of the Amount parameter is invalid.
400 EncryptedOption.Conflict %s The error message returned because the parameter does not support encrypted disks.
404 Invalid.InstanceId.NotFound The Instance provided does not exist. The error message returned because the specified instance does not exist.
403 InvalidDiskSize.TooSmall Specified system disk size is less than the size of image The error message returned because the size of the system disk is smaller than that of the image.
404 InvalidMarketImage.NotFound The specified marketplace image does not exist, please change the imageId and try again. The error message returned because the specified image does not exist in Alibaba Cloud Marketplace.
400 IncorrectImageStatus The specified marketplace image is not available. The error message returned because the specified Alibaba Cloud Marketplace image is unavailable.
403 InvalidChargeType.MarketImage The specified chargeType of marketplace image is invalid The error message returned because the billing method for the images from Alibaba Cloud Marketplace is not supported.
403 InvalidDiskIds.NotFound Some of the specified disks do not exist. The error message returned because the specified disk does not exist.
403 InvalidDiskCategory.NotSupported The specified disk category is not supported. The error message returned because the specified disk category is not supported.
403 PrePaidInstance.Expired The prePaid instance has expired. The error message returned because the subscription instance has expired.
404 InvalidDiskIds.NotPortable The specified DiskId is not portable. The error message returned because the specified disk is not removable.
404 InvalidSystemDisk.NotFound The specified system disk does not exist. The error message returned because the specified system disk does not exist.
404 InvalidResourceGroup.NotFound The ResourceGroup provided does not exist in our records. The error message returned because the specified resource group does not exist in the records.

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