Skip to main content

Cancel a job

POST 

/jobs/:jobId/cancel

Required role: admin. Only an account or token with the admin role can call this operation.

Example request
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
"https://$HOSERVA_HOST:8008/api/v1/jobs/{jobId}/cancel"

Only meaningful where the underlying tool supports cancellation; a job that cannot be cancelled reports that in its cancellable field rather than accepting this call and doing nothing. A queued or running job is stopped; an interrupted, cancellable job is ended cancelled. For a data-disk upgrade this is the abort: refused with job_not_cancellable once its checkpoint is at releasing, whether queued, running or interrupted. A running upgrade is answered with the running job and records its outcome once it has unmounted everything. A queued or interrupted upgrade is unwound first; if that fails it stays interrupted and the call is refused with disk_upgrade_cleanup_failed, naming what is still mounted. job_abort_in_progress refuses a second cancel while one runs. job_resume_in_progress refuses a cancel while a resume of the same job is still repairing its log; retry in a moment.

Request​

Responses​

The job, now in a cancelling or cancelled state.