Update volume¶
Update the volume’s name and description.
POST https://moi.matrixorigin.cn/newmoi/catalog/volume/update
Preparation before calling¶
First query the object in the database to obtain the target volume ID. Prepare the personal access token, target workspace ID, and volume 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.$VOLUME_ID: Volume ID to be updated.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/volume/update" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": '"$VOLUME_ID"',
"name": "<VOLUME_NAME>",
"description": "<VOLUME_DESCRIPTION>"
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Volume ID. |
|
string |
Yes |
New name, must be a valid identifier. |
|
string |
No |
New description. |
Successful response¶
Returns 200 and the ID of the updated volume on success.
{
"code": "OK",
"msg": "OK",
"data": {
"id": 789
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
The ID of the updated volume. |
Error response¶
{
"code": "ErrAlreadyExists",
"msg": "对象已存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Check volume ID and name. |
|
|
The current identity does not have write permissions for the volume. |
Use credentials with write access, or contact your administrator for authorization. |
|
|
There is already a volume with the same name under the same database. |
Use another name. |
|
|
The service cannot update the volume. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
Use the same resource identifier Query volume details to confirm the update result.