Update volume¶
Update the volume’s name and description.
POST $CLOUDSIGMA_API_BASE/catalog/volume/update
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. 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 can access the target workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/volume/update" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": '"$VOLUME_ID"',
"name": "<VOLUME_NAME>",
"description": "<VOLUME_DESCRIPTION>"
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Volume ID. |
|
string |
No |
Update name when non-empty, must be a valid identifier. Omitting or empty string retains the original name. |
|
string |
No |
Update instructions when not empty. Omitting or empty string retains the original description and cannot be cleared by null value. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": 789
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
The ID of the volume has been updated. |
Error response¶
{
"code": "ErrAlreadyExists",
"msg": "对象已存在"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |