DATASOURCE::DRDS::DrdsDB

DATASOURCE::DRDS::DrdsDB类型用于查看实例下的单个数据库详情。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

DrdsDatabaseName

String

数据库名称。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • DrdsDatabaseName:数据库名称。

  • StorageType:数据库拆分模式。

  • SplitMode:数据库类型。

  • InstRole:实例角色。

  • Schema:系统为拆分后的数据库分配的Schema ID。

  • CreateTime:数据库创建时间。

示例

  • YAML格式

                                  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格式

                            {
      "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"
            ]
          }
        }
      }
    }