You can call the DescribePrice operation to query the price of the ApsaraDB RDS instances that you want to purchase.

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
Action String Yes DescribePrice

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

DBInstanceClass String Yes rds.mysql.s1.small

The instance type of the instances. For more information, see Primary instance types.

DBInstanceStorage Integer Yes 20

The storage capacity of the instances. Unit: GB. The storage capacity increases in increments of 5 GB. For more information, see Primary instance types.

Engine String Yes MySQL

The database engine that is run on the instances. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • PPAS
  • MariaDB
EngineVersion String Yes 5.5

The database engine version that is run on the instances. Valid values:

  • MySQL: 5.5, 5.6, 5.7, and 8.0
  • SQL Server: 2008r2, 2012, 2012_ent_ha, 2012_std_ha, 2012_web, 2014_std_ha, 2016_ent_ha, 2016_std_ha, 2016_web, 2017_std_ha, 2017_ent, and 2019_std_ha
  • PostgreSQL: 9.4, 10.0, 11.0, 12.0, and 13.0
  • PPAS: 9.3 and 10.0
  • MariaDB: 10.3
Quantity Integer Yes 10

The number of instances that you want to purchase. Valid values: 0 to 30.

RegionId String Yes cn-hangzhou

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

ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

CommodityCode String No rds

The commodity code of the instances. Valid values:

  • bards: The instances are pay-as-you-go primary instances. This value is available at the China site (aliyun.com).
  • rds: The instances are subscription primary instances. This is the default value. This value is available at the China site (aliyun.com).
  • rords: The instances are pay-as-you-go read-only instances. This value is available at the China site (aliyun.com).
  • rds_rordspre_public_cn: The instances are subscription read-only instances. This value is available at the China site (aliyun.com).
  • bards_intl: The instances are pay-as-you-go primary instances. This value is available at the International site (alibabacloud.com).
  • rds_intl: The instances are subscription primary instances. This value is available at the International site (alibabacloud.com).
  • rords_intl: The instances are pay-as-you-go read-only instances. This value is available at the International site (alibabacloud.com).
  • rds_rordspre_public_intl: The instances are subscription read-only instances. This value is available at the International site (alibabacloud.com).
Note If the instances are read-only instances, you must specify this parameter.
PayType String No Prepaid

The billing method of the instances. Valid values:

  • Prepaid: subscription
  • Postpaid: pay-as-you-go
ZoneId String No cn-hangzhou-b

The zone ID of the primary instances. You can call the DescribeRegions operation to query the most recent zone list.

Note If specify a VPC and a vSwitch, you must specify this parameter.
UsedTime Integer No 1

The subscription period of the instances. Valid values:

  • If you set the Period parameter to Year, the value of the UsedTime parameter ranges from 1 to 3.
  • If you set the Period parameter to Month, the value of the UsedTime parameter ranges from 1 to 9.
Note If you set the PayType parameter to Prepaid, you must specify the UsedTime parameter.
TimeType String No Year

The billing method of the instances. Valid values:

  • Year: yearly subscription
  • Month: monthly subscription
  • Hour: pay-as-you-go
InstanceUsedType Integer No 0

The role of the instances. Valid values:

  • 0: primary
  • 3: read-only
OrderType String No BUY

The type of the order. Valid values:

  • BUY: purchase order
  • UPGRADE: specification change order
  • RENEW: renewal order
DBInstanceStorageType String No local_ssd

The type of storage media that is used for the instances. Valid values:

  • local_ssd: local SSD
  • cloud_ssd: standard SSD
  • cloud_essd: enhanced SSD of PL1
  • cloud_essd2: enhanced SSD of PL2
  • cloud_essd3: enhanced SSD of PL3
DBInstanceId String No rm-xxxxx

The IDs of the instances whose specifications you want to change or those that you want to renew.

Note If you want to query the price for a specification change or a renewal, you must specify this parameter.

Response parameters

Parameter Type Example Description
Rules Array of Rule

An array that consists of promotion rules.

Rule
RuleId Long 1020021003939076

The ID of the promotion rule.

Name String Rule1

The name of the promotion rule.

Description String Content

The description of the promotion rule.

PriceInfo Struct

The price that is required for the promotion rule.

Currency String CNY

The currency unit that is used to measure the price.

ActivityInfo Struct

The price that is required for the promotion rule.

CheckErrMsg String Errordescription

The description of the error.

ErrorCode String 123456

The code of the error.

Success String Success

Indicates whether the request is successful.

OriginalPrice Float 2504

The original price that you need to pay.

DiscountPrice Float 0

The discount that is applied based on the promotion rule.

TradePrice Float 2504

The discounted price that you need to pay.

Coupons Array of Coupon

An array that consists of coupons.

Coupon
Name String test

The name of the coupon.

Description String test

The description of the coupon.

CouponNo String 123456

The ID of the coupon.

IsSelected String true

Indicates whether the coupon is selected.

RuleIds List 1001199213

The ID of the promotion rule.

RequestId String CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/? Action=DescribePrice
&DBInstanceClass=rds.mysql.s1.small
&DBInstanceStorage=200
&Engine=MySQL
&EngineVersion=5.7
&Quantity=1
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-h
&PayType=Prepaid
&UsedTime=1
&TimeType=Month
&<Common request parameters>

Sample success responses

XML format

<DescribePriceResponse>
  <RequestId>CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6</RequestId>
  <Rules>
</Rules>
  <PriceInfo>
        <OriginalPrice>2504</OriginalPrice>
        <Currency>CNY</Currency>
        <DiscountPrice>0</DiscountPrice>
        <RuleIds>
    </RuleIds>
        <TradePrice>2504</TradePrice>
        <Coupons>
    </Coupons>
  </PriceInfo>
</DescribePriceResponse>

JSON format

{
	"RequestId": "CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6",
	"Rules": {
		"Rule": []
	},
	"PriceInfo": {
		"OriginalPrice": 2504,
		"Currency": "CNY",
		"DiscountPrice": 0,
		"RuleIds": {
			"RuleId": []
		},
		"TradePrice": 2504,
		"Coupons": {
			"Coupon": []
		}
	}
}

Error codes

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