Batch query table information¶
Batch query table definitions and metadata by table ID.
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¶
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 |
|---|---|---|---|
|
integer (integer array) |
Yes |
List of table IDs to query. |
Successful response¶
{
"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 |
|---|---|---|
|
string |
|
|
string |
Descriptive text for request processing. |
|
object |
response data. |
|
array of object |
Queryed table information. |
|
string |
Table name. |
|
integer |
Number of table rows. Can be omitted if not set. |
|
integer |
Table size. Can be omitted if not set. |
|
integer |
Creation time, in RFC 3339 format. |
|
integer |
Last updated in RFC 3339 format. |
|
string |
Creator ID. |
|
string |
Description. |
|
string |
Note. |
|
array of object |
Column definition. |
|
string |
Column name. |
|
string |
The data type of the column. |
|
boolean |
Whether it is a primary key column. Returned if there is a value. Can be omitted if not set. |
|
string |
Column comments. Returned if there is a value. Can be omitted if not set. |
|
string |
Column default value. Returned if there is a value. Can be omitted if not set. |
|
string |
Create table SQL. |
|
array of object |
Column statistics. |
|
string |
Column name. |
|
string |
The data type of the column. |
|
boolean |
Whether it is a primary key column. Returned if there is a value. Can be omitted if not set. |
|
string |
Column default value. Returned if there is a value. Can be omitted if not set. |
|
string |
Column comments. Returned if there is a value. Can be omitted if not set. |
|
string |
The maximum value of the column. |
|
string |
The minimum value of the column. |
Error response¶
{
"code": "ErrServer",
"msg": "服务器内部错误"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |