- URL:
- https://<task-url>/jobs/<job-id>/cancel
- Methods:
GET
POST
- Version Introduced:
- 10.0
Description
The cancel
operation is performed on an asynchronous jobs
resource. This operation results in the cancellation of a running geoprocessing job. You can provide an argument to the cancel
operation as defined in the following parameters table. The job will have a canceling (esri
) status with this operation, and a canceled (esri
) status when the job is canceled.
Request parameters
Parameter | Details |
---|---|
(Optional) | Description: The response format. The default response format is Values: |
You can cancel a job that is in waiting (esri
) or running (esri
) status. Canceling a canceled (esri
), succeeded (esri
), failed (esri
), or timed out (esri
) job status will return an Invalid or missing input parameters
error. If the cancellation request is submitted for a job with a submitted status (esri
) before the job starts to run, you will receive the same error, and the job will continue to run.
Example usage
Cancel the job with an ID of j8279ff17f3b348ddadb6c092cfb7e7ba
and expecting a JSON response.
https://machine.domain.com/webadaptor/rest/services/911CallsHotspot/GPServer/911%20Calls%20Hotspot/jobs/j8279ff17f3b348ddadb6c092cfb7e7ba/cancel?f=json
JSON Response syntax
The syntax of a job cancellation request. The request comes with the job
and a status. Typically, the status will be esri
.
{
"jobId" : "<jobId>",
"jobStatus" : "<jobStatus>"
}
JSON Response example
A job with an ID of j3ba49f5bb25343679c9f20705d643e54
is being cancelled.
{
"jobId":"j3ba49f5bb25343679c9f20705d643e54",
"jobStatus":"esriJobCancelling"
}