tencent cloud

Feedback

DescribeDCDBShards

Last updated: 2023-06-26 15:13:06

1. API Description

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

This API is used to query the information of shards of a TencentDB instance.

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: DescribeDCDBShards.
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.
InstanceId Yes String Instance ID in the format of dcdbt-ow728lmc.
ShardInstanceIds.N No Array of String Shard ID list.
Offset No Integer Offset. Default value: 0
Limit No Integer Number of returned results. Default value: 20. Maximum value: 100.
OrderBy No String Sort by field. Only createtime is supported currently.
OrderByType No String Sorting order. Valid values: desc, asc

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Number of eligible shards
Shards Array of DCDBShardInfo Shard information list
DcnFlag Integer Disaster recovery flag. Valid values: 0 (none), 1 (source instance), 2 (disaster recovery instance)
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 None

Input Example

POST / HTTP/1.1
Host: dcdb.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDCDBShards
<Common request parameters>

{
    "InstanceId": "dcdbt-21dfpcv1"
}

Output Example

{
    "Response": {
        "DcnFlag": 0,
        "RequestId": "f976f43c-6dd3-4dbf-869b-a1b0eac50506",
        "Shards": [
            {
                "Cpu": 2,
                "CreateTime": "2021-12-01 11:49:54",
                "InstanceId": "dcdbt-21dfpcv1",
                "Memory": 4,
                "MemoryUsage": 0.94,
                "NodeCount": 2,
                "Paymode": "prepaid",
                "PeriodEndTime": "2023-01-01 11:12:24",
                "Pid": 1002231,
                "ProjectId": 0,
                "ProxyVersion": "\"1.17.6-M-V2.0R723D002\"",
                "Range": "0-31",
                "Region": "ap-guangzhou",
                "ShardId": 434,
                "ShardInstanceId": "shard-ngbrea6b",
                "ShardMasterZone": "ap-guangzhou-1",
                "ShardSerialId": "set_1643096858_1",
                "ShardSlaveZones": [
                    "ap-guangzhou-1"
                ],
                "Status": 2,
                "StatusDesc": "Running",
                "Storage": 10,
                "StorageUsage": 0.01,
                "SubnetId": "subnet-ovkcc9x6",
                "VpcId": "vpc-j97vcvb5",
                "Zone": "ap-guangzhou-2"
            },
            {
                "Cpu": 1,
                "CreateTime": "2021-12-01 11:49:54",
                "InstanceId": "dcdbt-21dfpcv1",
                "Memory": 2,
                "MemoryUsage": 0.99,
                "NodeCount": 2,
                "Paymode": "prepaid",
                "PeriodEndTime": "2023-01-01 11:12:24",
                "Pid": 1002231,
                "ProjectId": 0,
                "ProxyVersion": "\"1.17.6-M-V2.0R723D002\"",
                "Range": "32-63",
                "Region": "ap-guangzhou",
                "ShardId": 435,
                "ShardInstanceId": "shard-5zf65smf",
                "ShardMasterZone": "ap-guangzhou-1",
                "ShardSerialId": "set_1643096949_3",
                "ShardSlaveZones": [
                    "ap-guangzhou-1"
                ],
                "Status": 2,
                "StatusDesc": "Running",
                "Storage": 10,
                "StorageUsage": 0.011,
                "SubnetId": "subnet-ovkcc9x6",
                "VpcId": "vpc-j97vcvb5",
                "Zone": "ap-guangzhou-2"
            }
        ],
        "TotalCount": 2
    }
}

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.GetInstanceDetailFailed Failed to get the instance details.
InternalError.GetInstanceInfoFailed Failed to get the instance information.
InternalError.GetVpcFailed Failed to query the VPC information.
InternalError.InnerSystemError Internal system error.
InvalidParameter.GenericParameterError An error occurred while verifying parameter validity.
InvalidParameter.InstanceNotFound Failed to find the requested instance.
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.
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