tencent cloud

Feedback

InquirePriceCreateDBInstances

Last updated: 2023-03-20 10:55:15

1. API Description

Domain name for API request: mongodb.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 No String Common Params. This parameter is not required for this API.
Zone Yes String Instance region name in the format of ap-guangzhou-2.
NodeNum Yes Integer Number of primary and secondary nodes per shard.
Value range: It can be queried by the DescribeSpecInfo API, and the MinNodeNum and MaxNodeNum parameters are the minimal and maximum value respectively.
Memory Yes Integer Instance memory size in GB.
Volume Yes Integer Instance disk size.
  • Unit: GB
  • Value range: It can be queried by the DescribeSpecInfo API, and MinStorage and MaxStorage parameters are the minimal and maximum value of the disk size respectively.
MongoVersion Yes String Instance version information.
  • For specific supported versions, query through the DescribeSpecInfo API, the returned parameter MongoVersionCode in data structure SpecItems is the supported version information.
  • The correspondences between parameters and versions are as follows
    • MONGO_3_WT: MongoDB 3.2 WiredTiger storage engine version.
    • MONGO_3_ROCKS: MongoDB 3.2 RocksDB storage engine version.
    • MONGO_36_WT: MongoDB 3.6 WiredTiger storage engine version.
    • 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.
MachineCode Yes String Server type. Valid values: HIO (high IO), HIO10G (ten-gigabit high IO)
GoodsNum Yes Integer Number of instances. Minimum value: 1. Maximum value: 10.
ClusterType Yes String Instance type. Valid values: REPLSET (replica set), SHARD (sharded cluster), STANDALONE (single-node).
ReplicateSetNum Yes Integer Number of replica sets. To create a replica set instance, set this parameter to 1; to create a shard instance, see the parameters returned by the DescribeSpecInfo API; to create a single-node instance, set this parameter to 0.
Period No Integer Instance validity period in months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
InstanceChargeType No String
MongosCpu No Integer
MongosMemory No Integer
MongosNum No Integer
ConfigServerCpu No Integer
ConfigServerMemory No Integer
ConfigServerVolume No Integer

3. Output Parameters

Parameter Name Type Description
Price DBInstancePrice Price.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying purchase price of an instance

Input Example

https://mongodb.tencentcloudapi.com/?Action=InquirePriceCreateDBInstances
&Zone=ap-guangzhou-4
&NodeNum=3
&Memory=4
&Volume=100
&MongoVersion=MONGO_36_WT
&MachineCode=HIO10G
&GoodsNum=2
&Period=1
&ClusterType=REPLSET
&ReplicateSetNum=1
&<Common request parameters>

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 subaccount 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