Preview the data source when created

Before creating the knowledge base, preview the number of files and data tables to be selected based on the Catalog selection range. This interface is read-only and does not create a knowledge base, data source or processing task.

HTTP
POST $CLOUDSIGMA_API_BASE/semantic-models/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. The selection range only supports Catalog data: database_tables is used for data tables in a Database, and volume_files is used for files in a Volume. When all_selected: false, the corresponding selected_table_ids or selected_file_ids must be passed. When all_selected: true, the corresponding exclusion ID can be passed.

Request parameters

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/semantic-models/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": 101,
        "all_selected": false,
        "selected_table_ids": [201]
      }
    ]
  }'

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.

Successful response

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

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.file_count

integer

The number of files in the preview range.

data.table_count

integer

The number of data tables in the preview range.

data.total_count

integer

The total quantity after deduplication.

Last updated on