CreateKnowledgeBaseBuildTaskInstance
Creates a build instance based on the current configuration of a specified task, and freezes the input and runtime configurations for this execution.
Operation description
Creates a knowledge base build task instance. The tenant and caller identities are determined by the POP authentication context.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:CreateKnowledgeBaseBuildTaskInstance |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| KnowledgeBaseId |
string |
Yes |
The knowledge base to which the task belongs. |
12345678-1234-4234-8234-123456789abc |
| TaskId |
string |
Yes |
The ID of the source task. |
10001 |
| ClientToken |
string |
No |
The idempotency token for the creation request. Specify this parameter for automatic retries and keep the same value for retries of the same operation. |
run-001 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The unique identifier of the request, which can be used to troubleshoot issues. |
00000000-0000-4000-8000-000000000001 |
| Success |
boolean |
Indicates whether the request is successful. |
|
| Data |
object |
The business data returned when the request is successful. |
|
| TaskInstanceId |
string |
The ID of the current execution. |
20001 |
| TaskId |
string |
The ID of the source task. |
10001 |
| KnowledgeBaseId |
string |
The knowledge base to which the instance belongs, used for scope validation and queries. |
12345678-1234-4234-8234-123456789abc |
| TriggerType |
string |
The trigger type of the current execution, such as manual, periodic, or supported events. |
MANUAL |
| Status |
string |
The overall status of the current execution. |
PENDING |
| CurrentStage |
string |
The current business stage. This parameter is returned when reliable records are available. For common build stages and semantic model import stages, refer to the domain model. This parameter does not replace the overall status. |
INITIALIZE |
| InputSnapshot |
object |
The non-sensitive input snapshot after selection and parsing for the current execution. This snapshot does not change when the task is updated. |
|
| SelectedInput |
object |
The snapshot of the selection conditions in the task definition when the instance is created. This snapshot does not change when the task is updated. |
|
| ProjectIds |
array |
The DataWorks workspace IDs selected for workspace-scoped builds. The values are non-empty and deduplicated. |
|
|
integer |
The DataWorks workspace IDs selected for workspace-scoped builds. The values are non-empty and deduplicated. |
12345 |
|
| SourceIds |
array |
The IDs of the registered sources in the knowledge base. The values are deduplicated. Whether this parameter is required and the allowed source types are determined by the task input scenario. For more information, see the following table. |
|
|
string |
The IDs of the registered sources in the knowledge base. The values are deduplicated. Whether this parameter is required and the allowed source types are determined by the task input scenario. For more information, see the following table. |
src-document-001 |
|
| Entities |
array<object> |
The Data Map entities such as databases, schemas, and tables selected for data asset-scoped builds. The values are non-empty and deduplicated. |
|
|
object |
|||
| EntityId |
string |
The metadata entity ID returned by Data Map. The client passes this ID as is and does not concatenate database, schema, or table identifiers. |
maxcompute-table:::project_name:schema_name:table_name |
| EntityType |
string |
The entity level, such as DATABASE, SCHEMA, or TABLE. The server validates this parameter based on the Data Map identity. The presence of an enumeration value does not guarantee that all engines support it. |
TABLE |
| YamlUploadId |
string |
The YAML upload session ID in the knowledge base used for SEMANTIC_MODEL import tasks. This ID is bound when the task is created and cannot be mixed with other input scopes. |
upload-yaml-001 |
| KnowledgeObjectIds |
array |
The knowledge object IDs required when building from document objects in the knowledge base. The values must be non-empty and deduplicated. Each item is a KnowledgeObjectId with Type=DOCUMENT in the knowledge base. Do not mix these IDs with SourceIds used for external connector synchronization scopes. |
|
|
string |
The knowledge object IDs required when building from document objects in the knowledge base. The values must be non-empty and deduplicated. Each item is a KnowledgeObjectId with Type=DOCUMENT in the knowledge base. Do not mix these IDs with SourceIds used for external connector synchronization scopes. |
obj-document-001 |
|
| DocumentSourceCount |
integer |
The number of external document sources selected for the current execution. This parameter is not returned when it is not applicable. |
1 |
| ResolvedEntities |
array<object> |
The actual Data Map entities resolved from the project, database, or schema scope for the current execution. This parameter is not returned when it is not applicable. |
|
|
object |
|||
| EntityId |
string |
The metadata entity ID returned by Data Map. The client passes this ID as is and does not concatenate database, schema, or table identifiers. |
maxcompute-table:::project_name:schema_name:table_name |
| EntityType |
string |
The entity level, such as DATABASE, SCHEMA, or TABLE. The server validates this parameter based on the Data Map identity. The presence of an enumeration value does not guarantee that all engines support it. |
TABLE |
| ResolvedEntityCount |
integer |
The total number of resolved entities. This parameter returns the exact count even when the array is not returned due to its size. |
42 |
| ConfigSnapshot |
object |
The snapshot of the model, content locale, and runtime resources for the current execution. This snapshot does not change when the task is updated. |
|
| ProjectId |
integer |
The DataWorks workspace ID used for the current execution. This ID is frozen from the task definition when the instance is created. |
67890 |
| LlmModel |
string |
The specific model ID actually used and frozen for the current execution. The value AUTO is not returned. This parameter can be empty for tasks that do not call models, such as pure synchronization tasks. |
model-001 |
| ContentLocale |
string |
The content locale used for the current execution. |
zh-CN |
| RuntimeResource |
object |
The resource group and Builder CUs actually used for the current execution. |
|
| ResourceGroupId |
string |
The DataWorks resource group ID used by the actual Builder nodes. The server validates that this resource group is available in the workspace corresponding to the top-level ProjectId of the task. |
rg-001 |
| Cu |
integer |
The Builder compute specifications. Valid values: 4 to 16. If this parameter is omitted during creation, the effective value is 4. The read operation returns the effective value. |
4 |
| Error |
object |
The error code and secure error message returned when the request fails. |
|
| Code |
string |
The business error code, which is used to determine the error type when the request fails. |
InvalidParameter |
| Message |
string |
The secure error message returned when the request fails. |
The request parameters are invalid |
| GeneratedModels |
array<object> |
For model import only: the confirmed ModelId and VersionNo. For the structure, see the Get instance documentation. |
|
|
object |
|||
| ModelId |
string |
The model ID generated by the semantic layer. You can use this ID as a KnowledgeObjectId to read the corresponding semantic model. |
01MODELULID |
| VersionNo |
integer |
The current version of the SEMANTIC_MODEL being read. Pass this value when updating content. The version can be edited in place. |
1 |
| CreateTime |
integer |
The time when the instance was created. |
1790200400000 |
| StartedTime |
integer |
The time when the execution started. This parameter is optional. |
1790200001000 |
| FinishedTime |
integer |
The time when the execution finished. This parameter is optional. |
1790200060000 |
| Code |
string |
The business error code, which is used to determine the error type when the request fails. |
InvalidParameter |
| Message |
string |
The secure error message returned when the request fails. |
The request parameters are invalid |
Examples
Success response
JSON format
{
"RequestId": "00000000-0000-4000-8000-000000000001",
"Success": false,
"Data": {
"TaskInstanceId": "20001",
"TaskId": "10001",
"KnowledgeBaseId": "12345678-1234-4234-8234-123456789abc",
"TriggerType": "MANUAL",
"Status": "PENDING",
"CurrentStage": "INITIALIZE",
"InputSnapshot": {
"SelectedInput": {
"ProjectIds": [
12345
],
"SourceIds": [
"src-document-001"
],
"Entities": [
{
"EntityId": "maxcompute-table:::project_name:schema_name:table_name",
"EntityType": "TABLE"
}
],
"YamlUploadId": "upload-yaml-001",
"KnowledgeObjectIds": [
"obj-document-001"
]
},
"DocumentSourceCount": 1,
"ResolvedEntities": [
{
"EntityId": "maxcompute-table:::project_name:schema_name:table_name",
"EntityType": "TABLE"
}
],
"ResolvedEntityCount": 42
},
"ConfigSnapshot": {
"ProjectId": 67890,
"LlmModel": "model-001",
"ContentLocale": "zh-CN",
"RuntimeResource": {
"ResourceGroupId": "rg-001",
"Cu": 4
}
},
"Error": {
"Code": "InvalidParameter",
"Message": "The request parameters are invalid"
},
"GeneratedModels": [
{
"ModelId": "01MODELULID",
"VersionNo": 1
}
],
"CreateTime": 1790200400000,
"StartedTime": 1790200001000,
"FinishedTime": 1790200060000
},
"Code": "InvalidParameter",
"Message": "The request parameters are invalid"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The request parameters are invalid. | |
| 500 | InternalError | The knowledge base operation failed. Use RequestId to contact support. | |
| 403 | Forbidden | You are not authorized to perform this operation. | |
| 403 | DataAgentUnavailable | DataAgent is unavailable; check the product edition and usage quota | |
| 403 | DataAgentNotActivated | Activate DataAgent pay-as-you-go before configuring or starting a knowledge base build | |
| 404 | ResourceNotFound | The requested resource does not exist or is not visible. | |
| 409 | Conflict | The resource state conflicts with this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.