Canceling a job¶
You can cancel a job that has the status of running, pending, or paused schedule. If you cancel a running backup job, you can retain the partial data backup.
Method and URI¶
To cancel a job, use a POST method with a URI:
POST https://{hostname|IPv4}/api/endeavour/jobsession/{jobsessionId}
Tip
To get a {jobsessionId}
, follow the instructions in Getting job session information.
Parameters¶
Parameter: action
You must specify the action parameter to cancel the job.
Value:
cancel
Type: String. Required. Available in the web user interface.
Data¶
Data: catalogCompletedObjects
For backup jobs, enable this value to keep the data that was backed up.
Example value: true
Type: Boolean. Available in the web user interface.
Example: Cancel a job¶
A Python snippet that is similar to the following example can be used to send a request to IBM Spectrum Protect Plus to cancel the backup job ({jobsession_id}
1577841955375).
jobsession_id = "1577841955375"
_params = {"action": "cancel"}
_data = f'''{{
"catalogCompletedObjects": true
}}'''
requests.post('https://' + spp_ipv4 + '/api/endeavour/jobsession/'
+ jobsession_id,
headers={...}, params=_params, data=_data, verify=...)
After you run the Python snippet, ensure that you get a response with the HTTP status of 201 (Created). The job status must change from running to canceling.

Figure 5 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the Jobs and Operations pane, ensure that the Running Jobs tab is displayed. Select the job to cancel, and click Actions > Cancel. Optionally, you can specify whether to keep data from backup jobs.¶