View database list¶
List the databases you have access to. Use a name in the response to view the tables and views in that database.
POST https://moi.matrixorigin.cn/newmoi/meta/db/info
Preparation before calling¶
Prepare a personal access token and workspace ID that has access to the target workspace. The returned results only include databases accessible by the current identity.
The example below uses $AI_STUDIO_API_KEY as X-API-Key and $WORKSPACE_ID as X-Workspace-ID.
Call example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/meta/db/info" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Request body¶
This interface does not require a request body.
Successful response¶
{
"code": 200,
"data": {
"result": [
{
"db_name": "sales",
"display_name": "销售数据"
}
],
"total": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
List of databases that can be read by the current access credentials. |
|
string |
Database name. |
|
string |
Display name; can be omitted if not set. |
|
string |
Database owner; currently returned may be an empty string. |
|
boolean |
Whether it is a built-in database in the system. |
|
boolean |
Whether it is a subscription database. |
|
boolean |
Whether to contain published data. |
|
object |
Table metadata object. |
|
object |
View metadata object. |
|
integer |
Number of databases in |
In field paths, [] denotes each item in an array. For example, items[].name is the name field of each item in the items array.
After getting the database name from data.result[].db_name, use Query table in database to continue viewing the object.
Error response¶
codeinteger or string- Error code or status.
messagestring- Error message.
Error response example
{
"code": 503,
"message": "服务暂不可用"
}
Follow-up operations¶
Save the identification of the target item, and then query table information.