Domain name for API request: cdb.intl.tencentcloudapi.com.
This API is used to query the price of purchasing or renewing a cloud database instance. It supports querying the price of pay-as-you-go or yearly/monthly subscription. You can input instance type, purchase period, purchase quantity, memory size, disk capacity and availability zone information to query instance price. You can input instance name to query instance renewal price.
Note: To request a price for a certain region, please use the access point of the corresponding region. For access point information, please refer to the service address document. For example, to request a price for the Guangzhou region, send the request to: cdb.ap-guangzhou.tencentcloudapi.com. Likewise, for the Shanghai region, send the request to: cdb.ap-shanghai.tencentcloudapi.com.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: DescribeDBPrice. |
| Version | Yes | String | Common Params. The value used for this API: 2017-03-20. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo. |
| Period | Yes | Integer | Instance validity period in months. Value range: 1-36. This field is invalid when querying the prices of pay-as-you-go instances. |
| Zone | No | String | AZ information in the format of "ap-guangzhou-3". You can use the DescribeDBZoneConfig API to query the configurable values. This parameter is required when InstanceId is empty. |
| GoodsNum | No | Integer | Number of instances. Value range: 1-100. Default value: 1. This parameter is required when InstanceId is empty. |
| Memory | No | Integer | Instance memory size, unit: MB. This parameter is required when InstanceId is empty. To ensure the input value is valid, please use the obtain the purchasable specifications of cloud databases API to get the saleable instance memory size range. |
| Volume | No | Integer | Instance disk size, unit: GB. This parameter is required when InstanceId is empty. To ensure the input value is valid, please use the obtain the purchasable specifications of cloud databases API to get the saleable disk size range. |
| InstanceRole | No | String | Instance type. Valid values: master (source instance), dr (disaster recovery instance), ro (read-only instance). Default value: master. This parameter is required when InstanceId is empty. |
| PayType | No | String | Billing mode. Valid values: PRE_PAID (yearly/monthly subscribed), HOUR_PAID (pay-as-you-go). This parameter is required when InstanceId is empty. |
| ProtectMode | No | Integer | Data replication mode. Valid values: 0 (async), 1 (semi-sync), 2 (strong sync). Default value: 0. |
| DeviceType | No | String | Instance isolation type. Supported values include: "UNIVERSAL" - general-purpose instance, "EXCLUSIVE" - dedicated instance, "BASIC_V2" - single-node instance of cloud disk edition, "CLOUD_NATIVE_CLUSTER" - cluster version standard type, "CLOUD_NATIVE_CLUSTER_EXCLUSIVE" - cluster version enhanced. Default to general-purpose instance if not specified. |
| InstanceNodes | No | Integer | The number of the instance. Valid values: 1 (for read-only and basic instances), 2 (for other source instances). To query the price of a three-node instance, set this value to 3. |
| Cpu | No | Integer | CPU core count of the price-queried instance. To ensure that the CPU value to be passed in is valid, use the DescribeDBZoneConfig API to query the number of purchasable cores. If this value is not specified, a default value based on memory size will be set. |
| InstanceId | No | String | Instance ID for querying renewal price. To query the renewal price of the instance, pass in the values of InstanceId and Period. |
| Ladder | No | Integer | Tiered pay-as-you-go pricing, which is valid only when PayType is set to HOUR_PAID. Valid values: 1, 2, 3. For more information on tiered duration, visit https://www.tencentcloud.com/document/product/236/18335.?from_cn_redirect=1 |
| DiskType | No | String | Disk Type. Specify this parameter when querying the price of a cluster edition or single-node instance of cloud disk edition. Supported values include "CLOUD_SSD" - SSD cloud disk, "CLOUD_HSSD" - enhanced SSD cloud disk. Default is SSD cloud disk. |
| Parameter Name | Type | Description |
|---|---|---|
| Price | Integer | Instance price. If Currency is set to CNY, the unit will be 0.01 CNY. If Currency is set to USD, the unit will be US Cent. |
| OriginalPrice | Integer | Original price of the instance. If Currency is set to CNY, the unit will be 0.01 CNY. If Currency is set to USD, the unit will be US Cent. |
| Currency | String | Currency: CNY, USD. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Query database instance purchase price
POST / HTTP/1.1
Host: cdb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDBPrice
<Common request parameters>
{
"Zone": "ap-guangzhou-1",
"GoodsNum": 1,
"PayType": "PRE_PAID",
"Period": 24,
"Volume": 25,
"Memory": 1000
}
{
"Response": {
"RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
"Currency": "CNY",
"Price": 48000,
"OriginalPrice": 460800
}
}
Query database instance renewal price
POST / HTTP/1.1
Host: cdb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDBPrice
<Common request parameters>
{
"InstanceId": "cdb-6no119yd",
"Period": 24
}
{
"Response": {
"RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
"Currency": "CNY",
"Price": 48000,
"OriginalPrice": 460800
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InternalError.CauthError | Authentication failed. |
| InternalError.DatabaseAccessError | Internal database error. |
| InternalError.TradeError | Transaction system error. |
| InternalError.UndefinedError | Unknown error |
| InvalidParameter | Parameter error. |
| InvalidParameter.InstanceNotFound | The instance does not exist. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback