Queries PolarDB clusters under your Alibaba Cloud account or PolarDB clusters that a RAM user is authorized to access.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeDBClusters

The operation that you want to perform. Set the value to DescribeDBClusters.

RegionId String Yes cn-hangzhou

The ID of the region.

Note You can call the DescribeRegions operation to query the most recent region list.
DBClusterIds String No pc-****************

The ID of the cluster. Cluster IDs are separated with commas (,).

DBClusterDescription String No pc-****************

The description of the cluster. You can specify a keyword of the description to filter clusters.

DBClusterStatus String No Running

The status of the cluster. For more information about valid values, see Cluster status.

DBType String No MySQL

The type of the database. Valid values:

  • MySQL
  • PostgreSQL
  • Oracle
Tag.N.Key String No test1

The key of the tag. You can filter clusters by tag. A tag is a key-value pair. You can specify up to 20 tags in one request. Letter N specifies the sequence number of each key-value pair and must be unique. The values of Letter N must be consecutive integers that start from 1. Each value of the Tag.N.Key parameter is paired with a value of the Tag.N.Value parameter.

Note The value of this parameter can be a maximum of 64 characters in length and cannot start with aliyun, acs:, http://, or https://.
Tag.N.Value String No 1111

The value of the tag. You can filter clusters by tag. A tag is a key-value pair. You can specify up to 20 tags in one request. Letter N specifies the sequence number of each key-value pair and must be unique. The values of Letter N must be consecutive integers that start from 1. Each value of the Tag.N.Value parameter is paired with a value of the Tag.N.Key parameter.

Note The value of this parameter can be a maximum of 64 characters in length and cannot start with aliyun, acs:, http://, or https://.
PageSize Integer No 30

The number of entries to return on each page. Valid values: 30, 50, and 100.

Default value: 30.

PageNumber Integer No 1

The number of the page to return. The value must be a positive integer. Default value: 1.

ResourceGroupId String No rg-**********

The ID of the resource group.

Response parameters

Parameter Type Example Description
Items Array of DBCluster

The list of clusters that were returned.

DBCluster
CreateTime String 2019-01-10T09:33:58Z

The time when the cluster was created.

DBClusterDescription String pc-****************

The description of the cluster.

DBClusterId String pc-****************

The ID of the cluster.

DBClusterNetworkType String VPC

The network type of the cluster.

DBClusterStatus String Running

The status of the cluster.

DBNodeClass String polar.mysql.x4.large

The specification of the node.

DBNodeNumber Integer 2

The number of nodes in the cluster.

DBNodes Array of DBNode

The list of nodes.

DBNode
DBNodeClass String polar.mysql.x4.large

The specification of the node.

DBNodeId String pi-****************

The ID of the node.

DBNodeRole String Writer

The role of the node. Valid values:

  • Writer: primary node
  • Reader: read-only node
RegionId String cn-hangzhou

The ID of the region.

ZoneId String cn-hangzhou-g

The ID of the zone.

DBType String MySQL

The type of the database.

DBVersion String 5.6

The version of the database.

DeletionLock Integer 0

Indicates whether the cluster is locked and whether the cluster can be deleted. Valid values:

  • 0: The cluster is not locked and can be deleted.
  • 1: The cluster is locked and cannot be deleted.
    Note You cannot delete the cluster if the cluster is locked.
Engine String POLARDB

The engine of the cluster.

ExpireTime String 2020-01-10T09:33:58Z

The time when the cluster expired.

Expired String false

Indicates whether the cluster has expired.

LockMode String Unlock

The lock mode of the cluster. Valid values:

  • Unlock: The cluster is not locked.
  • ManualLock: The cluster is locked manually.
  • LockByExpiration: The cluster is locked automatically after the cluster expires.
PayType String Postpaid

The billing method. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
RegionId String cn-hangzhou

The ID of the region.

ResourceGroupId String rg-rexxxxxxxxxx

The ID of the resource group.

StorageUsed Long 3150970880

The storage usage of the cluster.

Tags Array of Tag

The list of tags.

Tag
Key String test1

The key of the tag.

Value String 1111

The value of the tag.

