tencent cloud

Feedback

DescribeDBInstances

Last updated: 2023-09-05 10:26:28

1. API Description

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

This API is used to query the TencentDB instance list. It supports filtering instances by project ID, instance ID, private address, and instance name.
If no filter is specified, 20 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: DescribeDBInstances.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region No String Common Params. This parameter is not required for this API.
InstanceIds.N No Array of String Queries by instance ID or IDs. Instance ID is in the format of tdsql-ow728lmc. Up to 100 instances can be queried in one request.
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 Queries 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 Sorting order. Valid values: desc, asc
Offset No Integer Offset. Default value: 0
Limit No Integer Number of results to be returned. Default value: 20. Maximum value: 100.
OriginSerialIds.N No Array of String Queries by OriginSerialId
IsFilterExcluster No Boolean Identifies whether to use the ExclusterType field. false: no, true: yes
ExclusterType No Integer Instance cluster type. 1: non-dedicated cluster, 2: dedicated cluster, 0: all
ExclusterIds.N No Array of String Filters instances by dedicated cluster ID in the format of dbdc-4ih6uct9
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 DBInstance Instance details list
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 by instance ID

Input Example

https://mariadb.tencentcloudapi.com/?Action=DescribeDBInstances
&InstanceIds.0=tdsql-dj77jd0p
&<Common request parameters>

Output Example

{
    "Response": {
        "Instances": [
            {
                "AppId": 251000022,
                "AutoRenewFlag": 1,
                "Cpu": 1,
                "CreateTime": "2021-03-26 15:28:23",
                "DbEngine": "Percona",
                "DbVersion": "5.7.17",
                "DcnDstNum": 0,
                "DcnFlag": 0,
                "DcnStatus": 0,
                "ExclusterId": "",
                "Id": 2000090,
                "InstanceId": "tdsql-dj77jd0p",
                "InstanceName": "tdsql-dj77jd0p",
                "InstanceType": 2,
                "Ipv6Flag": 0,
                "IsAuditSupported": 1,
                "IsEncryptSupported": 1,
                "IsTmp": 0,
                "Locker": 0,
                "Machine": "TS85",
                "Memory": 2,
                "NodeCount": 2,
                "OriginSerialId": "set_1616743781_36017514",
                "Paymode": "prepaid",
                "PeriodEndTime": "2021-04-26 15:28:23",
                "Pid": 1002231,
                "ProjectId": 0,
                "Qps": 2100,
                "Region": "ap-guangzhou",
                "Status": 2,
                "StatusDesc": "Running",
                "Storage": 10,
                "SubnetId": 1479311,
                "TdsqlVersion": "Designed based on Percona 5.7.17 (compatible with MySQL 5.7)",
                "Uin": "918700682",
                "UniqueSubnetId": "subnet-au6ics6s",
                "UniqueVpcId": "vpc-737mtr2f",
                "UpdateTime": "2021-03-29 17:20:05",
                "Vip": "10.1.0.10",
                "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": "66c4d0c5-bdef-45bd-aa5b-05642802d034",
        "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.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.