Query database details¶
Query database details by ID.
POST https://moi.matrixorigin.cn/newmoi/catalog/database/info
Preparation before calling¶
First query the database list to obtain the target database ID. Prepare the personal access token, target workspace ID, and database ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$DATABASE_ID: The database ID to be queried.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/database/info" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": '"$DATABASE_ID"'
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Database ID. |
Successful response¶
Returns 200 and database details on success.
{
"code": "OK",
"msg": "OK",
"data": {
"database": {
"id": 2,
"name": "orders",
"display_name": "orders",
"description": "订单库",
"display_description": "订单库"
}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
Database ID. |
|
string |
The original name of the database. |
|
string |
Database description. |
|
string |
Database display name; returned if there is a value. |
|
string |
Database display description; returned if there is a value. |
Error response¶
{
"code": "ErrObjectNotFound",
"msg": "数据库不存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body or database ID is invalid. |
Use a positive integer ID from the database list. |
|
|
The current identity does not have read permission. |
Requesting permission to |
|
|
The database does not exist or is not readable. |
Verify database ID and workspace. |
|
|
The server failed to read the details. |
Try again later. |
Follow-up operations¶
When modifications are needed Update database. When returning the list Query file products.