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. |
| Period | Yes | Integer | Instance duration, in months, minimum value 1, maximum value 36. This field is invalid when querying the pay-as-you-go rate. |
| Zone | No | String | AZ information, in the format of "ap-guangzhou-2". For available values, query the DescribeDBZoneConfig api. This parameter is required when InstanceId is empty. |
| GoodsNum | No | Integer | Instance count. Default value is 1, minimum value 1, maximum value 100. This parameter is required when InstanceId is empty. |
| Memory | No | Integer | Instance memory size, measurement unit: MB. Required when InstanceId is empty. To ensure the input value is valid, please use the obtain the purchasable specifications of cloud databases API to obtain 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, defaults to master. Supported values include: master - primary instance, ro - read-only instance, dr - disaster recovery instance. Required when InstanceId is empty. |
| PayType | No | String | Payment type. Supported values: PRE_PAID (yearly/monthly subscription) and HOUR_PAID (pay-as-you-go). This parameter is required when InstanceId is empty. |
| ProtectMode | No | Integer | Data replication method, defaults to 0. Supported values include: 0 - means async replication, 1 - means semi-sync replication, 2 - means strong sync replication. |
| DeviceType | No | String | Instance isolation type. Enumeration value:
Default value: UNIVERSAL If needed to query the price of a single-node instance of cloud disk edition, set up this parameter as CLOUD_NATIVE_CLUSTER and specify parameter InstanceNodes as 1. |
| InstanceNodes | No | Integer | Number of instance nodes. |
| Cpu | No | Integer | The number of CPU cores of the price-query instance, measurement unit: core. To ensure the validity of the input CPU value, please use the obtain the purchasable specifications of cloud databases API acquisition to get the saleable number of cores. When this value is not specified, a default value will be padded based on the Memory size. |
| InstanceId | No | String | Query the ID of the instance to be renewed. If needed, fill in InstanceId and Period to query instance renewal price. |
| Ladder | No | Integer | Usage-based billing tier. Valid only when PayType=HOUR_PAID. Supported values include: 1, 2, 3. For step duration, see 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 CLOUD disk edition or single-node instance of CLOUD disk edition. Default value: SSD CLOUD Block Storage. |
| Parameter Name | Type | Description |
|---|---|---|
| Price | Integer | Instance price, unit: cent. |
| OriginalPrice | Integer | Original price of instance. Measurement unit: cent. |
| Currency | String | Currency unit. CNY - RMB, USD - 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