Check if the data source has been added

Check whether the requested Catalog file and table already exist in the knowledge base as a data source. Use this interface to remove duplicates before adding sources.

HTTP
POST $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/sources/existence

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 files and tables to be checked in the Catalog. Prepare a personal access token and target workspace ID that can access the target workspace.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/sources/existence" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "file_ids": ["'"$FILE_ID"'"],
    "table_ids": ['"$TABLE_ID"']
  }'

Path parameters

Field

Type

Required

Description

model_id

integer

Yes

The knowledge base ID to which the data source to be checked belongs.

Request body

Field

Type

Required

Description

file_ids

array of string

No

The file ID to check.

table_ids

array[integer]

No

Table ID to check.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "file_ids": ["file_01"],
    "table_ids": [456]
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

The return data of this operation.

data.file_ids

array of string

One of the requested file IDs already exists as a source.

data.table_ids

integer (integer array)

One of the requested table IDs already exists as a source.

Error response

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

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

null on error.

Last updated on