tencent cloud

TencentDB for MongoDB

InquirePriceCreateDBInstances

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-05-18 17:47:52

1. API Description

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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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, please see Regions and Availability Zones.

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 specifications, 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: MongoDB 4.0 WiredTiger storage engine version.
  • MONGO_42_WT: MongoDB 4.2 WiredTiger storage engine version.
  • MONGO_44_WT: MongoDB 4.4 WiredTiger storage engine version.
  • MONGO_50_WT: MongoDB 5.0 WiredTiger storage engine version.
  • MONGO_60_WT: MongoDB 6.0 WiredTiger storage engine version.
  • MONGO_70_WT: MongoDB 7.0 WiredTiger storage engine version.
  • MONGO_80_WT: MongoDB 8.0 WiredTiger storage engine version.
MachineCode Yes String

Recommended product specification types:

  • GE.LD.T1: Local disk (Common I).
  • GE.CD.T1: Cloud disk (Common I).

Product allowlist specification types:

  • HIO10G: Local disk (High IO 10G).
  • HCD: Cloud disk (Cloud disk edition).

Note: Allowlist specification types are under allowlist control. If needed, submit a ticket to apply.

GoodsNum Yes Integer

Number of instances. Value range: [1,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 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 the pay-as-you-go mode is selected, that is, when InstanceChargeType is set to POSTPAID_BY_HOUR, this parameter can only be set to 1.
InstanceChargeType No String

Instance payment method.

  • PREPAID: Annual and 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

Refers to the number of ConfigServer CPU cores, value fixed at 1, unit: GB. This parameter can be left blank.

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 at 20. Unit: GB. This parameter can be left blank.

ReadonlyNodeNum No Integer
  • Create a replica set instance. It refers to the read-only node quantity in each replica set.
  • Create a sharded cluster instance. It refers to the read-only node quantity in each shard.
    Value range: [1,5].
Cpu No Integer

CPU size of the instance.

  • Unit: C.
  • 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 specifications, respectively.
  • Note: You need to pass in the CPU core size corresponding to the memory when querying the price of a Common I Instance Type.

3. Output Parameters

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.

4. Example

Example1 Querying the Price for Purchasing Database Instances

Input Example

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"
}

Output Example

{
    "Response": {
        "Price": {
            "DiscountPrice": 1340,
            "OriginalPrice": 1340,
            "UnitPrice": 670
        },
        "RequestId": "fb8b4646-389d-44cc-ab8c-98c081cbdad3"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

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

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백