All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::POLARDB::DBClusters

Last Updated:Dec 06, 2024

DATASOURCE::POLARDB::DBClusters is used to query the information about PolarDB clusters.

Syntax

{
  "Type": "DATASOURCE::POLARDB::DBClusters",
  "Properties": {
    "Description": String,
    "DbVersion": String,
    "ResourceGroupId": String,
    "DbClusterId": String,
    "Expired": String,
    "DbType": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Description

String

No

Yes

The description of the cluster.

None.

DbVersion

String

No

Yes

The version of the database engine.

Valid values:

  • 5.6

  • 5.7

  • 8.0

  • 11

  • 14

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

DbClusterId

String

No

Yes

The cluster ID.

None.

Expired

String

No

Yes

Specifies whether the cluster has expired.

Valid values:

  • true

  • false

DbType

String

No

Yes

The type of the database engine.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values

Fn::GetAtt

  • DbClusterIds: the IDs of the clusters.

  • DBClusters: details of the clusters.

Property

Type

Description

Constraint

DbClusterIds

List

The IDs of the clusters.

None.

DBClusters

List

Details of the clusters.

None.

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

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 the cluster expires.

DeletionLock

String

Indicates whether the cluster is locked and cannot be deleted.

Valid values:

  • 0: The cluster is not locked and can be deleted.

  • 1: The cluster is locked and cannot be deleted.

Note

If you set this property to 1, the cluster cannot be deleted.

DbClusterId

String

The cluster ID.

None.

VpcId

String

The ID of the virtual private cloud (VPC).

None.

Description

String

The description of the cluster.

None.

Tags

List

The tags.

Example:

[ {
      "Key" : "MySQL",
      "Value" : "5.6"
    } ]

ClusterNetworkType

String

The network type of the cluster.

None.

RegionId

String

The region ID.

None.

ResourceGroupId

String

The ID of the resource group.

None.

DbNodes

List

Details of the nodes.

Example:

[ {
      "DBNodeClass" : "polar.mysql.x4.large",
      "ZoneId" : "cn-hangzhou-i",
      "DBNodeRole" : "Reader",
      "DBNodeId" : "pi-****************",
      "RegionId" : "cn-hangzhou"
    } ]

DbNodeClass

String

The node type.

None.

Expired

String

Indicates whether the cluster has expired.

Valid values:

  • true

  • false

Note

This property is returned if PaymentType is set to Prepaid.

Status

String

The status of the cluster.

None.

DbVersion

String

The version of the database engine.

None.

ZoneId

String

The zone ID.

None.

StorageUsed

String

The used storage of the cluster.

Unit: bytes.

Engine

String

The database engine of the cluster.

None.

StorageSpace

String

The storage space that uses the subscription billing method.

Unit: bytes.

DbType

String

The type of the database engine.

None.

DbNodeNumber

Integer

The number of nodes.

None.

ExpireTime

String

The expiration time of the cluster.

  • A specific value is returned if PaymentType is set to Prepaid.

  • An empty string is returned if PaymentType is set to Postpaid.

PaymentType

String

The billing method.

Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

CreateTime

String

The creation time.

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::POLARDB::DBClusters
    Properties:
      DbVersion: '5.7'
Outputs:
  DbClusterIds:
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - DbClusterIds
  DBClusters:
    Description: The list of db clusters.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - DBClusters
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::POLARDB::DBClusters",
      "Properties": {
        "DbVersion": "5.7"
      }
    }
  },
  "Outputs": {
    "DbClusterIds": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "DbClusterIds"
        ]
      }
    },
    "DBClusters": {
      "Description": "The list of db clusters.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "DBClusters"
        ]
      }
    }
  }
}