You can call the DescribePrice operation to query the price of an instance.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | DescribePrice | The operation that you want to perform. Set the value to DescribePrice. |
| ClientToken | String | No | ETnLKlblzczshOTUbOCz***** | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the generated token 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 instance. Valid values:
Note If the instance is a read-only instance, you must specify the CommodityCode parameter. |
| RegionId | String | Yes | cn-hangzhou | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
| Engine | String | Yes | MySQL | The database engine of the instance. Valid values:
|
| EngineVersion | String | Yes | 5.5 | The database engine version of the instance.
|
| DBInstanceClass | String | Yes | rds.mysql.s1.small | The instance type of the instance. For more information, see Primary ApsaraDB RDS instance types. |
| DBInstanceStorage | Integer | Yes | 20 | The storage capacity of the instance. Unit: GB. You can adjust the storage capacity at a step size of 5 GB. For more information, see Primary ApsaraDB RDS instance types. |
| PayType | String | No | Prepaid | The billing method of the instance. Valid values:
|
| ZoneId | String | No | cn-hangzhou-b | The zone ID of the primary instance. You can call the DescribeRegions operation to query the most recent zone list. Note If you specify a virtual private cloud (VPC) and a vSwitch, you must also specify this parameter. |
| UsedTime | Integer | No | 1 | The subscription duration of the instance.
Default value: 1. |
| TimeType | String | No | Year | The unit that is used to calculate the subscription duration of the instance. If you set the CommodityCode parameter to RDS, rds_rordspre_public_cn, rds_intl, or rds_rordspre_public_intl, you must also specify this parameter. Valid values:
|
| Quantity | Integer | Yes | 10 | The number of instances that you want to purchase. Valid values: 0 to 30. |
| InstanceUsedType | Integer | No | 0 | The role of the instance. Valid values:
|
| OrderType | String | No | BUY | The type of the order. Valid values:
|
| DBInstanceStorageType | String | No | local_ssd | The storage type of the instance. Valid values:
|
| DBInstanceId | String | No | rm-***** | The ID of the instance for which you want to change the specifications or the instance that you want to renew. Note
|
| DBNode | Array | No | The information about the node. Note This parameter is available for ApsaraDB RDS for MySQL clusters. | |
| ClassCode | String | No | mysql.n2.small.xc | The specification of the node. |
| ZoneId | String | No | cn-hangzhou-j | The zone ID of the node. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6 | The ID of the request. |
| PriceInfo | Object | The information about the price. | |
| OriginalPrice | Float | 2504 | The original price that you need to pay. |
| DiscountPrice | Float | 0 | The discount that is applied. |
| Currency | String | CNY | The unit of the currency. |
| TradePrice | Float | 2504 | The transaction price, which is equal to the original price minus the discount. |
| Coupons | Array of Coupon | An array that consists of information about coupons. | |
| Coupon | |||
| IsSelected | String | true | Indicates whether the coupon is selected. |
| CouponNo | String | 123456 | The ID of the coupon. |
| Name | String | test | The name of the coupon. |
| Description | String | test | The description of the coupon. |
| RuleIds | Array of String | 1001199213 | The ID of the promotion rule. |
| ActivityInfo | Object | The information about the promotion. | |
| CheckErrMsg | String | Error description | The description of the error. |
| ErrorCode | String | 123456 | The error code that is returned. |
| Success | String | Success | Indicates whether the request was successful. |
| Rules | Array of Rule | The details about the promotion rule. | |
| Rule | |||
| Name | String | Rule1 | The name of the promotion rule. |
| Description | String | Activity Description | The description of the promotion rule. |
| RuleId | Long | 1020021003939076 | The ID of the promotion rule. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=DescribePrice
&ClientToken=ETnLKlblzczshOTUbOCz*****
&CommodityCode=rds
&RegionId=cn-hangzhou
&Engine=MySQL
&EngineVersion=5.5
&DBInstanceClass=rds.mysql.s1.small
&DBInstanceStorage=20
&PayType=Prepaid
&ZoneId=cn-hangzhou-b
&UsedTime=1
&TimeType=Year
&Quantity=10
&InstanceUsedType=0
&OrderType=BUY
&DBInstanceStorageType=local_ssd
&DBInstanceId=rm-*****
&Common request parameters
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribePriceResponse>
<RequestId>CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6</RequestId>
<PriceInfo>
<OriginalPrice>2504</OriginalPrice>
<DiscountPrice>0</DiscountPrice>
<Currency>CNY</Currency>
<TradePrice>2504</TradePrice>
<Coupons>
<IsSelected>true</IsSelected>
<CouponNo>123456</CouponNo>
<Name>test</Name>
<Description>test</Description>
</Coupons>
<RuleIds>1001199213</RuleIds>
<ActivityInfo>
<CheckErrMsg>Error description</CheckErrMsg>
<ErrorCode> 123456</ErrorCode>
<Success>Success</Success>
</ActivityInfo>
</PriceInfo>
<Rules>
<Name>Rule1</Name>
<Description>Activity Description</Description>
<RuleId>1020021003939076</RuleId>
</Rules>
</DescribePriceResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CA0ADDDC-0BEB-4381-A3ED-73B4C79B8CC6",
"PriceInfo" : {
"OriginalPrice" : 2504,
"DiscountPrice" : 0,
"Currency" : "CNY",
"TradePrice" : 2504,
"Coupons" : [ {
"IsSelected" : "true",
"CouponNo" : "123456",
"Name" : "test",
"Description" : "test"
} ],
"RuleIds" : [ "1001199213" ],
"ActivityInfo" : {
"CheckErrMsg" : "Error description",
"ErrorCode" : " 123456",
"Success" : "Success"
}
},
"Rules" : [ {
"Name" : "Rule1",
"Description" : "Activity Description",
"RuleId" : 1020021003939076
} ]
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidDBInstanceStorage.Format | InvalidDBInstanceStorage.Format | The error message returned because the storage capacity is invalid. Check the configuration of the storage capacity. |
| 400 | DBNodeParameter.InvalidClassCode | The ClassCode of the item of the specified parameter DBNode is inconsistent. | The error message returned because the ClassCode configuration is invalid for the DBNode parameter. |
| 400 | DBNodeParameter.Required | The specified parameter DBNode is required. | The error message returned because the DBNode parameter is not specified. |
| 400 | DBNodeParameter.TooFewItems | The specified parameter DBNode has too few items. | The error message returned because a small number of items are configured for the DBNode parameter. |
| 400 | DBNodeParameter.TooManyItems | The specified parameter DBNode has too many items. | The error message returned because a large number of items are configured for the DBNode parameter. |
| 404 | InvalidTimeType.NotFound | The parameter timeType does not exist. | The error message returned because the value of the TimeType parameter is invalid. The valid values of the TimeType parameter are Year, Month, and Day. |
For a list of error codes, see Service error codes.