tencent cloud

Feedback

DescribeDCDBInstances

Last updated: 2024-07-19 14:29:15

    1. API Description

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

    This API is used to query the list of TencentDB instances. It supports filtering instances by project ID, instance ID, private network address, and instance name.
    If no filter is specified, 10 instances will be returned by default. Up to 100 instances can be returned for a single request.

    A maximum of 200 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: DescribeDCDBInstances.
    Version Yes String Common Params. The value used for this API: 2018-04-11.
    Region No String Common Params. This parameter is not required for this API.
    InstanceIds.N No Array of String Query by instance ID or IDs. Instance ID is in the format of dcdbt-2t4cf98d
    SearchName No String Search field name. Valid values: instancename (search by instance name); vip (search by private IP); all (search by instance ID, instance name, and private IP).
    SearchKey No String Search keyword. Fuzzy search is supported. Multiple keywords should be separated by line breaks (\n).
    ProjectIds.N No Array of Integer Query by project ID
    IsFilterVpc No Boolean Whether to search by VPC
    VpcId No String VPC ID, which is valid when IsFilterVpc is 1
    SubnetId No String VPC subnet ID, which is valid when IsFilterVpc is 1
    OrderBy No String Sort by field. Valid values: projectId; createtime; instancename
    OrderByType No String Sort by type. Valid values: desc; asc
    Offset No Integer Offset. Default value: 0
    Limit No Integer Number of returned results. Default value: 10. Maximum value: 100.
    ExclusterType No Integer 1: non-dedicated cluster; 2: dedicated cluster; 0: all
    IsFilterExcluster No Boolean Identifies whether to use the ExclusterType field. false: no; true: yes
    ExclusterIds.N No Array of String Dedicated cluster ID
    TagKeys.N No Array of String Tag key used in queries
    FilterInstanceType No String Instance types used in filtering. Valid values: 1 (dedicated instance), 2 (primary instance), 3 (disaster recovery instance). Multiple values should be separated by commas.
    Status.N No Array of Integer Use this filter to include instances in specific statuses
    ExcludeStatus.N No Array of Integer Use this filter to exclude instances in specific statuses

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Number of eligible instances
    Instances Array of DCDBInstanceInfo List of instance details
    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 list of instances by instance ID

    Input Example

    https://dcdb.tencentcloudapi.com/?Action=DescribeDCDBInstances
    &InstanceIds.0=tdsqlshard-hptutl5t
    &<Common request parameters>
    

    Output Example

    {
        "Response": {
            "Instances": [
                {
                    "AppId": 251000022,
                    "AutoRenewFlag": 1,
                    "Cpu": 2,
                    "CreateTime": "2021-03-26 16:14:31",
                    "DbEngine": "MariaDB",
                    "DbVersion": "10.1.9",
                    "DcnDstNum": 0,
                    "DcnFlag": 0,
                    "DcnStatus": 0,
                    "ExclusterId": "",
                    "Id": 2000091,
                    "InstanceId": "tdsqlshard-hptutl5t",
                    "InstanceName": "tdsqlshard-hptutl5t",
                    "InstanceType": 2,
                    "Ipv6Flag": 0,
                    "IsAuditSupported": 1,
                    "IsTmp": 0,
                    "IsolatedTimestamp": "0000-00-00 00:00:00",
                    "Locker": 0,
                    "Memory": 4,
                    "NodeCount": 2,
                    "Paymode": "prepaid",
                    "PeriodEndTime": "2021-04-26 16:14:31",
                    "Pid": 1001670,
                    "ProjectId": 0,
                    "Region": "ap-guangzhou",
                    "ShardCount": 2,
                    "ShardDetail": [
                        {
                            "Cpu": 1,
                            "Createtime": "2021-03-26 16:14:31",
                            "Memory": 2,
                            "NodeCount": 1,
                            "Pid": 1001670,
                            "ShardId": 12208,
                            "ShardInstanceId": "shard-qihco4rx",
                            "ShardSerialId": "set_1616746585_1",
                            "Status": 2,
                            "Storage": 10
                        },
                        {
                            "Cpu": 1,
                            "Createtime": "2021-03-26 16:14:31",
                            "Memory": 2,
                            "NodeCount": 1,
                            "Pid": 1001670,
                            "ShardId": 12209,
                            "ShardInstanceId": "shard-d3moxo2r",
                            "ShardSerialId": "set_1616746676_3",
                            "Status": 2,
                            "Storage": 10
                        }
                    ],
                    "Status": 2,
                    "StatusDesc": "Running",
                    "Storage": 20,
                    "SubnetId": 1479311,
                    "Uin": "918700682",
                    "UniqueSubnetId": "subnet-au6ics6s",
                    "UniqueVpcId": "vpc-737mtr2f",
                    "UpdateTime": "2021-03-29 15:35:33",
                    "Vip": "10.1.0.6",
                    "Vipv6": "",
                    "VpcId": 74809,
                    "Vport": 3306,
                    "WanDomain": "",
                    "WanPort": 0,
                    "WanPortIpv6": 0,
                    "WanStatus": 0,
                    "WanStatusIpv6": 0,
                    "WanVip": "",
                    "WanVipv6": "",
                    "Zone": "ap-guangzhou-1",
                    "ResourceTags": [
                        {
                            "TagKey": "xx",
                            "TagValue": "xx"
                        }
                    ]
                }
            ],
            "RequestId": "a44a3d24-1e71-4bbf-bc22-f6d583b084d8",
            "TotalCount": 1
        }
    }
    

    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.CamAuthFailed CAM authentication request failed.
    InternalError.DbOperationFailed Failed to query the database.
    InternalError.FenceError Failed to query the information of a dedicated cluster.
    InternalError.GetSubnetFailed Failed to query the VPC subnet information.
    InternalError.GetVpcFailed Failed to query the VPC information.
    InvalidParameter.GenericParameterError An error occurred while verifying parameter validity.
    InvalidParameter.SubnetNotFound The specified VPC subnet was not found.
    InvalidParameterValue.IllegalExclusterID The dedicated cluster to which the database instance belongs was not found.
    InvalidParameterValue.SpecIdIllegal The specification information of the database instance was not found.
    UnauthorizedOperation.PermissionDenied You have no permission to manipulate this API or resource.