DescribeDBClusters

更新时间:
复制 MD 格式

Queries the details of PolarDB clusters, including clusters that you are authorized to access through Resource Access Management (RAM).

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:DescribeDBClusters

list

*DBCluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#DbClusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

Note

You can call the DescribeRegions operation to query the available regions.

cn-hangzhou

DBClusterIds

string

No

The IDs of one or more clusters. Separate multiple IDs with a comma.

pc-****************

DBClusterDescription

string

No

The cluster description. Fuzzy search is supported.

pc-****************

ConnectionString

string

No

The database endpoint.

********.rwlb.polardb-pg-public.rds.aliyuncs.com

DBClusterStatus

string

No

The cluster status. For more information, see Cluster state table.

Running

DBType

string

No

The database engine. Valid values:

  • MySQL

  • PostgreSQL

  • Oracle

MySQL

DescribeType

string

No

The query mode. Set the value to Simple to return only the basic metadata of clusters.

Note

If you do not specify this parameter, the operation returns detailed information about the clusters.

Simple

DBVersion

string

No

The database version.

5.6

RecentCreationInterval

integer

No

Filters the query to return only clusters created within the specified number of days. Valid values: 0 to 15.

7

RecentExpirationInterval

integer

No

Filters the query to return only clusters that will expire within the specified number of days. Valid values: 0 to 15.

6

Expired

boolean

No

Specifies whether the cluster has expired. Valid values:

  • true

  • false

true

PageSize

integer

No

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

Default value: 30.

30

PageNumber

integer

No

The page number. The value must be an integer that is greater than 0. Default value: 1.

10

ResourceGroupId

string

No

The resource group ID.

rg-**********

Tag

array<object>

No

The tags used to filter clusters.

object

No

Key

string

No

The key of a tag used for filtering. You can specify up to 20 tags. The n in Tag.n.Key indicates the tag number and must be a consecutive integer starting from 1.

Note

The tag key cannot exceed 128 characters in length and cannot start with aliyun, acs:, http://, or https://.

MySQL

Value

string

No

The tag value.

Note

The tag value cannot exceed 128 characters in length and cannot start with aliyun, acs:, http://, or https://.

5.6

PayType

string

No

The billing method. Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

Postpaid

DBNodeIds

string

No

The IDs of one or more nodes. Separate multiple IDs with a comma.

pi-***************

Response elements

Element

Type

Description

Example

object

TotalRecordCount

integer

The total number of records.

16

PageRecordCount

integer

The number of clusters returned on the current page.

5

RequestId

string

The request ID.

9B7BFB11-C077-4FE3-B051-F69CEB******

PageNumber

integer

The page number.

12

Items

object

The details of the clusters.

DBCluster

array<object>

The list of clusters.

array<object>

VpcId

string

The VPC ID.

vpc-****************

VswitchId

string

The VSwitch ID.

vsw-***************

ExpireTime

string

The expiration time of the cluster.

Note

This parameter is returned only for Prepaid (subscription) clusters. For Postpaid (pay-as-you-go) clusters, an empty string is returned.

2020-11-14T16:00:00Z

Expired

string

Indicates whether the cluster has expired. Valid values:

  • true

  • false

Note

This parameter is returned only for Prepaid (subscription) clusters.

false

DBNodeNumber

integer

The number of nodes.

2

CreateTime

string

The time when the cluster was created.

2020-08-14T05:58:42Z

PayType

string

The billing method. Valid values:

  • Postpaid: pay-as-you-go.

  • Prepaid: subscription.

Prepaid

StoragePayType

string

The billing method for storage. Valid values:

  • Postpaid: pay-as-you-go (pay-by-capacity).

  • Prepaid: subscription (pay-by-space).

Prepaid

ServerlessType

string

The serverless type. A value of AgileServerless indicates a serverless cluster. An empty string indicates a regular cluster.

AgileServerless

StrictConsistency

string

Indicates whether multi-zone strong consistency is enabled for the cluster. Valid values:

  • ON: Multi-zone strong consistency is enabled. This applies to Standard Edition clusters that are deployed in three zones.

  • OFF: Multi-zone strong consistency is disabled.

ON

DBNodeClass

string

The node specification.

polar.mysql.x4.large

Tags

object

The tags of the cluster.

Tag

array<object>

The list of tags.

object

Key

string

The tag key.

MySQL

Value

string

The tag value.

5.6

DBType

string

The database type.

MySQL

LockMode

string

The lock mode of the cluster. Valid values:

  • Unlock: The cluster is not locked.

  • ManualLock: The cluster is manually locked.

  • LockByExpiration: The cluster is automatically locked after it expires.

Unlock

DBNodes

object

The details of the nodes in the cluster.

DBNode

array<object>

The list of nodes.

object

DBNodeClass

string

The node specification.

polar.mysql.x4.large

ZoneId

string

The zone ID.

cn-hangzhou-i

DBNodeRole

string

The role of the node. Valid values:

  • Writer: the primary node.

  • Reader: a read-only node.

  • ColumnReader: a column store read-only node.

  • AI: an AI node.

Reader

DBNodeId

string

The node ID.

pi-****************

RegionId

string

The region ID.

cn-hangzhou

Serverless

string

Indicates whether the serverless feature is enabled for the node.

  • A value of ON indicates that the feature is enabled.

  • An empty string indicates that it is disabled.

ON

ImciSwitch

string

Indicates whether the columnstore index feature is enabled. Valid values:

  • ON: enabled

  • OFF: disabled

OFF

HotReplicaMode

string

Indicates whether the hot standby feature is enabled. Valid values:

  • ON: enabled

  • OFF: disabled

