Update database

Update database description. This interface does not support renaming.

HTTP
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

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>"
  }'

Request body

Parameter

Type

Required

Description

id

integer

Yes

Database ID.

description

string

No

Updated description.

Successful response

Returns 200 and the ID of the updated database on success.

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

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer or null

Updated database ID; null if not provided by the server.

Error response

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

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

The request body or database ID is invalid.

Use positive integer IDs.

400

ErrDatabaseRenameUnsupported

The request body contains name.

Removed name and only updated the description.

403

ErrForbidden

The current identity does not have update permissions.

Requesting permission to database.update.

409

ErrReadonlySystemDatabase、ErrReadonlyReservedDatabase

Target a read-only system or a reserved database.

Do not update this database.

500

ErrServer

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.

Last updated on