You can call this operation to query detailed information of tables in a specified database.

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 ListTables

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

DatabaseId String Yes 1

The ID of the database.

PageNumber Integer Yes 1

The number of the page to return.

Tid Long Yes -1

The ID of the tenant in Data Management (DMS) Enterprise.

PageSize Integer No 10

The number of entries to return on each page.

SearchName String No test

The keyword used to query tables. Prefix match is supported.

Response parameters

Parameter Type Example Description
ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message.

RequestId String B16FB618-5E96-4FFD-BB0D-490C890A4030

The ID of the request.

Success Boolean true

Indicates whether the request was successful.

TableList

The detailed information of tables.

Table

The detailed information of a table.

DatabaseId String 1

The ID of the database.

Encoding String utf8

The encoding format of the table.

Engine String innodb

The engine of the table.

NumRows Long 1

The number of rows in the table. This is a statistical value and does not indicate the accurate number of rows.

OwnerIdList 1

The IDs of table owners.

OwnerIds

The ID of a table owner.

OwnerNameList owner_name

The nicknames of table owners.

OwnerNames

The nickname of a table owner.

StoreCapacity Long 1024

The storage space occupied by the table. This is a statistical value and does not indicate the accurate storage space.

TableId String 1

The ID of the table.

TableName String test

The name of the table.

TableSchemaName String test_db

The name of the database to which the table belongs.

TableType String NORMAL

The type of the table, which is usually set to NORMAL.

TotalCount Long 12

The total number of tables that met the query conditions.

Examples

Sample requests


http(s)://[Endpoint]/? Action=ListTables
&DatabaseId=1
&PageNumber=1
&Tid=-1
&<Common request parameters>

Sample success responses

XML format

<TableList>
    <Table>
        <TableSchemaName>xxx_test</TableSchemaName>
        <OwnerNameList>
            <OwnerNames>xxx</OwnerNames>
            <OwnerNames>xxx[RAM user]</OwnerNames>
        </OwnerNameList>
        <DatabaseId>116367</DatabaseId>
        <Encoding>utf8mb4</Encoding>
        <NumRows>3</NumRows>
        <StoreCapacity>1</StoreCapacity>
        <TableName>base_user</TableName>
        <TableType>NORMAL</TableType>
        <OwnerIdList>
            <OwnerIds>88653</OwnerIds>
            <OwnerIds>104442</OwnerIds>
        </OwnerIdList>
        <Engine>InnoDB</Engine>
        <TableId>18396363</TableId>
    </Table>
    <Table>
        <TableSchemaName>xxx_test</TableSchemaName>
        <OwnerNameList>
            <OwnerNames>xxx</OwnerNames>
            <OwnerNames>xxx[RAM user]</OwnerNames>
        </OwnerNameList>
        <DatabaseId>116367</DatabaseId>
        <Encoding>utf8mb4</Encoding>
        <NumRows>2</NumRows>
        <StoreCapacity>1</StoreCapacity>
        <TableName>biz_orders</TableName>
        <TableType>NORMAL</TableType>
        <OwnerIdList>
            <OwnerIds>88653</OwnerIds>
            <OwnerIds>104442</OwnerIds>
        </OwnerIdList>
        <Engine>InnoDB</Engine>
        <TableId>18390459</TableId>
    </Table>
</TableList>
<TotalCount>12</TotalCount>
<RequestId>B16FB618-5E96-4FFD-BB0D-490C890A4030</RequestId>
<Success>true</Success>

JSON format

{
	"TableList":{
		"Table":[
			{
				"TableSchemaName":"xxx_test",
				"OwnerNameList":{
					"OwnerNames":[
						"xxx",
						"xxx[RAM user]"
					]
				},
				"DatabaseId":116367,
				"Encoding":"utf8mb4",
				"NumRows":3,
				"TableName":"base_user",
				"StoreCapacity":1,
				"TableType":"NORMAL",
				"Engine":"InnoDB",
				"OwnerIdList":{
					"OwnerIds":[
						88653,
						104442
					]
				},
				"TableId":18396363
			},
			{
				"TableSchemaName":"xxx_test",
				"OwnerNameList":{
					"OwnerNames":[
						"xxx",
						"xxx[RAM user]"
					]
				},
				"DatabaseId":116367,
				"Encoding":"utf8mb4",
				"NumRows":2,
				"TableName":"biz_orders",
				"StoreCapacity":1,
				"TableType":"NORMAL",
				"Engine":"InnoDB",
				"OwnerIdList":{
					"OwnerIds":[
						88653,
						104442
					]
				},
				"TableId":18390459
			}
		]
	},
	"TotalCount":12,
	"RequestId":"B16FB618-5E96-4FFD-BB0D-490C890A4030",
	"Success":true
}

Error codes

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