Skip to content

Reprint a stopped tape batch from a label

POST
/api/v1/batches/{batch_id}/reprint
curl --request POST \
--url https://example.com/api/v1/batches/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/reprint \
--header 'Content-Type: application/json' \
--header 'X-Label-Hub-Key: <X-Label-Hub-Key>' \
--data '{ "from_label": 1 }'

A stopped run (#277): with stop_kind unknown the group’s outcome is unknown — count what printed, fix the tape, and reprint from the first label that is missing (reprint_from to reprint_to); that label to the end of the group, and every label that was not started, are queued again as new jobs, and the labels before it count as printed. With refused nothing of the group was sent: reprint from its first label. A printer the stop paused is resumed. Labels whose stored job was cleaned up are listed in skipped_job_ids. The batch then lists the run’s labels (GET shows the new jobs). from_label outside the range answers 422 label_out_of_range. Held runs live in memory: a hub restart fails every label that waited for a confirmation (tape_run_interrupted), also a part that was continued but had not started, and a stopped run can then no longer be reprinted (run is null, this answers 404). A held run counts against LABELYARD_MAX_QUEUED_RUNS_PER_KEY (default 20) of its key, not against the printer’s cap: over it a new batch of that key answers 429 too-many-queued-runs until a run is continued, reprinted to the end or discarded. At most five runs per printer are held, at most two of one key: a further held run discards that key’s own oldest (run_discarded_limit), never another key’s. While the five places are taken, a batch of more than 50 labels from a key without a held run there gets 429 too-many-queued-runs; smaller batches are always taken. All callers without a key (SSO users) count as one key; a browser session signed in with a key counts as that key.

batch_id
required
Batch Id
string format: uuid
Media typeapplication/json
ReprintRequest
object
from_label
required
From Label

Reprint from this label (1-based) to the end of the unknown group.

integer
>= 1 <= 100000

Example generated

{
"from_label": 1
}

Successful Response

Media typeapplication/json
ReprintResponse
object
confirmed_job_ids
required
Confirmed Job Ids
Array<string>
job_ids
required
Job Ids

The run’s labels in print order after the reprint.

Array<string>
new_job_ids
required
New Job Ids
Array<string>
run
required

The run after the reprint; null if done.

Any of:
TapeRunRead

A tape batch that is printing, waits for a confirmation, or stopped (#277).

Positions are 1-based in print order (job_ids).

object
batch_id
required
Batch Id
string format: uuid
confirmed_job_ids
required
Confirmed Job Ids

Labels of an unknown group the user confirmed as printed (a reprint).

Array<string>
current_sub_job
required
Current Sub Job

The sub-job printing or waiting, 1-based.

integer
job_ids
required
Job Ids

The job of every label, in print order.

Array<string>
printer_id
required
Printer Id
string format: uuid
reprint_from
required
Reprint From

Lowest from_label a reprint accepts.

Any of:
integer
reprint_to
required
Reprint To

Highest from_label: one past the unknown group (only the not-started).

Any of:
integer
state
required
State

awaiting_confirmation: the next sub-job starts after POST .../continue. stopped: a group failed; the labels after it were not started. With stop_kind unknown the group’s outcome is unknown (an error while sending, or the status check after the group: on a PT the SNMP noPaper bit at tape end; whether a QL-820NWB reports a DK roll end is not verified); with refused the printer refused before anything was sent (wrong tape, no tape, cover open, unreachable). POST .../reprint picks it up, POST .../discard gives it up. Held runs are kept in memory: a hub restart fails every label that waited for a confirmation (tape_run_interrupted), and a stopped run cannot be reprinted after it.

string
Allowed values: printing awaiting_confirmation stopped
stop_code
required
Stop Code

Why the run stopped, e.g. tape_empty.

Any of:
string
stop_kind
required
Stop Kind

After a stop: the group’s outcome is unknown, or nothing of it was sent.

Any of:
string
Allowed values: unknown refused
sub_job_size
required
Sub Job Size
integer
sub_job_starts
required
Sub Job Starts

Where each sub-job starts in job_ids (0-based); a reprint re-splits.

Array<integer>
sub_jobs
required
Sub Jobs
integer
unknown_from
required
Unknown From

First label of the unknown group.

Any of:
integer
unknown_to
required
Unknown To

Last label of the unknown group.

Any of:
integer
skipped_job_ids
required
Skipped Job Ids

Labels not re-queued because their stored job was cleaned up.

Array<string>

Example

{
"run": {
"state": "printing",
"stop_kind": "unknown"
}
}

The key lacks the print scope or may not use this printer.

No such batch, or no tape run of it that waits for an action.

The run is in another state (run_not_awaiting_confirmation, run_not_stopped, run_not_held), or a run that waited 15 minutes and gave up its pictures cannot draw them again from the stored labels (run_pictures_lost; discard it).

label_out_of_range.