OFF

RegionId

string

The region ID.

cn-hangzhou

DeletionLock

integer

The deletion lock status of the cluster. Valid values:

  • 0: unlocked.

  • 1: locked.

Note

You cannot delete a locked cluster.

0

DBVersion

string

The database version.

5.6

DBClusterId

string

The cluster ID.

pc-****************

DBClusterStatus

string

The cluster status.

Running

ResourceGroupId

string

The resource group ID.

rg-************

SearchStorageUsed

integer

The storage usage of search nodes.

89227945573

StorageSpace

integer

The storage space of the subscription cluster. Unit: bytes.

50

DBClusterNetworkType

string

The network type of the cluster.

VPC

DBClusterDescription

string

The cluster description.

GDN-1

ZoneId

string

The zone ID.

cn-hangzhou-i

Engine

string

The database engine.

POLARDB

Category

string

The edition of the cluster. Valid values:

  • Normal: cluster edition

  • Basic: single node edition

  • Archive: X-Engine edition

  • NormalMultimaster: multi-master cluster (Database/Table) edition

Normal

AiType

string

The type of AI node. Valid values:

  • SearchNode: The cluster contains a search node.

  • DLNode: The cluster contains an AI node.

Valid values:

  • SearchNode|DLNode :

    Both

  • DLNode :

    DLNode

  • SearchNode :

    SearchNode

SearchNode

CpuCores

string

The number of CPU cores.

1

MemorySize

string

The memory size of the node. Unit: MB.

2048

RemoteMemorySize

string

The remote memory size. Unit: MB.

3612

StorageType

string

The storage type of an Enterprise Edition cluster. Valid values:

  • HighPerformance: PL5

  • Standard: PL4

The storage type of a Standard Edition cluster. Valid values:

  • essdpl0

  • essdpl1

  • essdpl2

  • essdpl3

  • essdautopl

essdautopl

HotStandbyCluster

string

Indicates whether storage hot standby is enabled. Valid values:

  • ON: enabled

  • OFF: disabled

OFF

SubCategory

string

The specification type of the compute node. Valid values:

  • Exclusive: dedicated specification

  • General: general-purpose specification

Exclusive

StorageUsed

integer

The storage space used. Unit: bytes.

3009413120

Examples

Success response

JSON format

{
  "TotalRecordCount": 16,
  "PageRecordCount": 5,
  "RequestId": "9B7BFB11-C077-4FE3-B051-F69CEB******",
  "PageNumber": 12,
  "Items": {
    "DBCluster": [
      {
        "VpcId": "vpc-****************",
        "VswitchId": "vsw-***************",
        "ExpireTime": "2020-11-14T16:00:00Z",
        "Expired": "false",
        "DBNodeNumber": 2,
        "CreateTime": "2020-08-14T05:58:42Z",
        "PayType": "Prepaid",
        "StoragePayType": "Prepaid",
        "ServerlessType": "AgileServerless",
        "StrictConsistency": "ON",
        "DBNodeClass": "polar.mysql.x4.large",
        "Tags": {
          "Tag": [
            {
              "Key": "MySQL",
              "Value": "5.6"
            }
          ]
        },
        "DBType": "MySQL",
        "LockMode": "Unlock",
        "DBNodes": {
          "DBNode": [
            {
              "DBNodeClass": "polar.mysql.x4.large",
              "ZoneId": "cn-hangzhou-i",
              "DBNodeRole": "Reader",
              "DBNodeId": "pi-****************",
              "RegionId": "cn-hangzhou",
              "Serverless": "ON",
              "ImciSwitch": "OFF",
              "HotReplicaMode": "OFF"
            }
          ]
        },
        "RegionId": "cn-hangzhou",
        "DeletionLock": 0,
        "DBVersion": "5.6",
        "DBClusterId": "pc-****************",
        "DBClusterStatus": "Running",
        "ResourceGroupId": "rg-************",
        "SearchStorageUsed": 89227945573,
        "StorageSpace": 50,
        "DBClusterNetworkType": "VPC",
        "DBClusterDescription": "GDN-1",
        "ZoneId": "cn-hangzhou-i",
        "Engine": "POLARDB",
        "Category": "Normal",
        "AiType": "SearchNode",
        "CpuCores": "1",
        "MemorySize": "2048",
        "RemoteMemorySize": "3612",
        "StorageType": "essdautopl",
        "HotStandbyCluster": "OFF",
        "SubCategory": "Exclusive",
        "StorageUsed": 3009413120
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidRegionId.Malformed The specified parameter RegionId is not valid. The specified RegionId parameter is invalid.
400 NumberExceed.Tags The Tags parameter's number is exceed. The number of tags specified in the tags parameter exceeds the limit.
400 InvalidPageSize.Malformed The specified parameter PageSize is not valid. The specified PageSize parameter is invalid.
400 InvalidPageNumber.Malformed The specified parameter PageNumber is not valid. The specified PageNumber parameter is invalid.
400 InvalidRecentCreationInterval.Malformed The specified parameter RecentCreationInterval is not valid. The specified RecentCreationInterval parameter is invalid.
400 InvalidRecentExpirationInterval.Malformed The specified parameter RecentExpirationInterval is not valid. The specified RecentExpirationInterval parameter is invalid.
500 InternalError The request processing has failed due to some unknown error, exception or failure. The request failed to be processed because unknown errors, exceptions, or failures have occurred.
404 DBTypeOrDBVersion.Malformed The specified DBType does not match DBVersion. The specified values of DBType and DBVersion do not match.
503 ServiceUnavailable The request has failed due to a temporary failure of the server. A temporary server error occurred.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.