On this page

    Cancel a Running Job

    This API 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.

    Note:
    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'
    

    Python

    import requests
    
    url = "http://localhost:9047/api/v3/job/23a5e7ab-27e6-efc9-d51b-200fcac3a100/cancel"
    
    payload = ""
    headers = {
        'Authorization': "_dremioerjt7vnhtljpus01rfibddefdg"
        }
    
    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."
    }