Batch query table information

Batch query table definitions and metadata by table ID.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/table/multi_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 object in the database to obtain the table ID. Prepare a list of personal access tokens, target workspace IDs, and table IDs that can access the target workspace.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/table/multi_info" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ['"$TABLE_ID"']
  }'

Field

Type

Required

Description

ids

integer (integer array)

Yes

List of table IDs to query.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "tables": [
      {
        "name": "orders",
        "created_at": 0,
        "updated_at": 0,
        "created_by": "",
        "description": "",
        "comment": "",
        "columns": [],
        "create_sql": "CREATE TABLE orders (...)",
        "stats": []
      }
    ]
  }
}

Field

Type

Description

code

string

OK when the request is processed successfully.

msg

string

Descriptive text for request processing.

data

object

response data.

data.tables

array of object

Queryed table information.

data.tables[].name

string

Table name.

data.tables[].lines

integer

Number of table rows. Can be omitted if not set.

data.tables[].size

integer

Table size. Can be omitted if not set.

data.tables[].created_at

integer

Creation time, in RFC 3339 format.

data.tables[].updated_at

integer

Last updated in RFC 3339 format.

data.tables[].created_by

string

Creator ID.

data.tables[].description

string

Description.

data.tables[].comment

string

Note.

data.tables[].columns

array of object

Column definition.

data.tables[].columns[].name

string

Column name.

data.tables[].columns[].type

string

The data type of the column.

data.tables[].columns[].is_pk

boolean

Whether it is a primary key column. Returned if there is a value. Can be omitted if not set.

data.tables[].columns[].comment

string

Column comments. Returned if there is a value. Can be omitted if not set.

data.tables[].columns[].default

string

Column default value. Returned if there is a value. Can be omitted if not set.

data.tables[].create_sql

string

Create table SQL.

data.tables[].stats

array of object

Column statistics.

data.tables[].stats[].name

string

Column name.

data.tables[].stats[].type

string

The data type of the column.

data.tables[].stats[].is_pk

boolean

Whether it is a primary key column. Returned if there is a value. Can be omitted if not set.

data.tables[].stats[].default

string

Column default value. Returned if there is a value. Can be omitted if not set.

data.tables[].stats[].comment

string

Column comments. Returned if there is a value. Can be omitted if not set.

data.tables[].stats[].max_value

string

The maximum value of the column.

data.tables[].stats[].min_value

string

The minimum value of the column.

Error response

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

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on