Description

Get annotated task deliveries in JSON format.

Usage

To get the annotated tasks deliveries, you need to run the following command:

sama task deliver [flags]
sama task deliver [command]

Available Commands

stream - stream task deliveries. Each call to this command gets the latest delivered tasks since the last call.

Flags

    --batch-id strings          filter deliveries by batch id. Comma separated values are supported.
    --client-batch-id strings   filter deliveries by client batch id. Comma separated values are supported.
    --from string               filter deliveries by tasks delivered starting from timestamp.
-h, --help                      help for deliver
-o, --output-file string        destination file to write the delivery results.
    --task-id strings           get delivery by specific task id. Comma separated values are supported.

Examples

Get all deliveries

Note: It is not recommended to get all deliveries without filters.

$ sama task deliver -o results.json

Filter deliveries by batch id

$ sama task deliver -o results.json --batch-id 58555,58556

Comma-separated values should not have spaces between them.

Filter deliveries by client batch id

Example 1: $ sama task deliver -o results.json --client-batch-id batch1,batch2
Example 2: $ sama task deliver -o results.json --client-batch-id "batch 1","batch 2"

Client batch ids with spaces should be wrapped in quotation marks.
Comma-separated values should not have spaces between them.

Filter deliveries by timestamp

Example 1: $ sama task deliver -o results.json --from 2022-01-31
Example 2: $ sama task deliver -o results.json --from 2022-01-31T19:46:04Z

Filter deliveries by task ids

Example 1: $ sama task deliver -o results.json --task-id 61d283db442e8f004fbb7d65,61d283db442e8f004fbb7d64
Example 2: $ sama task deliver -o results.json --task-id "61d283db442e8f004fbb7d65, 61d283db442e8f004fbb7d64"

Comma-separated values should not have spaces unless wrapped in quotation marks.

Task deliver a stream

Description

Stream task deliveries. Each call to this command gets the latest delivered tasks since the last call.

Usage

sama task deliver stream [flags]

Flags

-h, --help                  help for stream
    --max int               maximum number of tasks to retrieve from stream.
    --outputFolder string   output folder to write delivery files to, if empty writes to project root.
    --reset                 reinitializes the stream with a new consumer token effectively resetting the position of the stream to the start.

Examples

Get the latest deliveries

Suppose there are 40 annotated tasks that are ready for delivery. If you were to call, sama task deliver stream --max 1000, it would get all 40 tasks.

Suppose afterward, there are 10 new annotated tasks for delivery, and you made the same call, sama task deliver stream --max 1000, it would get the 10 new tasks only.

Each time you call the stream command, it only gets the tasks that were not already delivered to you.

The --max flag specifies that maximum amount of tasks to deliver at a time.

Get the latest deliveries specifying an output folder

$ mkdir testFolder
$ sama task deliver stream --max 1000 --outputFolder testFolder

Reinitialize the stream

By using the --reset flag, you start getting the tasks deliveries as if stream has been called for the first time; the task deliveries start from the beginning.

$ sama task deliver stream --reset --max 1000