All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::DRDS::DrdsDB

Last Updated:Sep 29, 2024

DATASOURCE::DRDS::DrdsDB is used to query the information about a single database on an instance.

Syntax

{
  "Type": "DATASOURCE::DRDS::DrdsDB",
  "Properties": {
    "DrdsDatabaseName": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DrdsDatabaseName

String

Yes

Yes

The database name.

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

  • DrdsDatabaseName: the database name.

  • StorageType: the partition mode of the database.

  • SplitMode: the database type.

  • InstRole: the instance role.

  • Schema: the schema ID that is assigned to the partitioned database by the system.

  • CreateTime: the time when the database was created.

Examples

  • YAML format

                                  ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DrdsDatabaseName:
        Description:
          en: The name of the Drds database.
        Required: true
        Type: String
      RefreshOptions:
        AllowedValues:
        - Always
        - Never
        Default: Never
        Description:
          en: 'The refresh strategy for the datasource resource when the stack is updated.
            Valid values:
    
            - Never: Never refresh the datasource resource when the stack is updated.
    
            - Always: Always refresh the datasource resource when the stack is updated.
    
            Default is Never.'
        Required: false
        Type: String
    Resources:
      ExtensionDataSource:
        Properties:
          DrdsDatabaseName:
            Ref: DrdsDatabaseName
          RefreshOptions:
            Ref: RefreshOptions
        Type: DATASOURCE::DRDS::DrdsDB
    Outputs:
      CreateTime:
        Description: Database creation timestamp.
        Value:
          Fn::GetAtt:
          - ExtensionDataSource
          - CreateTime
      DrdsDatabaseName:
        Description: The name of the Drds database.
        Value:
          Fn::GetAtt:
          - ExtensionDataSource
          - DrdsDatabaseName
      InstRole:
        Description: 'Database type: MASTER primary instance, SLAVE read-only instance.'
        Value:
          Fn::GetAtt:
          - ExtensionDataSource
          - InstRole
      Schema:
        Description: The schema ID that is assigned to the partitioned database by the
          system.
        Value:
          Fn::GetAtt:
          - ExtensionDataSource
          - Schema
      SplitMode:
        Description: "The partition mode of the database.Valid values: \n* HORIZONTAL:\
          \ The database is horizontally partitioned.\n* VERTICAL: The database is vertically\
          \ partitioned."
        Value:
          Fn::GetAtt:
          - ExtensionDataSource
          - SplitMode
      StorageType:
        Description: 'The storage type of the Drds database. Valid values:
    
          * RDS
    
          * PolarDB'
        Value:
          Fn::GetAtt:
          - ExtensionDataSource
          - StorageType
                            
  • JSON format

                            {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DrdsDatabaseName": {
          "Type": "String",
          "Description": {
            "en": "The name of the Drds database."
          },
          "Required": true
        },
        "RefreshOptions": {
          "Type": "String",
          "Description": {
            "en": "The refresh strategy for the datasource resource when the stack is updated. Valid values:\n- Never: Never refresh the datasource resource when the stack is updated.\n- Always: Always refresh the datasource resource when the stack is updated.\nDefault is Never."
          },
          "AllowedValues": [
            "Always",
            "Never"
          ],
          "Required": false,
          "Default": "Never"
        }
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::DRDS::DrdsDB",
          "Properties": {
            "DrdsDatabaseName": {
              "Ref": "DrdsDatabaseName"
            },
            "RefreshOptions": {
              "Ref": "RefreshOptions"
            }
          }
        }
      },
      "Outputs": {
        "DrdsDatabaseName": {
          "Description": "The name of the Drds database.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DrdsDatabaseName"
            ]
          }
        },
        "StorageType": {
          "Description": "The storage type of the Drds database. Valid values:\n* RDS\n* PolarDB",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "StorageType"
            ]
          }
        },
        "SplitMode": {
          "Description": "The partition mode of the database.Valid values: \n* HORIZONTAL: The database is horizontally partitioned.\n* VERTICAL: The database is vertically partitioned.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "SplitMode"
            ]
          }
        },
        "InstRole": {
          "Description": "Database type: MASTER primary instance, SLAVE read-only instance.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "InstRole"
            ]
          }
        },
        "Schema": {
          "Description": "The schema ID that is assigned to the partitioned database by the system.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Schema"
            ]
          }
        },
        "CreateTime": {
          "Description": "Database creation timestamp.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "CreateTime"
            ]
          }
        }
      }
    }