Shotstash
API referenceGraphQL referenceMutations

Cancel Job

Stops a queued, claimed or running job and returns it cancelled; a worker holding it learns on its next call (409 JOB_TERMINAL). Errors: JOB_TERMINAL when the job already finished (done, failed or cancelled), NOT_FOUND when there is no such job. Needs pipeline.trigger.

Stops a queued, claimed or running job and returns it cancelled; a worker holding it learns on its next call (409 JOB_TERMINAL). Errors: JOB_TERMINAL when the job already finished (done, failed or cancelled), NOT_FOUND when there is no such job. Needs pipeline.trigger.

Arguments

id*ID!

Job id.

Returns

PipelineJob!
  1. returns

A processing job on one file.

id*ID!

Unique id.

kind*String!

The job kind, namespace/name, such as shotstash/proxy-720p.

kindLabel?String

The stored label of the kind, null when none.

fileId*ID!

The file the job processes.

status*String!

Stored status: queued, claimed, running, done, failed or cancelled (the last three are final).

state*String!

status plus the derived waiting_for_worker (queued while no live worker serves the kind).

progress*Int!

Percent done, 0 to 100.

attempts*Int!

Attempts made so far.

maxAttempts*Int!

Attempts allowed before the job fails.

error?String

Last error (failed jobs, and queued jobs retried after one), null when none.

seq*Int!

Grows with every state or progress change; drop events with a lower seq.

outputVersion?

The processed version the job produced (done jobs only).

createdAt*DateTime!

When the job was queued.

updatedAt*DateTime!

When the job last changed.

finishedAt?DateTime

When the job reached a final status, null before.

mutation CancelJob($id: ID!) {  cancelJob(id: $id) {    id    kind    kindLabel    fileId    status    state    progress    attempts    outputVersion {      id      kind      kindLabel      mimeType      size      downloadUrl      createdAt    }  }}