Querying Database Tables
Function
This API is used to query the database tables of a specified DB instance. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
URI
GET /v3/{project_id}/instances/{instance_id}/tables
|
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
|
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
Default Value en-us |
Response 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) |
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
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot