record --async, record --batch and documents upload return job ids
instead of waiting. These two commands follow them up. Both address one space:
--space, or ANONA_SPACE_ID.
jobs get
GET /v1/spaces/{id}/jobs/{job_id}. A poll is a read: it costs nothing
and is safe to repeat.
A job is still running while its status is pending, processing, running
or queued; anything else is final (completed, failed, cancelled).
memory_count far below items_submitted is not a failure: near-identical
items legitimately extract to fewer memories. zero_yield_items is how many
items extraction produced no memory from. It can be non-zero even when
memory_count is at or above items_submitted, because one item can produce
several memories and another none.
An id the space does not hold (a typo, or a job from another space) exits 5
with job_not_found and prints nothing on stdout, --json or not. The API
itself answers that case with 200 and "status": "not_found".
To wait for a job instead of polling it yourself, pass --wait to the command
that queued it (record,
documents upload).
--json: {"job_id", "status", "created_at", "completed_at", "error", "memory_count", "memory_ids", "items_submitted", "zero_yield_items", "progress"}.
jobs cancel
--yes it exits 2 and sends nothing. A job
that has already finished cannot be cancelled (job_not_cancellable).
--json: {"job_id", "status", "cancelled_parts", "running_parts"}.