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.
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¶
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 |
|---|---|---|---|
|
integer |
Yes |
The knowledge base ID to which the data source to be checked belongs. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
array of string |
No |
The file ID to check. |
|
array[integer] |
No |
Table ID to check. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"file_ids": ["file_01"],
"table_ids": [456]
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
The return data of this operation. |
|
array of string |
One of the requested file IDs already exists as a source. |
|
integer (integer array) |
One of the requested table IDs already exists as a source. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid source identifiers",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
|