ListTables

更新时间:
复制 MD 格式

Lists the details of all tables in a database.

Operation description

This API can only be used for database instances where the control mode is set to secure collaboration.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:ListTables

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

The tenant ID. You can obtain this ID by calling GetUserActiveTenant or ListUserTenants.

3***

DatabaseId

string

Yes

The ID of the physical database. You can obtain this ID by calling ListDatabases or SearchDatabase.

1860****

PageNumber

integer

No

The number of the page to return.

1

PageSize

integer

No

The number of entries per page.

10

SearchName

string

No

The keyword for a fuzzy search on table names.

test

ReturnGuid

boolean

No

Specifies whether to return the globally unique identifier (GUID) of the table. Valid values:

  • true: Returns the GUID of the table.

  • false: Does not return the GUID of the table.

true

RealLoginUserUid

string

No

The ID of the user that calls the API.

1234

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of matching tables.

1

RequestId

string

The request ID.

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

ErrorCode

string

The error code.

UnknownError

TableList

object

Table

array<object>

The list of tables.

array<object>

DatabaseId

string

The ID of the physical database.

1860****

TableName

string

The table name.

consumption_records

StoreCapacity

integer

The approximate storage space that the table uses, in MB.

1024

OwnerIdList

object

OwnerIds

array

The user IDs of the table owners.

string

The user ID of a table owner.

51****

Description

string

The description of the table.

test

Encoding

string

The encoding of the table.

utf8

OwnerNameList

object

OwnerNames

array

The nicknames of the table owners.

string

The nickname of a table owner.

owner_name

TableSchemaName

string

The database that contains the table.

qntest

TableType

string

The type of the table. Default: NORMAL.

NORMAL

TableGuid

string

The GUID of the table in DMS.

IDB_44743****.qntest.consumption_records

Engine

string

The table engine.

InnoDB

NumRows

integer

The estimated number of rows in the table.

10085

TableId

string

The table ID.

44743****

ErrorMessage

string

The error message.

UnknownError

Success

boolean

Indicates if the request was successful. Valid values:

  • true: The request succeeded.

  • false: The request failed.

true

Examples

Success response

JSON format

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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.