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 this API

Configure the regional API endpoint and authentication, and select the target workspace.

First query the database list to obtain the database ID.

Set the operation-specific values used in the request:

  • $DATABASE_ID: The database ID to be queried.

Request

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

Request body

Parameter

Type

Required

Description

id

integer

Yes

Database ID.

Successful response

Returns 200 and table overview on success.

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "tables": [
      {
        "name": "orders",
        "columns": ["id", "amount"]
      }
    ]
  }
}

The response fields are as follows.

Field

Type

Description

data.tables

array

Overview of tables in the database.

data.tables[].name

string

Table name.

data.tables[].columns

string[]

List of table column names.

In this document, [] after a type means an array; for example, string[] is an array of strings. In field paths, [] means each item in an array; for example, data.tables[].name is the name field of each item in data.tables.

Error response

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

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

The database ID is invalid.

Use a valid database ID.

403

ErrForbidden

The current identity does not have permission to read the database.

Use credentials with read permissions.

500

ErrServer

The server failed to generate table overview.

Try again later.

Last updated on