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.

HTTP
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

Shell
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

model_id

integer

Yes

The knowledge base ID to preview source selection.

Request body

Field

Type

Required

Description

source_selections

array of object

Yes

Source selection to preview.

source_selections[].kind

string

Yes

database_tables or volume_files.

source_selections[].database_id

integer

Conditional

Catalog Database ID of database_tables.

source_selections[].volume_id

integer

Conditional

Catalog Volume ID of volume_files.

source_selections[].all_selected

boolean

Yes

true Selects all objects in the current range. The corresponding explicit selection ID must be provided when false.

source_selections[].selected_table_ids

integer (integer array)

Conditional

When all_selected is false, the catalog table ID is explicitly selected.

source_selections[].selected_file_ids

array of string

Conditional

When all_selected is false, the catalog file ID is explicitly selected.

source_selections[].excluded_table_ids

integer (integer array)

No

Catalog table IDs to exclude when selecting all.

source_selections[].excluded_file_ids

array of string

No

Catalog file IDs to exclude when selecting all.

source_selections[].filters

object

No

Filter further by table name, file name or extension.

source_selections[].filters.table_name

string

No

Table name filter conditions.

source_selections[].filters.file_name

string

No

File name filter conditions.

source_selections[].filters.file_ext

array of string

No

File extension filter.

Catalog Database

database_tables

No

selected_table_ids

Catalog Volume

volume_files

No

selected_file_ids

Other kind or non-Catalog data sources cannot be used.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "file_count": 2,
    "table_count": 1,
    "total_count": 3
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.file_count

integer

The number of file sources that will be added after deduplication.

data.table_count

integer

The number of table sources that will be added after deduplication.

data.total_count

integer

Total number of file and table sources.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "invalid source selection",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

null on error.

Last updated on