Preview the data source to be added¶
Preview the number of deduplicated files and tables before selecting a source by database or volume. Confirm the quantity before adding the source.
POST $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/source-selections/preview
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 confirm the identification of the database, volume, and its tables and files to be selected in the Catalog. Prepare a personal access token and target workspace ID that can access the target workspace.
This interface only previews Catalog data.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/source-selections/preview" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"source_selections": [
{
"kind": "database_tables",
"database_id": '"$DATABASE_ID"',
"all_selected": false,
"selected_table_ids": ['"$TABLE_ID"']
}
]
}'
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
The knowledge base ID to preview source selection. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
array of object |
Yes |
Source selection to preview. |
|
string |
Yes |
|
|
integer |
Conditional |
Catalog Database ID of |
|
integer |
Conditional |
Catalog Volume ID of |
|
boolean |
Yes |
|
|
integer (integer array) |
Conditional |
When |
|
array of string |
Conditional |
When |
|
integer (integer array) |
No |
Catalog table IDs to exclude when selecting all. |
|
array of string |
No |
Catalog file IDs to exclude when selecting all. |
|
object |
No |
Filter further by table name, file name or extension. |
|
string |
No |
Table name filter conditions. |
|
string |
No |
File name filter conditions. |
|
array of string |
No |
File extension filter. |
|
|
No |
|
|
|
No |
|
Other kind or non-Catalog data sources cannot be used.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"file_count": 2,
"table_count": 1,
"total_count": 3
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
response data. |
|
integer |
The number of file sources that will be added after deduplication. |
|
integer |
The number of table sources that will be added after deduplication. |
|
integer |
Total number of file and table sources. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid source selection",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
|