VpcId String vpc-****************

The ID of the virtual private cloud (VPC).

ZoneId String cn-hangzhou-g

The ID of the zone.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 1

The number of clusters on the page.

RequestId String F7036AE7-20B7-43F8-9E58-558CCD******

The ID of the request.

TotalRecordCount Integer 1

The total number of entries returned.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/? Action=DescribeDBClusters
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<Items>
    <DBCluster>
        <DBVersion>5.6</DBVersion>
        <LockMode>Unlock</LockMode>
        <DBClusterDescription>pc-****************</DBClusterDescription>
        <DBClusterNetworkType>VPC</DBClusterNetworkType>
        <StorageUsed>3150970880</StorageUsed>
        <ZoneId>cn-hangzhou-g</ZoneId>
        <DBClusterId>pc-****************</DBClusterId>
        <VpcId>vpc-****************</VpcId>
        <Engine>POLARDB</Engine>
        <DBClusterStatus>Running</DBClusterStatus>
        <Tags>
            <Tag>
                <Value>1111</Value>
                <Key>test1</Key>
            </Tag>
            <Tag>
                <Value>2222</Value>
                <Key>test2</Key>
            </Tag>
        </Tags>
        <ExpireTime/>
        <DBNodeClass>polar.mysql.x4.large</DBNodeClass>
        <RegionId>cn-hangzhou</RegionId>
        <Expired>false</Expired>
        <CreateTime>2019-01-10T09:33:58Z</CreateTime>
        <DBType>MySQL</DBType>
        <DBNodes>
            <DBNode>
                <DBNodeRole>Writer</DBNodeRole>
                <DBNodeClass>polar.mysql.x4.large</DBNodeClass>
                <DBNodeId>pi-****************</DBNodeId>
            </DBNode>
            <DBNode>
                <DBNodeRole>Reader</DBNodeRole>
                <DBNodeClass>polar.mysql.x4.large</DBNodeClass>
                <DBNodeId>pi-****************</DBNodeId>
            </DBNode>
        </DBNodes>
        <DBNodeNumber>2</DBNodeNumber>
        <PayType>Postpaid</PayType>
    </DBCluster>
</Items>
<TotalRecordCount>1</TotalRecordCount>
<PageNumber>1</PageNumber>
<RequestId>F7036AE7-20B7-43F8-9E58-558CCD******</RequestId>
<PageRecordCount>1</PageRecordCount>

JSON format

{
    "Items": {
        "DBCluster": [
            {
                "DBVersion": "5.6",
                "LockMode": "Unlock",
                "DBClusterDescription": "pc-****************",
                "DBClusterNetworkType": "VPC",
                "StorageUsed": 3150970880,
                "ZoneId": "cn-hangzhou-g",
                "DBClusterId": "pc-****************",
                "VpcId": "vpc-****************",
                "Engine": "POLARDB",
                "DBClusterStatus": "Running",
                "Tags": {
                    "Tag": [
                        {
                            "Value": "1111",
                            "Key": "test1"
                        },
                        {
                            "Value": "2222",
                            "Key": "test2"
                        }
                    ]
                },
                "ExpireTime": "",
                "DBNodeClass": "polar.mysql.x4.large",
                "RegionId": "cn-hangzhou",
                "Expired": false,
                "CreateTime": "2019-01-10T09:33:58Z",
                "DBType": "MySQL",
                "DBNodes": {
                    "DBNode": [
                        {
                            "DBNodeRole": "Writer",
                            "DBNodeClass": "polar.mysql.x4.large",
                            "DBNodeId": "pi-****************"
                        },
                        {
                            "DBNodeRole": "Reader",
                            "DBNodeClass": "polar.mysql.x4.large",
                            "DBNodeId": "pi-****************"
                        }
                    ]
                },
                "DBNodeNumber": "2",
                "PayType": "Postpaid"
            }
        ]
    },
    "TotalRecordCount": 1,
    "PageNumber": 1,
    "RequestId": "F7036AE7-20B7-43F8-9E58-558CCD******",
    "PageRecordCount": 1
}

Error codes

For a list of error codes, visit the API Error Center.