Query table information¶
Query table definition, table creation SQL and statistical information.
POST $CLOUDSIGMA_API_BASE/catalog/table/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 target table ID, or prepare the table name and database positioning parameters. Prepare the personal access token, target workspace ID, and table location information that can access the target workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/table/info" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": '"$TABLE_ID"'
}'
The request can be queried by table ID, or by table name plus database ID/system database name.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer condition required |
No |
Table ID. You do not need to pass the name after providing it. |
|
string condition is required |
No |
Table name. Required when |
|
integer condition required |
No |
The database ID of the non-system database. Mutually exclusive with |
|
string condition is required |
No |
System database name. Mutually exclusive with |
|
boolean |
No |
Whether to return column statistics. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"name": "orders",
"lines": 120,
"size": 4096,
"created_at": 1735689600,
"updated_at": 1735689600,
"created_by": "user@example.com",
"description": "订单表",
"comment": "订单明细",
"columns": [
{
"name": "id",
"type": "INT",
"is_pk": true
}
],
"create_sql": "CREATE TABLE orders (id INT PRIMARY KEY)",
"stats": [
{
"name": "id",
"type": "INT",
"max_value": "100",
"min_value": "1"
}
]
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Table name. |
|
integer |
Number of table rows. |
|
integer |
Table size, in bytes. |
|
integer |
Unix timestamp of creation time in seconds. |
|
integer |
Unix timestamp of the update time in seconds. |
|
string |
Creator ID. |
|
string |
Table description. |
|
string |
Table comments. |
|
array of object |
Column definition. |
|
string |
Create table SQL. |
|
array of object |
Column statistics. |
|
string |
Column name. |
|
string |
Full SQL data type, including precision information where applicable. |
|
boolean |
Whether it is a primary key column. Returned if there is a value. |
|
string |
Column comments. Returned if there is a value. |
|
string |
Column default value. Returned if there is a value. |
|
string |
Column name. |
|
string |
Full SQL data type, including precision information where applicable. |
|
boolean |
Whether it is a primary key column. Returned if there is a value. |
|
string |
Column default value. Returned if there is a value. |
|
string |
Column comments. Returned if there is a value. |
|
string |
The maximum value of the column. |
|
string |
The minimum value of the column. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "表定位参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |