Query database details

Query database details by ID.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/database/info

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/info" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": '"$DATABASE_ID"'
  }'

Field

Type

Required

Description

id

integer

Yes

Database ID.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "database": {
      "id": 2,
      "name": "orders",
      "display_name": "orders",
      "description": "订单库",
      "display_description": "订单库"
    }
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.database.id

integer

Database ID.

data.database.name

string

Database original name.

data.database.description

string

Database description.

data.database.display_name

string

Database display name. Returned if there is a value.

data.database.display_description

string

Database display instructions. Returned if there is a value.

Error response

JSON
{
  "code": "ErrObjectNotFound",
  "msg": "数据库不存在"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on