POST /job

Cancels a running job.

Syntax

POST /api/v3/job/{id}/cancel

Response Codes

400 - specified job is not in a running state.
403 - user does not have permission to access the specified job.
404 - a job with the specified id could not be found.

Request Example

The following example tries to cancel a job using Job ID, 23a5e7ab-27e6-efc9-d51b-200fcac3a100. In this case, the job had already completed.

[info] Postman is used to generate the example.

HTTP request

POST localhost:9047/api/v3/job/23a5e7ab-27e6-efc9-d51b-200fcac3a100/cancel

Curl

curl -X POST \
  http://localhost:9047/api/v3/job/23a5e7ab-27e6-efc9-d51b-200fcac3a100/cancel \
  -H 'Authorization: _dremioerjt7vnhtljpus01rfibddefdg' \
  -H 'Postman-Token: 4d39161f-207d-472f-a28c-d12557f2bfdc' \
  -H 'cache-control: no-cache'

Python

import requests

url = "http://localhost:9047/api/v3/job/23a5e7ab-27e6-efc9-d51b-200fcac3a100/cancel"

payload = ""
headers = {
    'Authorization': "_dremioerjt7vnhtljpus01rfibddefdg",
    'cache-control': "no-cache",
    'Postman-Token': "16c82c4f-b48e-40e8-b531-303509e31b03"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

Response

Status code: 500 Internal Server Error

{
    "errorMessage": "Something went wrong",
    "moreInfo": "Unable to cancel job started on current node. It may have completed before cancellation was requested."
}

results matching ""

    No results matching ""