UpdateKnowledgeBaseBuildTask

Updated at:

Updates the configuration of a knowledge base build task without changing the input and configuration snapshots of created instances.

Operation description

Updates a knowledge base build task. The tenant and caller identities are determined by the POP authentication context.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:UpdateKnowledgeBaseBuildTask

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

KnowledgeBaseId

string

Yes

The ID of the associated knowledge base.

12345678-1234-4234-8234-123456789abc

TaskId

string

Yes

The task ID.

10001

Name

string

No

The new task name.

Sales Project Knowledge Build

Description

string

No

The new description.

Sales Metrics and Policy Documents

ProjectId

integer

No

The workspace used for future runs.

67890

Input

object

No

Completely replaces the original Input.

ProjectIds

array

No

The DataWorks workspace IDs selected for workspace-scoped builds. This parameter cannot be empty and must contain unique values.

integer

No

The DataWorks workspace IDs selected for workspace-scoped builds. This parameter cannot be empty and must contain unique values.

12345

SourceIds

array

No

The IDs of registered sources in the current knowledge base. The values must be unique. Whether this parameter is required and the allowed source types depend on the task input scenario. See the following table.

string

No

The IDs of registered sources in the current knowledge base. The values must be unique. Whether this parameter is required and the allowed source types depend on the task input scenario. See the following table.

src-document-001

Entities

array<object>

No

The Data Map entities such as databases, schemas, and tables selected for data asset-scoped builds. This parameter cannot be empty and must contain unique values.

object

No

EntityId

string

No

The metadata entity ID returned by Data Map. The client must pass this value as-is without concatenating database, schema, or table identifiers.

maxcompute-table:::project_name:schema_name:table_name

EntityType

string

No

The entity level, such as DATABASE, SCHEMA, or TABLE. The server validates this value against Data Map identities. The presence of an enum value does not guarantee support across all engines.

TABLE

YamlUploadId

string

No

The YAML upload session ID in the current 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

No

Required, non-empty, and unique when building from document objects in the current knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. Do not mix this parameter with SourceIds for external connector synchronization scopes.

string

No

Required, non-empty, and unique when building from document objects in the current knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. Do not mix this parameter with SourceIds for external connector synchronization scopes.

obj-document-001

Trigger

object

No

Completely replaces the original Trigger.

Mode

string

No

The trigger mode. Valid values: MANUAL and PERIODIC. Instances of manual tasks are not created automatically.

MANUAL

Cron

string

No

The DataWorks scheduling cron expression. This parameter is provided only when Mode is set to PERIODIC.

0 0 2 * * ?

Enabled

boolean

No

Specifies whether to enable or disable automatic periodic triggering. This parameter is provided only when Mode is set to PERIODIC and does not indicate the instance status.

RuntimeResource

object

No

Updates the runtime resources based on the submitted fields. If ResourceGroupId or Cu is not provided, the original value is retained.

ResourceGroupId

string

No

The DataWorks resource group ID used by the actual builder nodes. The server validates its availability in the workspace corresponding to the top-level ProjectId of the task.

rg-001

Cu

integer

No

The compute specifications for the builder. Valid values: 4 to 16. If omitted during creation, the default value is 4. Read operations return the effective value.

4

LlmModel

string

No

The specific model ID or AUTO.

AUTO

ContentLocale

string

No

The content language.

zh-CN

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The unique identifier of the request, which can be used for troubleshooting.

00000000-0000-4000-8000-000000000001

Success

boolean

Indicates whether the request is successful.

Data

object

The business data returned when the request is successful.

TaskId

string

The stable task ID.

10001

KnowledgeBaseId

string

The ID of the associated knowledge base.

12345678-1234-4234-8234-123456789abc

Name

string

The task name.

Sales Project Knowledge Build

Description

string

The task description. This parameter is optional.

Sales Metrics and Policy Documents

Type

string

The task type. Valid values: PROJECT_SPACE_BUILD, SEMANTIC_GRAPH, DOCUMENT_GRAPH, DOCUMENT_SYNC, DOCUMENT_SYNC_AND_GRAPH, and SEMANTIC_MODEL. SEMANTIC_MODEL is used only for YAML imports.

PROJECT_SPACE_BUILD

LlmModel

string

The specific model ID or AUTO for tasks that require a model. If omitted during creation, the value defaults to AUTO. This parameter is not configured for tasks that do not call a model.

AUTO

ContentLocale

string

The content language of the task. This parameter is optional and is explicitly selected when the task is created.

zh-CN

ProjectId

integer

The DataWorks workspace ID where the task runs. This is different from the build asset scope specified by Input.ProjectIds.

67890

Input

object

The input scope specified based on the task type.

ProjectIds

array

The DataWorks workspace IDs selected for workspace-scoped builds. This parameter cannot be empty and must contain unique values.

integer

The DataWorks workspace IDs selected for workspace-scoped builds. This parameter cannot be empty and must contain unique values.

12345

SourceIds

array

The IDs of registered sources in the current knowledge base. The values must be unique. Whether this parameter is required and the allowed source types depend on the task input scenario. See the following table.

string

The IDs of registered sources in the current knowledge base. The values must be unique. Whether this parameter is required and the allowed source types depend on the task input scenario. 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. This parameter cannot be empty and must contain unique values.

object

EntityId

string

The metadata entity ID returned by Data Map. The client must pass this value as-is without concatenating 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 value against Data Map identities. The presence of an enum value does not guarantee support across all engines.

TABLE

YamlUploadId

string

The YAML upload session ID in the current 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

Required, non-empty, and unique when building from document objects in the current knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. Do not mix this parameter with SourceIds for external connector synchronization scopes.

string

Required, non-empty, and unique when building from document objects in the current knowledge base. Each item is a KnowledgeObjectId with Type=DOCUMENT in the current knowledge base. Do not mix this parameter with SourceIds for external connector synchronization scopes.

obj-document-001

RuntimeResource

object

The task runtime resource group and builder compute specifications.

ResourceGroupId

string

The DataWorks resource group ID used by the actual builder nodes. The server validates its availability in the workspace corresponding to the top-level ProjectId of the task.

rg-001

Cu

integer

The compute specifications for the builder. Valid values: 4 to 16. If omitted during creation, the default value is 4. Read operations return the effective value.

4

Trigger

object

The manual or periodic trigger configuration.

Mode

string

The trigger mode. Valid values: MANUAL and PERIODIC. Instances of manual tasks are not created automatically.

MANUAL

Cron

string

The DataWorks scheduling cron expression. This parameter is provided only when Mode is set to PERIODIC.

0 0 2 * * ?

Enabled

boolean

Specifies whether to enable or disable automatic periodic triggering. This parameter is provided only when Mode is set to PERIODIC and does not indicate the instance status.

CreateTime

integer

The creation time.

1790200000000

ModifyTime

integer

The time when the definition was last modified.

1790200300000

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": {
    "TaskId": "10001",
    "KnowledgeBaseId": "12345678-1234-4234-8234-123456789abc",
    "Name": "Sales Project Knowledge Build",
    "Description": "Sales Metrics and Policy Documents",
    "Type": "PROJECT_SPACE_BUILD",
    "LlmModel": "AUTO",
    "ContentLocale": "zh-CN",
    "ProjectId": 67890,
    "Input": {
      "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"
      ]
    },
    "RuntimeResource": {
      "ResourceGroupId": "rg-001",
      "Cu": 4
    },
    "Trigger": {
      "Mode": "MANUAL",
      "Cron": "0 0 2 * * ?",
      "Enabled": false
    },
    "CreateTime": 1790200000000,
    "ModifyTime": 1790200300000
  },
  "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.