All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::OTS::Tables

最終更新日:Dec 02, 2024

DATASOURCE::OTS::Tables is used to query the names of all tables that are created in an instance.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

InstanceName

String

Yes

Yes

The instance name.

None.

TableName

String

No

Yes

The table 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)

  • TableNames: the names of the tables.

  • Tables: details of the tables.

Property

Type

Description

Constraint

TableNames

List

The names of the tables.

None.

Tables

List

Details of the tables.

None.

TableName

String

The table name.

None.

Examples

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