tencent cloud



Last updated: 2022-06-15 16:12:20

1. API Description

Domain name for API request: mongodb.tencentcloudapi.com.

This API is used to query the list of TencentDB instances (which can be primary, disaster recovery, or read-only instances). It supports filtering instances by project ID, instance ID, and instance status.

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: DescribeDBInstances.
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.
InstanceIds.N No Array of String List of instance IDs in the format of cmgo-p8vnipr5. It is the same as the instance ID displayed on the TencentDB Console page
InstanceType No Integer Instance type. Valid values: 0 (all instances), 1 (promoted), 2 (temp), 3 (read-only), -1 (promoted + read-only + disaster recovery)
ClusterType No Integer Cluster type. Valid values: 0 (replica set instance), 1 (sharding instance), -1 (all instances)
Status.N No Array of Integer Instance status. Valid values: 0 (to be initialized), 1 (executing task), 2 (running), -2 (isolated monthly-subscribed instance), -3 (isolated pay-as-you-go instance)
VpcId No String VPC ID. This parameter can be left empty for the basic network
SubnetId No String Subnet ID of VPC. This parameter can be left empty for the basic network. If it is passed in as an input parameter, the corresponding VpcId must be set
PayMode No Integer Billing type. Valid value: 0 (pay-as-you-go)
Limit No Integer Number of results to be returned for a single request. Valid values: 1-100. Default value: 20
Offset No Integer Offset. Default value: 0
OrderBy No String Sort by field of the returned result set. Currently, supported values include "ProjectId", "InstanceName", and "CreateTime". The return results are sorted in ascending order by default.
OrderByType No String Sorting method of the return result set. Currently, "ASC" or "DESC" is supported
ProjectIds.N No Array of Integer Project ID
SearchKey No String Search keyword, which can be instance ID, instance name, or complete IP
Tags No TagInfo Tag information

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Number of eligible instances.
InstanceDetails Array of InstanceDetail List of instance details
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying the list of instances

Input Example

Host: mongodb.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDBInstances
<Common request parameters>

    "Status": [
    "OrderBy": "xx",
    "InstanceIds": [
    "VpcId": "xx",
    "Tags": {
        "TagKey": "xx",
        "TagValue": "xx"
    "ClusterType": 0,
    "PayMode": 0,
    "Limit": 1,
    "SearchKey": "xx",
    "Offset": 1,
    "SubnetId": "xx",
    "OrderByType": "xx",
    "InstanceType": 0,
    "ProjectIds": [

Output Example

  "Response": {
    "InstanceDetails": [
        "AutoRenewFlag": 0,
        "CloneInstances": [],
        "ClusterType": 0,
        "ClusterVer": 1,
        "CpuNum": 2,
        "CreateTime": "2019-04-02 19:29:16",
        "DeadLine": "2019-04-04 19:29:16",
        "InstanceId": "cmgo-rw2v134z",
        "InstanceName": "cmgo-rw2v134z",
        "InstanceStatusDesc": "Rolling back",
        "InstanceType": 2,
        "InstanceVer": 4,
        "MachineType": "HIO10G",
        "MaintenanceEnd": "05:00:00",
        "MaintenanceStart": "04:00:00",
        "Memory": 4096,
        "MongoVersion": "MONGO_3_WT",
        "NetType": 1,
        "PayMode": 0,
        "ProjectId": 0,
        "Protocol": 0,
        "ReadonlyInstances": [],
        "RealInstanceId": "cmgo-da0pc0dr",
        "Region": "ap-guangzhou",
        "RelatedInstance": {
          "InstanceId": "",
          "Region": ""
        "ReplicaSets": [
            "Memory": 4096,
            "OplogSize": 10240,
            "RealReplicaSetId": "cmgo-rw2v134z_0",
            "ReplicaSetId": "cmgo-rw2v134z_0",
            "ReplicaSetName": "cmgo-rw2v134z_0",
            "SecondaryNum": 2,
            "UsedVolume": 0,
            "Volume": 102400
        "ReplicationSetNum": 1,
        "SecondaryNum": 2,
        "StandbyInstances": [],
        "Status": 1,
        "SubnetId": "subnet-b0lagkxi",
        "Tags": [],
        "UsedVolume": 0,
        "Vip": "",
        "Volume": 102400,
        "VpcId": "vpc-orgohlut",
        "Vport": 27017,
        "Zone": "ap-guangzhou-3"
    "RequestId": "302530d2-ee57-495e-89d0-51e03b11815e",
    "TotalCount": 19

5. Developer Resources


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
InvalidParameter.PermissionDenied The current subaccount has no permission to perform this operation.
InvalidParameterValue.IllegalInstanceStatus Invalid instance status
InvalidParameterValue.RegionError Invalid region
InvalidParameterValue.VpcIdOrSubnetIdNotFound The VPC (subnet) was not found.
InvalidParameterValue.ZoneError Invalid availability zone
UnsupportedOperation Unsupported operation
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support