@nuclia/core / Exports / TaskManager
Class: TaskManager
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new TaskManager(kb
, nuclia
)
Parameters
Name | Type |
---|---|
kb | WritableKnowledgeBox |
nuclia | INuclia |
Defined in
libs/sdk-core/src/lib/db/task/task.ts:10
Properties
kb
• kb: WritableKnowledgeBox
Defined in
libs/sdk-core/src/lib/db/task/task.ts:7
nuclia
• nuclia: INuclia
Defined in
libs/sdk-core/src/lib/db/task/task.ts:8
Methods
deleteTask
▸ deleteTask(taskId
): Observable
<void
>
Delete a task so it is not listed anymore in getTasks. If the task is currently running, you should stop it before deleting it.
Parameters
Name | Type |
---|---|
taskId | string |
Returns
Observable
<void
>
Defined in
libs/sdk-core/src/lib/db/task/task.ts:31
getTask
▸ getTask(taskId
): Observable
<InspectTaskResponse
>
Get the status of a tasks
Parameters
Name | Type |
---|---|
taskId | string |
Returns
Observable
<InspectTaskResponse
>
Defined in
libs/sdk-core/src/lib/db/task/task.ts:73
getTasks
▸ getTasks(count?
): Observable
<TaskListResponse
>
List the available tasks on a KB and get the list of tasks running and done.
Parameters
Name | Type | Description |
---|---|---|
count? | number | How many finished task to return. By default, the server is returning 10. |
Returns
Observable
<TaskListResponse
>
Defined in
libs/sdk-core/src/lib/db/task/task.ts:20
restartTask
▸ restartTask(taskId
): Observable
<StartStopTaskResponse
>
Restart a running task.
Parameters
Name | Type |
---|---|
taskId | string |
Returns
Observable
<StartStopTaskResponse
>
Defined in
libs/sdk-core/src/lib/db/task/task.ts:64
startTask
▸ startTask(name
, parameters
, apply?
): Observable
<StartStopTaskResponse
>
Start a new task
Parameters
Name | Type | Default value | Description |
---|---|---|---|
name | TaskName | undefined | Name of the task |
parameters | TaskParameters | undefined | Parameters configuring the task |
apply | ApplyOption | 'EXISTING' | Apply the task to: - EXISTING: only the resources already existing in the KB. - NEW: only the resources created in the KB after the task is started - ALL: all the existing and new resources of the KB |
Returns
Observable
<StartStopTaskResponse
>
Defined in
libs/sdk-core/src/lib/db/task/task.ts:44
stopTask
▸ stopTask(taskId
): Observable
<StartStopTaskResponse
>
Stop a running task.
Parameters
Name | Type |
---|---|
taskId | string |
Returns
Observable
<StartStopTaskResponse
>