Tasks¶
Overview¶
Task requests can be used to set and retrieve Task information using GET and PUT request types. POST and DELETE are not supported and sending a message of either of these types will result in a 501 Not Implemented error message. For more about these request types and their uses see the Request Formats and Responses documentation.
Requests and Responses¶
List of possible requests for Tasks. For all PUT requests it is possible to return a 400 Bad Request error message if the message body is empty or if no command key is provided. All requests may return a 400 Bad request error message if no Job ID is provided or a 500 Internal Server Error if the Job ID provided does not correspond to any Job in the repository.
Get Task IDs
Gets all the Task IDs for the Job that corresponds to the Job ID provided.
URL: http://hostname:portnumber/api/tasks?IdOnly=true&JobID=validJobID
Request Type: GET
Message Body: N/A
Response: JSON object containing all the Task IDs for the Job.
Possible Errors: 500 Internal Server Error: An exception occurred within the Deadline code.
Get Task
Gets the Task that correspond to the Task ID provided for the Job that corresponds to the Job ID provided.
URL: http://hostname:portnumber/api/tasks?TaskID=oneValidTaskID&JobID=validJobID
Request Type: GET
Message Body: N/A
Response: JSON object containing the Task information for the requested Task.
- Possible Errors:
- 400 Bad Request:
- No Task ID provided, or
- Task ID must be an integer value.
- 500 Internal Server Error: An exception occurred within the Deadline code.
Get All Tasks
Gets the Tasks for the Job that corresponds to the Job ID provided.
URL: http://hostname:portnumber/api/tasks?JobID=validJobID
Request Type: GET
Message Body: N/A
Response: JSON object containing the Task information for all the Job Tasks.
Possible Errors: 500 Internal Server Error: An exception occurred within the Deadline code.
Requeue Tasks
Requeues the Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job tasks will be requeued.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = requeue
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error: An exception occurred within the Deadline code.
Complete Tasks
Completes the Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job tasks will be completed.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = complete
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error: An exception occurred within the Deadline code.
Suspend Tasks
Suspend the Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job tasks will be suspended.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = suspend
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error: An exception occurred within the Deadline code.
Fail Tasks
Fails the Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job tasks will be failed.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = fail
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error: An exception occurred within the Deadline code.
Resume Failed Tasks
Resumes the Failed Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job failed tasks will be resumed.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = resumefailed
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error: An exception occurred within the Deadline code.
Pend Tasks
Pends the Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job tasks will be pended.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = pend
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error:
- An exception occurred within the Deadline code, or
- Trying to pend a task for a Suspended Job.
Release Pending Tasks
Releases the pending Tasks that correspond to the Task IDs provided for the Job that corresponds to the Job ID provided. If no Task IDs are provided, all Job pending tasks will be released.
URL: http://hostname:portnumber/api/tasks
Request Type: PUT
- Message Body:
- JSON object where the following keys are mandatory:
- Command = releasepending
- JobID = the id of the Job
- The following keys are optional:
- TaskList = integer Task ID/s (May be an Array)
Response: “Success”
- Possible Errors:
- 400 Bad Request: TaskList contains entries, but none of them are valid integers.
- 404 Not Found: Requested Task ID does not correspond to a Task for the Job.
- 500 Internal Server Error:
- An exception occurred within the Deadline code, or
- Trying to release a task from pending for a Suspended Job.
Task Property Values¶
Values for some Task properties are represented by numbers. Those properties and their possible values are listed below.
- Stat (Status)
- 1 = Unknown
- 2 = Queued
- 3 = Suspended
- 4 = Rendering
- 5 = Completed
- 6 = Failed
- 8 = Pending