client.jobs.cancel
Cancel a job
client.jobs.cancel(job)
Send a request to the server in order to cancel a Job
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
job | str Job Result | Job identifier as a string or a previusly loaded Job or Result object | '14856eb1-0ad8-49e7-9da3-887acb80fea5' |
Returns
A Job
object with the status from the server
{
"job_identifier": "string",
"status",
"account_identifier": "string",
"explain": "boolean",
"created_at": "date-time",
"updated_at": "date-time",
"submitted_at": "date-time",
"submitted_by": "string",
"pending": "integer",
"completed": "integer",
"failed": "integer",
"total": "integer",
"model": {
"identifier": "string",
"version": "string",
"name": "string"
},
"job_inputs": ["string"],
"user": {
"identifier": "string",
"external_identifier": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"status": "string",
"title": "string"
"access_keys": [
{
"prefix": "string",
"is_default": "boolean"
}
]
}
}
Examples
>>>job.job_identifier
'14856eb1-0ad8-49e7-9da3-887acb80fea5'
>>>job.status
'SUBMITTED'
>>>client.jobs.cancel(job.job_identifier)
>>>job.status
'CANCELED'
You can also use the job.cancel
method directly
>>>job.job_identifier
'14856eb1-0ad8-49e7-9da3-887acb80fea5'
>>>job.status
'SUBMITTED'
>>>job.cancel()
>>>job.status
'CANCELED'
Updated almost 2 years ago