Update database¶
Update database description. This interface does not support renaming.
POST $CLOUDSIGMA_API_BASE/catalog/database/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 database list to obtain the target database ID. Prepare the personal access token, target workspace ID, and database ID that can access the target workspace.
Request body¶
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>"
}'
Do not submit the name field. This interface does not support modifying the database name. Submitting this field will cause the request to fail.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Database ID. |
|
string |
No |
Updated instructions. Omitting or empty string will clear the existing description. |
This interface does not support renaming the database. Do not pass in name, even if you fill in null, it will fail.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": 2
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer or null |
Updated database ID. When not provided by the server, it is |
Error response¶
{
"code": "ErrDatabaseRenameUnsupported",
"msg": "不支持重命名数据库"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |