Suspend, Resume or Kill a Schedule¶
-
PUT
/api/v1.2/scheduler/
(int: id)¶
Use this API to suspend, resume, or kill a schedule.
Note
After you stop a schedule, you cannot resume it. However, you can suspend a schedule and resume it later.
Required Role¶
The following users can make this API call:
- Users who belong to the system-admin group.
- Users who belong to a group associated with a role that allows suspending, resuming, or killing a schedule. See Managing Groups and Managing Roles for more information.
This API is used to suspend, resume, or kill an existing schedule created to run commands automatically at certain frequency in a specified interval.
Resource URI | scheduler/id |
Request Type | PUT |
Supporting Versions | v2.0 |
Return Value | JSON object with the status of the operation. |
Parameters¶
Note
Parameters marked in bold below are mandatory. Others are optional and have default values.
Parameter | Description |
---|---|
status | It indicates the status and its valid values are suspend , resume or kill . |
no_catch_up | Note You can use this parameter while resuming a suspended schedule. Set this parameter to |
Examples¶
Example to Suspend a Schedule¶
curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Accept: application/json" -H "Content-type: application/json" \
-d '{"status":"suspend"}' \ "https://gcp.qubole.com/api/v1.2.0}/scheduler/${SCHEDID}/"
Response
{"succeeded":"true","status":"SUSPENDED"}
Note
There is a rerun limit for a scheduled job. qds-scheduler-concepts provides more information.
Example to Resume a Suspended Schedule¶
Note
A _SUCCESS
file is created in the output folder for successful schedules. You can set
mapreduce.fileoutputcommitter.marksuccessfuljobs
to false
to disable creation of _SUCCESS file
or to true
to enable creation of the _SUCCESS file.
curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Accept: application/json" -H "Content-type: application/json" \
-d '{"status":"resume"}' \ "https://gcp.qubole.com/api/v1.2/scheduler/${SCHEDID}/"
Response
{"succeeded":"true","status":"RUNNING"}
Note
After you stop a schedule, you cannot resume it. However, you can suspend a schedule and resume it later.
Example to Kill a Schedule¶
curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Accept: application/json" -H "Content-type: application/json" \
-d '{"status":"kill"}' \ "https://gcp.qubole.com/api/v1.2/scheduler/${SCHEDID}/"
Response
{"succeeded":"true","status":"KILLED"}