DATASOURCE::OTS::Tables类型用于获取当前实例下已创建的所有表的表名。

语法

{
  "Type": "DATASOURCE::OTS::Tables",
  "Properties": {
    "InstanceName": String,
    "TableName": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
InstanceName String 实例名称。
TableName String 表名。

返回数据(Fn::GetAtt)

  • TableNames:表名列表。
  • Tables:表格详情列表。
属性名称 类型 描述 约束
TableNames List 表名列表。
Tables List 表格详情列表。
TableName String 表名。

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "InstanceName": {
          "Type": "String",
          "Description": "The name of the instance to which the table belongs."
        }
      },
      "Resources": {
        "Tables": {
          "Type": "DATASOURCE::OTS::Tables",
          "Properties": {
            "InstanceName": {
              "Ref": "InstanceName"
            }
          }
        }
      },
      "Outputs": {
        "TableNames": {
          "Description": "The list of table names.",
          "Value": {
            "Fn::GetAtt": [
              "Tables",
              "TableNames"
            ]
          }
        },
        "Tables": {
          "Description": "The list of tables.",
          "Value": {
            "Fn::GetAtt": [
              "Tables",
              "Tables"
            ]
          }
        }
      }
    }
  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      InstanceName:
        Type: String
        Description: The name of the instance to which the table belongs.
    Resources:
      Tables:
        Type: DATASOURCE::OTS::Tables
        Properties:
          InstanceName:
            Ref: InstanceName
    Outputs:
      TableNames:
        Description: The list of table names.
        Value:
          Fn::GetAtt:
            - Tables
            - TableNames
      Tables:
        Description: The list of tables.
        Value:
          Fn::GetAtt:
            - Tables
            - Tables