Update database¶
Update database description. This interface does not support renaming.
POST https://moi.matrixorigin.cn/newmoi/catalog/database/update
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: Database ID to update.
Do not pass in name; this field will cause the request to fail.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/database/update" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": '"$DATABASE_ID"',
"description": "<DATABASE_DESCRIPTION>"
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Database ID. |
|
string |
No |
Updated description. |
Successful response¶
Returns 200 and the ID of the updated database on success.
{
"code": "OK",
"msg": "OK",
"data": {
"id": 2
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer or null |
Updated database ID; |
Error response¶
{
"code": "ErrDatabaseRenameUnsupported",
"msg": "不支持重命名数据库",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body or database ID is invalid. |
Use positive integer IDs. |
|
|
The request body contains |
Removed |
|
|
The current identity does not have update permissions. |
Requesting permission to |
|
|
Target a read-only system or a reserved database. |
Do not update this database. |
|
|
The server failed to update the database. |
Try again later. |
Follow-up operations¶
Use the same resource identifier Query database details to confirm the update result.