Skip to main content

subtasks

Creates, updates, deletes, gets or lists a subtasks resource.

Overview

Namesubtasks
TypeResource
Idazure.batch_dataplane.subtasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idintegerThe ID of the subtask.
containerInfoobjectInformation about the container under which the Task is executing. This property is set only if the Task runs in a container context.
endTimestring (date-time)The time at which the subtask completed. This property is set only if the subtask is in the Completed state.
exitCodeintegerThe exit code of the program specified on the subtask command line. This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
failureInfoobjectInformation describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure.
nodeInfoobjectInformation about the Compute Node on which the subtask ran.
previousStatestringThe previous state of the subtask. This property is not set if the subtask is in its initial running state. Known values are: "preparing", "running", and "completed". (preparing, running, completed)
previousStateTransitionTimestring (date-time)The time at which the subtask entered its previous state. This property is not set if the subtask is in its initial running state.
resultstringThe result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. Known values are: "success" and "failure". (success, failure)
startTimestring (date-time)The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running.
statestringThe current state of the subtask. Known values are: "preparing", "running", and "completed". (preparing, running, completed)
stateTransitionTimestring (date-time)The time at which the subtask entered its current state.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_subtasksselectjob_id, task_id, endpointtimeOut, ocp-date, $selectLists all of the subtasks that are associated with the specified multi-instance Task. If the Task is not a multi-instance Task then this returns an empty collection.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
job_idstringThe ID of the Job. Required.
task_idstringThe ID of the Task. Required.
$selectarrayAn OData $select clause. Default value is None.
ocp-datestringThe time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. Default value is None.
timeOutintegerThe maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". Default value is None.

SELECT examples

Lists all of the subtasks that are associated with the specified multi-instance Task. If the Task is not a multi-instance Task then this returns an empty collection.

SELECT
id,
containerInfo,
endTime,
exitCode,
failureInfo,
nodeInfo,
previousState,
previousStateTransitionTime,
result,
startTime,
state,
stateTransitionTime
FROM azure.batch_dataplane.subtasks
WHERE job_id = '{{ job_id }}' -- required
AND task_id = '{{ task_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND timeOut = '{{ timeOut }}'
AND ocp-date = '{{ ocp-date }}'
AND $select = '{{ $select }}'
;