Updated on 2025-10-20 GMT+08:00

Querying Database Tables

Function

This API is used to query the database tables of a specified DB instance. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

GET /v3/{project_id}/instances/{instance_id}/tables

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID.

Constraints

N/A

Range

N/A

Default Value

N/A

db_name

Yes

String

Definition

Database name.

Constraints

The name cannot be a template database and must be an existing database name.

Template databases include postgres, template0, template1, templatea, template_pdb, and templatem.

Range

N/A

Default Value

N/A

schema_name

Yes

String

Definition

Schema name.

Constraints

The name cannot be public or information_schema, and must be an existing schema name.

Range

N/A

Default Value

N/A

table_name_keyword

No

String

Definition

Table name keyword.

Constraints

N/A

Range

N/A

Default Value

N/A

offset

No

Integer

Definition

Offset where the query starts.

Constraints

N/A

Range

[0~2147483647)

Default Value

0

limit

No

Integer

Definition

Number of records displayed per page.

Constraints

N/A

Range

[1, 200]

Default Value

10

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

After the request is processed, the value of X-Subject-Token in the message header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn
  • en-us

Default Value

en-us

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

database_tables

Array of objects

Definition

Database tables. Each element in the list indicates a database table. For details, see Table 4.

total_count

Integer

Definition

Total number of database tables.

Range

[0~2147483647)

Table 4 DatabaseForListTable

Parameter

Type

Description

table_name

String

Definition

Table name.

Range

N/A

Example Request

GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/a7d62bf77aa04fceb52fbd57181c9e3ein14/tables?db_name=rds_test&schema_name=rds_test&offset=1&limit=10

Example Response

{
  "database_tables" : [ 
  {
    "table_name" : "rds-test"
  }, 
  {
    "table_name" : "testdb1"
   } ],
  "total_count" : 2
}

Status Codes

Error Codes

For details, see Error Codes.