Update database

Update database description. This interface does not support renaming.

HTTP
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

Shell
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

id

integer

Yes

Database ID.

description

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

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 2
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer or null

Updated database ID. When not provided by the server, it is null.

Error response

JSON
{
  "code": "ErrDatabaseRenameUnsupported",
  "msg": "不支持重命名数据库"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on