All Products
Search
Document Center

Data Management:ListTables

Last Updated:Jul 15, 2024

Queries the tables in a database.

Operation description

You can call this operation only for database instances whose control mode is Security Collaboration.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TidlongNo

The ID of the tenant. You can call the GetUserActiveTenant or ListUserTenants operation to query the tenant ID.

3***
DatabaseIdstringYes

The ID of the physical database. You can call the ListDatabases or SearchDatabase operation to obtain the ID of the physical database.

1860****
PageNumberintegerYes

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page.

10
SearchNamestringNo

The name used to search for tables. Fuzzy search is supported.

test
ReturnGuidbooleanNo

Specifies whether to return the GUID of a table. Valid values:

  • true: returns the GUID of a table.
  • false: does not return the GUID of a table.
true

Response parameters

ParameterTypeDescriptionExample
object
TotalCountlong

The total number of tables that meet the query conditions.

1
RequestIdstring

The ID of the request.

B16FB618-5E96-4FFD-BB0D-490C890A4030
ErrorCodestring

The error code returned.

UnknownError
TableListarray<object>

The details of the tables.

object
DatabaseIdstring

The ID of the physical database.

1860****
TableNamestring

The table name.

consumption_records
StoreCapacitylong

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

1024
OwnerIdListarray

The ID list of the table owners.

string

The ID of the table owner.

51****
Descriptionstring

The description of the table.

test
Encodingstring

The encoding format of the table.

utf8
OwnerNameListarray

The nickname list of the table owners.

string

The nickname of the table owner.

owner_name
TableSchemaNamestring

The database in which the table resides.

qntest
TableTypestring

The type of the table. Default value: NORMAL.

NORMAL
TableGuidstring

The GUID of the table in DMS.

IDB_44743****.qntest.consumption_records
Enginestring

The engine of the table.

InnoDB
NumRowslong

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

10085
TableIdstring

The ID of the table.

44743****
ErrorMessagestring

The error message returned.

UnknownError
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "RequestId": "B16FB618-5E96-4FFD-BB0D-490C890A4030",
  "ErrorCode": "UnknownError",
  "TableList": {
    "Table": [
      {
        "DatabaseId": "1860****",
        "TableName": "consumption_records",
        "StoreCapacity": 1024,
        "OwnerIdList": {
          "OwnerIds": [
            "51****"
          ]
        },
        "Description": "test",
        "Encoding": "utf8",
        "OwnerNameList": {
          "OwnerNames": [
            "owner_name"
          ]
        },
        "TableSchemaName": "qntest",
        "TableType": "NORMAL",
        "TableGuid": "IDB_44743****.qntest.consumption_records",
        "Engine": "InnoDB",
        "NumRows": 10085,
        "TableId": "44743****"
      }
    ]
  },
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history