Skip to main content

@nuclia/core / Exports / TaskManager

Class: TaskManager

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TaskManager(kb, nuclia)

Parameters

NameType
kbWritableKnowledgeBox
nucliaINuclia

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

NameType
taskIdstring

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

NameType
taskIdstring

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

NameTypeDescription
count?numberHow 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

NameType
taskIdstring

Returns

Observable<StartStopTaskResponse>

Defined in

libs/sdk-core/src/lib/db/task/task.ts:64


startTask

startTask(taskName, parameters, apply?): Observable<StartStopTaskResponse>

Start a new task

Parameters

NameTypeDefault valueDescription
taskNameTaskNameundefinedName of the task
parametersanyundefinedParameters configuring the task
applyApplyOption'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

NameType
taskIdstring

Returns

Observable<StartStopTaskResponse>

Defined in

libs/sdk-core/src/lib/db/task/task.ts:56