Query table overview

List the tables and column names of each table in the specified database.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/table/overview

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 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/table/overview" \
  -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": {
    "tables": [
      {
        "name": "orders",
        "columns": [
          "id",
          "amount"
        ]
      }
    ]
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.tables

array of object

Overview of tables in the database.

data.tables[].name

string

Table name.

data.tables[].columns

array of string

A list of table column names.

Error response

JSON
{
  "code": "ErrServer",
  "msg": "服务器内部错误"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on