SymetryML Documentation

Tasks API

The task suite of Rest API methods allows to create, start, stop and list SymetryML Kafka stream applications. These applications are meant to automatically perform prediction on a Kafka Topic and then save the prediction results in another Kafka topic.

There is a maximum number of task that can be run at the same time. This number is controlled by the sml.task.max SymetryML control parameter. Please consult the Installation Guide - SymetryML REST Configuration for more details on how to set this parameters. The default value for this sml.task.max parameter is 4. Please consult the SML Kafka Stream Application Documentation for details.

Some additional parameters can be set inside the TaskInfo JSON data structure with the params map field:

ParameterInformation
sml.task.heap.mindefault is 1024m
sml.task.heap.maxdefault is 2048m

Task Create

This API function creates a Task. Please see Data Source Encryption for information on how to encrypt TaskInfo data structures.

URL

POST /symetry/rest/{cid}/tasks/create [Body=TaskInfo (encrypted)]
ParameterRequired / OptionalDescription
forceOptionalif true then will override any pre-existing Task with same id. Default is false.

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
202CREATEDSuccess.
409CONFLICTA task with the specified name already exists and the force parameter was false.

Task Start

This rest endpoint start a task.

URL

GET /symetry/rest/{cid}/tasks/{tid}/start

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

Task Start

This rest endpoint stop a task.

URL

GET /symetry/rest/{cid}/tasks/{tid}/stop

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

Task List

This rest endpoint return a list of tasks that belong to a given project for a given user.

URL

GET /{cid}/tasks

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

HTTP Response Entity

HTTP Response EntityDescription
StringListA list of task name.

Delete a Task

Delete a task If the task is running it will first be stopped.

URL

DELETE /symetry/rest/{cid}/tasks/{tid}

Canonical URL Parameters

ParameterDescription
cidCustomer ID
tidTask ID

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess

Task Status

This rest endpoint return information about a task.

URL

GET /symetry/rest/{cid}/tasks/{tid}

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

HTTP Response Entity

HTTP Response EntityDescription
KSVSMapA map with key, value as string pair

Status Parameter returned

ParameterDescription
statusWhether or not the task is running.
startDateTimeTime the task was started if running.
processIsAliveIs the underlying process alive?
lastErrorLast error string.

On this page