All Products
Search
Document Center

Data Management:ListTables

Last Updated:Mar 14, 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

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListTablesRead
  • All Resources
    *
    none
none

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
TableListobject []

The details of the tables.

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