Update database¶
Update database description. This interface does not support renaming.
POST $CLOUDSIGMA_API_BASE/catalog/database/update
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the database list to obtain the target database ID.
Set the operation-specific values used in the request:
$DATABASE_ID: Database ID to update.
Do not pass in name; this field will cause the request to fail.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/database/update" \
-H "X-API-Key: $CLOUDSIGMA_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.