Check if the table exists¶
Checks whether the given table name exists in the specified database.
POST $CLOUDSIGMA_API_BASE/catalog/table/exist
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 target database ID. Prepare the personal access token, target workspace ID, and database ID that can access the target workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/table/exist" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"database_id": '"$DATABASE_ID"',
"name": "<TABLE_NAME>"
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Database ID. |
|
string |
Yes |
The name of the table to check. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"data": true
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Existence check results. |
|
boolean |
|
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |