Domain name for API request: mongodb.intl.tencentcloudapi.com.
This API is used to query price of instance creation. The region parameter must be passed in this API, otherwise verification will fail. This API allows queries only for purchasable instance specifications.
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: InquirePriceCreateDBInstances. |
| Version | Yes | String | Common Params. The value used for this API: 2019-07-25. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| Zone | Yes | String | Region and AZ information of the instance. For details, see Regions and AZs. |
| NodeNum | Yes | Integer | -Specifies the number of primary and secondary nodes for each replica set during replica set instance creation. call the DescribeSpecInfo API to obtain the maximum and minimum number of nodes supported for each replica set. - Specifies the number of primary and secondary nodes for each shard during sharded cluster instance creation. Call the DescribeSpecInfo API to obtain the maximum and minimum number of nodes supported for each shard. |
| Memory | Yes | Integer | Instance memory size. - Unit: GB. - For the value range, call the DescribeSpecInfo API. The CPU and Memory parameters in the returned data structure SpecItems correspond to the number of CPU cores and the memory specification, respectively. |
| Volume | Yes | Integer | Instance disk size. - Unit: GB. - For the value range, call the DescribeSpecInfo API. The MinStorage and MaxStorage parameters in the returned data structure SpecItems correspond to the minimum and maximum disk specifications, respectively. |
| MongoVersion | Yes | String | Instance version information. The DescribeSpecInfo API can be called to obtain specific supported versions. The MongoVersionCode parameter in the returned data structure SpecItems indicates the information on versions supported by instances. The corresponding relationship between version information and version number is as follows: - MONGO_40_WT: version of the MongoDB 4.0 WiredTiger storage engine. - MONGO_42_WT: version of the MongoDB 4.2 WiredTiger storage engine. - MONGO_44_WT: version of the MongoDB 4.4 WiredTiger storage engine. - MONGO_50_WT: version of the MongoDB 5.0 WiredTiger storage engine. - MONGO_60_WT: version of the MongoDB 6.0 WiredTiger storage engine. - MONGO_70_WT: version of the MongoDB 7.0 WiredTiger storage engine. |
| MachineCode | Yes | String | Product specification type. - HIO10G: general high-I/O 10GE type. - HCD: cloud disk. |
| GoodsNum | Yes | Integer | Number of instances. Minimum value: 1. Maximum value: 10. |
| ClusterType | Yes | String | Instance type. - REPLSET: replica set. - SHARD: sharded cluster. |
| ReplicateSetNum | Yes | Integer | - Specifies the number of replica sets during replica set instance creation. This parameter can only be set to 1. - Specifies the number of shards during sharded cluster instance creation. Call the DescribeSpecInfo API to query the range of shard quantity. The parameters MinReplicateSetNum and MaxReplicateSetNum in the returned data structure SpecItems correspond to the minimum value and maximum value, respectively. |
| Period | No | Integer | - When the monthly subscription mode is selected, that is, when InstanceChargeType is set to PREPAID, this parameter is required for specifying the purchase duration of instances. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, and 36. Unit: months. - When pay-as-you-go is selected, that is, when InstanceChargeType is set to POSTPAID_BY_HOUR, this parameter only can be set to 1. |
| InstanceChargeType | No | String | Instance payment method. - PREPAID: monthly subscription. - POSTPAID_BY_HOUR: pay-as-you-go. |
| MongosCpu | No | Integer | Number of Mongos node CPU cores. Valid values: 1, 2, 4, 8, and 16. This parameter is required during sharded cluster instance purchase. If this parameter is left blank, the default value 2 is used. |
| MongosMemory | No | Integer | Mongos node memory size. - This parameter is required during sharded cluster instance purchase. - Unit: GB. Valid values: 2 (for 1 core), 4 (for 2 cores), 8 (for 4 cores), 16 (for 8 cores), and 32 (for 16 cores). If this parameter is left blank, the default value 4 is used. |
| MongosNum | No | Integer | Specifies the number of Mongos nodes. Value range: [3,32]. For querying the price of sharded cluster instances, this parameter is required. If it is left blank, the default value 3 is used. |
| ConfigServerCpu | No | Integer | Specifies the number of ConfigServer CPU cores. The value is fixed as 1. |
| ConfigServerMemory | No | Integer | Specifies the ConfigServer memory size. The value is fixed as 2. Unit: GB. This parameter can be left blank. |
| ConfigServerVolume | No | Integer | Specifies the ConfigServer disk size. The value is fixed as 20. Unit: GB. This parameter can be left blank. |
| Parameter Name | Type | Description |
|---|---|---|
| Price | DBInstancePrice | Price. |
| 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. |
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: InquirePriceCreateDBInstances
<Common request parameters>
{
"GoodsNum": 2,
"Zone": "ap-guangzhou-4",
"Memory": 4,
"Period": 1,
"ClusterType": "REPLSET",
"Volume": 100,
"NodeNum": 3,
"ReplicateSetNum": 1,
"MachineCode": "HIO10G",
"MongoVersion": "MONGO_50_WT"
}{
"Response": {
"Price": {
"DiscountPrice": 1340,
"OriginalPrice": 1340,
"UnitPrice": 670
},
"RequestId": "fb8b4646-389d-44cc-ab8c-98c081cbdad3"
}
}
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 | Internal error |
| InvalidParameter | Parameter error |
| InvalidParameter.PermissionDenied | The current sub-account has no permission to perform this operation. |
| InvalidParameterValue.MachineTypeError | Incorrect model. |
| InvalidParameterValue.MongoVersionError | The instance version is incorrect. |
| InvalidParameterValue.ReplicaSetNumError | Incorrect number of replica sets (shards). |
| InvalidParameterValue.SpecNotOnSale | Incorrect purchasable specification. |
| InvalidParameterValue.ZoneClosed | Instances are not purchasable in this AZ. |
| InvalidParameterValue.ZoneError | Invalid availability zone |
Feedback