You can call this operation to query the topology of a data table.

You can call this operation only for logical databases.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetTableDBTopology

The operation that you want to perform. Set the value to GetTableDBTopology.

TableGuid String Yes IDB_L_9032.db-test.yuyang_test

The globally unique identifier (GUID) of the table in Data Management (DMS).

Note
  • You can call the ListLogicTables operation with ReturnGuid set to true to query the GUIDs of logical tables in a specific logical database.
  • You can call the ListTables operation with ReturnGuid set to true to query the GUIDs of tables in a specific physical database.
Tid Long No 123

The ID of the tenant.

Note The ID of the tenant is displayed when you move the pointer over the profile picture in the upper-right corner of the DMS console. For more information, see Tenant information.
RegionId String No cn-hangzhou

The ID of the region. For the valid values of this parameter, see RegionID parameter.

Note Set the value to the ID of the region to which your applications are close.

Response parameters

Parameter Type Example Description
DBTopology Struct

Details about the topology of the data table.

DataSourceList Array of DataSource

The data sources.

DatabaseList Array of Database

The physical databases.

DbId String 489347

The ID of the database.

DbName String db-test

The name of the database.

DbType String MYSQL

The type of the database. For the valid values of this parameter, see DbType parameter.

EnvType String pre

The type of the environment. Valid values:

  • product: production environment
  • dev: development environment
  • pre: staging environment
  • test: test environment
  • sit: SIT environment
  • uat: UAT environment
  • pet: stress testing environment
  • stag: STAG environment
Note For more information, see Change the environment type of an instance.
TableList Array of Table

The physical tables.

TableId String 151977812

The ID of the table.

TableName String yuyang_test_0000

The name of the table.

TableType String NORMAL

The type of the table. This is a reserved field.

DbType String MYSQL

The type of the database. For the valid values of this parameter, see DbType parameter.

Host String xxx.mysql.polardb.rds.aliyuncs.com

The endpoint of the data source.

Port Integer 3306

The port used to connect to the data source.

Sid String def

The system identifier (SID) of the data source.

TableGuid String IDB_L_9032.db-test.yuyang_test

The GUID of the table in DMS.

TableName String yuyang_test

The name of the table.

Note
  • If a logical table is queried, the name of the logical table is returned.
  • If a physical table is queried, the name of the physical table is returned.
ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message.

RequestId String 853F7FD4-D922-4EFB-931C-D253EF159E06

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

Examples

Sample requests

http(s)://[Endpoint]/? Action=GetTableDBTopology
&<Common request parameters>

Sample success responses

XML format

<RequestId>55B7CF50-4610-4707-B2B2-5EF2BE000367</RequestId>
<DBTopology>
    <TableName>yuyang_test</TableName>
    <TableGuid>IDB_L_9032.db-test.yuyang_test</TableGuid>
    <DataSourceList>
        <DatabaseList>
            <DbId>489347</DbId>
            <DbName>db-test</DbName>
            <TableList>
                <TableId>151977811</TableId>
                <TableName>yuyang_test_0000</TableName>
            </TableList>
            <TableList>
                <TableId>151977812</TableId>
                <TableName>yuyang_test_0001</TableName>
            </TableList>
            <TableList>
                <TableId>151977813</TableId>
                <TableName>yuyang_test_0002</TableName>
            </TableList>
            <TableList>
                <TableId>151977814</TableId>
                <TableName>yuyang_test_0003</TableName>
            </TableList>
            <TableList>
                <TableId>151977815</TableId>
                <TableName>yuyang_test_0004</TableName>
            </TableList>
            <EnvType>dev</EnvType>
            <DbType>polardb</DbType>
        </DatabaseList>
        <Port>3306</Port>
        <Host>xxx.mysql.polardb.rds.aliyuncs.com</Host>
        <DbType>polardb</DbType>
    </DataSourceList>
</DBTopology>
<Success>true</Success>

JSON format

{
  "RequestId": "55B7CF50-4610-4707-B2B2-5EF2BE000367",
  "DBTopology": {
    "TableName": "yuyang_test",
    "TableGuid": "IDB_L_9032.db-test.yuyang_test",
    "DataSourceList": [
      {
        "DatabaseList": [
          {
            "DbId": 489347,
            "DbName": "db-test",
            "TableList": [
              {
                "TableId": 151977811,
                "TableName": "yuyang_test_0000"
              },
              {
                "TableId": 151977812,
                "TableName": "yuyang_test_0001"
              },
              {
                "TableId": 151977813,
                "TableName": "yuyang_test_0002"
              },
              {
                "TableId": 151977814,
                "TableName": "yuyang_test_0003"
              },
              {
                "TableId": 151977815,
                "TableName": "yuyang_test_0004"
              }
            ],
            "EnvType": "dev",
            "DbType": "polardb"
          }
        ],
        "Port": 3306,
        "Host": "xxx.mysql.polardb.rds.aliyuncs.com",
        "DbType": "polardb"
      }
    ]
  },
  "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.