Querying Database Objects
Function
This API is used to query database objects.
Authorization Information
Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
das:connection:list
list
connection
-
das:connections:list
-
URI
GET /v3/{project_id}/connections/{connection_id}/get-db-obj-list
| 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 supported. Default Value N/A |
| connection_id | Yes | String | Definition Connection ID established between a database account and the database. The database user ID is created using the API in Creating an Instance Connection. Constraints N/A Range The value is a UUID containing 36 characters. Only letters, digits, and hyphens (-) are allowed. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| db_name | No | String | Definition Database name Constraints N/A Range N/A Default Value N/A |
| db_id | No | String | Definition Database ID Constraints N/A Range N/A Default Value N/A |
| schema_name | No | String | Definition Schema name Constraints N/A Range N/A Default Value N/A |
| table_name | No | String | Definition Table name Constraints N/A Range N/A Default Value N/A |
| table_id | No | String | Definition Table ID Constraints N/A Range N/A Default Value N/A |
| obj_name | No | String | Definition Object name Constraints N/A Range N/A Default Value N/A |
| keywords | No | String | Definition Search keyword Constraints N/A Range N/A Default Value N/A |
| cur_page | No | String | Definition Page number Constraints N/A Range [0, 2^31 – 1]. The actual value depends on the query result. Default Value N/A |
| per_page | No | String | Definition Number of records on each page Constraints N/A Range [0, 100]. The actual value depends on the query result. Default Value N/A |
| order_by | No | String | Definition Primary sorting field Constraints N/A Range N/A Default Value N/A |
| order | No | String | Definition Primary sorting field sequence Constraints N/A Range
Default Value N/A |
| extra_order_by | No | String | Definition Secondary sorting field Constraints N/A Range N/A Default Value N/A |
| extra_order | No | String | Definition Secondary sorting field sequence Constraints N/A Range N/A Default Value N/A |
| obj_type | No | String | Definition Object type Constraints N/A Range
Default Value N/A |
| ret_type | No | String | Definition Return type Constraints N/A Range
Default Value N/A |
| is_sys | No | String | Definition Whether an object is a system-level object Constraints N/A Range
Default Value N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | Array of objects in Table 4 | Definition Database object information list |
| total | Long | Definition List size Range N/A |
| object_type | String | Definition Object type Range N/A |
| Parameter | Type | Description |
|---|---|---|
| database_name | String | Definition Database name Range N/A |
| character_set_name | String | Definition Database character set Range N/A |
| table_num | String | Definition Number of tables Range N/A |
| table_size | String | Definition Table size Range N/A |
| index_size | String | Definition Index size Range N/A |
| db_size | String | Definition Database size Range N/A |
| table_name | String | Definition Table name Range N/A |
| rows | String | Definition Number of table rows Range N/A |
| data_length | String | Definition Table data size Range N/A |
| index_length | String | Definition Table index size Range N/A |
| engine | String | Definition Table engine type Range N/A |
| create_time | String | Definition Creation time, in the format of YYYY-MM-DD HH:MM:SS Range N/A |
| create_timestamp | Long | Definition Table name, in milliseconds Range N/A |
| comments | String | Definition Table remarks Range N/A |
Example Requests
GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/connections/179e525e-0e9c-4dcc-9dd7-ee2f36121e23/get-db-obj-list?cur_page=1&per_page=10&db_name=test_db&keywords=&order=&order_by=&extra_order=&extra_order_by=&obj_type=table
Example Responses
Status code: 200
Success.
{
"data": [
{
"database_name": "__recyclebin__",
"character_set_name": "utf8mb4",
"table_num": "0",
"table_size": "0B",
"index_size": "0B",
"db_size": "0B"
},
{
"database_name": "test_db",
"character_set_name": "utf8mb4",
"table_num": "0",
"table_size": "0B",
"index_size": "0B",
"db_size": "0B"
}
],
"total": 2,
"object_type": "database"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success. |
| 400 | Client error. |
| 500 | Server error. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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