Update knowledge base¶
Update knowledge base description or compatible legacy source field. The knowledge base name cannot be modified after it is created; the current name must be returned when updating. Please use a separate data source interface for new access sources.
PUT $CLOUDSIGMA_API_BASE/semantic-models/{model_id}
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the knowledge base details to confirm the current definition.
Set the operation-specific values used in the request:
$MODEL_ID: ID of the knowledge base to be updated.
Request¶
curl -X PUT "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "$CURRENT_KNOWLEDGE_BASE_NAME",
"description": "$DESCRIPTION"
}'
Path parameters
Parameters |
Type |
Description |
|---|---|---|
|
integer |
Knowledge base ID. |
Request body
Submit the current complete name, and you can submit description and the interface-compatible tables, files source definitions at the same time.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The name of the current knowledge base. The value is immutable and must be consistent with the created name. |
|
string |
No |
Updated knowledge base description. |
|
JSON |
No |
Compatible legacy table source definition. |
|
JSON |
No |
Compatible legacy file source definition. |
Successful response¶
Returns 200 on success. The interface returns a confirmation tag; if you need to read the updated complete object, please call the query knowledge base details interface again.
{
"code": "OK",
"msg": "OK",
"data": {
"updated": true
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
boolean |
|
Error response¶
{
"code": "ErrNotFound",
"msg": "resource not found",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Using a valid ID, return the current name and submit a complete and valid update definition. |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
The caller does not have permission to update the knowledge base. |
Check workspace and object authorization. |
|
|
The knowledge base does not exist or is not visible to the current caller. |
Relist the knowledge base and confirm the ID. |
|
|
The service failed to complete the update. |
Keep the desensitized response information and try again. |
Follow-up operations¶
Query knowledge base details to confirm the update result.