DescribeInstances

Last updated: 2021-10-21 10:26:49

1. API Description

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

This API is used to query the list of instances.

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 parameter. The value used for this API: DescribeInstances.
Version Yes String Common parameter. The value used for this API: 2019-01-07.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
Limit No Integer Number of returned results. Default value: 20. Maximum value: 100
Offset No Integer Record offset. Default value: 0
OrderBy No String Sort by field. Valid values:
  • CREATETIME: creation time
  • PERIODENDTIME: expiration time
  • OrderByType No String Sorting order. Valid values:
  • ASC: ascending
  • DESC: descending
  • Filters.N No Array of QueryFilter Filter. If more than one filter exists, the logical relationship between these filters is AND.
    DbType No String Engine type. Valid values: MYSQL, POSTGRESQL
    Status No String Instance status
    InstanceIds.N No Array of String Instance ID list

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Number of instances
    InstanceSet Array of CynosdbInstance Instance 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 instance list

    Input Example

    POST / HTTP/1.1
    Host: cynosdb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeInstances
    <Common request parameters>
    
    {
        "OrderBy": "xx",
        "Status": "xx",
        "DbType": "xx",
        "OrderByType": "xx",
        "Filters": [
            {
                "Values": [
                    "cynosdbpg-ins-bzkxxrmt"
                ],
                "Names": [
                    "xx"
                ],
                "ExactMatch": true,
                "Name": "xx"
            }
        ],
        "Offset": 0,
        "Limit": 0,
        "InstanceIds": [
            "xx"
        ]
    }
    

    Output Example

    {
      "Response": {
        "InstanceSet": [
          {
            "ServerlessStatus": "",
            "WanStatus": "",
            "RenewFlag": 2,
            "Zone": "ap-guangzhou-3",
            "DbVersion": "5.7",
            "Storage": 100,
            "Memory": 4,
            "ProcessingTask": "",
            "Status": "deleted",
            "UpdateTime": "2020-11-13 11:43:04",
            "VpcId": "",
            "StorageId": "cynosdbmysql-xxxxxxxx",
            "MinCpu": 0.0,
            "MaxCpu": 0.0,
            "InstanceId": "cynosdbmysql-ins-pd59rjuk",
            "ClusterId": "cynosdbmysql-6bsl6k03",
            "NetType": 0,
            "PeriodEndTime": "2020-11-13 11:40:16",
            "InstanceType": "ro",
            "StoragePayMode": 0,
            "DestroyTime": "",
            "IsolateTime": "2020-11-13 11:40:28",
            "DestroyDeadlineText": "",
            "ProjectId": 0,
            "Region": "ap-guangzhou",
            "PayMode": 1,
            "SubnetId": "",
            "CynosVersion": "2.0.11",
            "StatusDesc": "Deleted",
            "InstanceName": "cynosdbmysql-ins-pd59rjuk",
            "Cpu": 2,
            "WanDomain": "",
            "ClusterName": "Prepaid_Cluster",
            "InstanceRole": "ro",
            "WanPort": 0,
            "Uin": "100000007539",
            "DbType": "MYSQL",
            "Vip": "",
            "AppId": 251007582,
            "WanIP": "",
            "Vport": 0,
            "CreateTime": "2020-11-13 11:37:30"
          },
          {
            "ServerlessStatus": "",
            "WanStatus": "",
            "RenewFlag": 2,
            "Zone": "ap-guangzhou-3",
            "DbVersion": "5.7",
            "Storage": 100,
            "Memory": 8,
            "ProcessingTask": "",
            "Status": "deleted",
            "UpdateTime": "2020-11-13 11:43:04",
            "VpcId": "",
            "MinCpu": 0.0,
            "MaxCpu": 0.0,
            "InstanceId": "cynosdbmysql-ins-dxxbxr1a",
            "ClusterId": "cynosdbmysql-6bsl6k03",
            "NetType": 0,
            "PeriodEndTime": "2020-11-13 11:40:15",
            "InstanceType": "rw",
            "DestroyTime": "",
            "StorageId": "cynosdbmysql-xxxxxxxx",
            "IsolateTime": "2020-11-13 11:40:25",
            "DestroyDeadlineText": "",
            "ProjectId": 0,
            "StoragePayMode": 0,
            "Region": "ap-guangzhou",
            "PayMode": 1,
            "SubnetId": "",
            "CynosVersion": "2.0.11",
            "StatusDesc": "Deleted",
            "InstanceName": "cynosdbmysql-ins-dxxbxr1a",
            "Cpu": 4,
            "WanDomain": "",
            "ClusterName": "Prepaid_Cluster",
            "InstanceRole": "master",
            "WanPort": 0,
            "Uin": "100000007539",
            "DbType": "MYSQL",
            "Vip": "",
            "AppId": 251007582,
            "WanIP": "",
            "Vport": 0,
            "CreateTime": "2020-11-13 11:35:24"
          }
        ],
        "TotalCount": 26,
        "RequestId": "03ea3f94-297d-11eb-8f30-525400b7dd5a"
      }
    }
    

    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
    FailedOperation.CamCheckResourceError Failed to get permissions. Please try again later. If the problem persists, please contact customer service.
    FailedOperation.CamSigAndAuthError Authentication failed. Please try again later. If the problem persists, please contact customer service.
    FailedOperation.DatabaseAccessError Failed to access the database. Please try again later. If the problem persists, please contact customer service.
    InternalError.DbOperationFailed Failed to query the database.
    InternalError.SystemError Internal system error.
    InternalError.UnknownError Unknown internal error.
    InvalidParameter Parameter error.
    InvalidParameterValue.IllegalOrderBy Invalid sort by field.
    InvalidParameterValue.InvalidParameterValueError Invalid parameter value.
    InvalidParameterValue.ParamBothSetError The parameters ({{1}} and {{2}}) cannot be set at the same time.
    InvalidParameterValue.ParamError Incorrect parameter.
    UnauthorizedOperation.PermissionDenied CAM authentication failed.