Task - List Subtasks
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.
GET {batchUrl}/jobs/{jobId}/tasks/{taskId}/subtasksinfo?api-version=2024-07-01.20.0
GET {batchUrl}/jobs/{jobId}/tasks/{taskId}/subtasksinfo?$select={$select}&timeout={timeout}&api-version=2024-07-01.20.0
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
batch
|
path | True |
string |
The base URL for all Azure Batch service requests. |
job
|
path | True |
string |
The ID of the Job. |
task
|
path | True |
string |
The ID of the Task. |
api-version
|
query | True |
string |
Client API Version. |
$select
|
query |
string |
An OData $select clause. |
|
timeout
|
query |
integer int32 |
The 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. |
Request Header
Media Types: "application/json; odata=minimalmetadata"
Name | Required | Type | Description |
---|---|---|---|
client-request-id |
string uuid |
The caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. |
|
return-client-request-id |
boolean |
Whether the server should return the client-request-id in the response. |
|
ocp-date |
string date-time-rfc1123 |
The 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. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
A response containing the list of subtasks. Headers
|
|
Other Status Codes |
The error from the Batch service. |
Security
azure_auth
Microsoft Entra OAuth 2.0 auth code flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | Impersonate your user account |
Authorization
Type:
apiKey
In:
header
Examples
Task list subtasks
Sample request
GET account.region.batch.azure.com/jobs/jobId/tasks/taskId/subtasksinfo?api-version=2024-07-01.20.0
Sample response
{
"value": [
{
"id": 1,
"startTime": "2016-09-06T06:59:16.3139271Z",
"endTime": "2016-09-06T06:59:20.0242024Z",
"state": "completed",
"stateTransitionTime": "2016-09-06T06:59:20.0242024Z",
"previousState": "running",
"previousStateTransitionTime": "2016-09-06T06:59:16.3139271Z",
"exitCode": 0,
"nodeInfo": {
"affinityId": "TVM:tvm-2544493925_3-20160905t051718z",
"nodeUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2544493925_3-20160905t051718z",
"poolId": "mpiPool",
"nodeId": "tvm-2544493925_3-20160905t051718z",
"taskRootDirectory": "\\workitems\\jobId\\job-1\\taskId\\1",
"taskRootDirectoryUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2544493925_3-20160905t051718z/files//workitems/jobId/job-1/taskId/1"
}
},
{
"id": 2,
"startTime": "2016-09-06T06:59:16.9702844Z",
"state": "running",
"stateTransitionTime": "2016-09-06T06:59:16.9702844Z",
"nodeInfo": {
"affinityId": "TVM:tvm-2544493925_2-20160905t051718z",
"nodeUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2544493925_2-20160905t051718z",
"poolId": "mpiPool",
"nodeId": "tvm-2544493925_2-20160905t051718z",
"taskRootDirectory": "\\workitems\\jobId\\job-1\\taskId\\2",
"taskRootDirectoryUrl": "https://account.region.batch.azure.com/pools/poolId/nodes/tvm-2544493925_2-20160905t051718z/files//workitems/jobId/job-1/taskId/2"
}
}
]
}
Definitions
Name | Description |
---|---|
Batch |
An error response received from the Azure Batch service. |
Batch |
An item of additional information included in an Azure Batch error response. |
Cloud |
The result of listing the subtasks of a Task. |
Compute |
Information about the Compute Node on which a Task ran. |
Error |
The category of the error. |
Error |
An error message received in an Azure Batch error response. |
Name |
Represents a name-value pair. |
Subtask |
Information about an Azure Batch subtask. |
Subtask |
The state of the subtask. |
Task |
Contains information about the container which a Task is executing. |
Task |
The result of Task execution. |
Task |
Information about a Task failure. |
BatchError
An error response received from the Azure Batch service.
Name | Type | Description |
---|---|---|
code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
message |
A message describing the error, intended to be suitable for display in a user interface. |
|
values |
A collection of key-value pairs containing additional details about the error. |
BatchErrorDetail
An item of additional information included in an Azure Batch error response.
Name | Type | Description |
---|---|---|
key |
string |
An identifier specifying the meaning of the Value property. |
value |
string |
The additional information included with the error response. |
CloudTaskListSubtasksResult
The result of listing the subtasks of a Task.
Name | Type | Description |
---|---|---|
value |
The list of subtasks. |
ComputeNodeInformation
Information about the Compute Node on which a Task ran.
Name | Type | Description |
---|---|---|
affinityId |
string |
An identifier for the Node on which the Task ran, which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. |
nodeId |
string |
The ID of the Compute Node on which the Task ran. |
nodeUrl |
string |
The URL of the Compute Node on which the Task ran. |
poolId |
string |
The ID of the Pool on which the Task ran. |
taskRootDirectory |
string |
The root directory of the Task on the Compute Node. |
taskRootDirectoryUrl |
string |
The URL to the root directory of the Task on the Compute Node. |
ErrorCategory
The category of the error.
Name | Type | Description |
---|---|---|
servererror |
string |
The error is due to an internal server issue. |
usererror |
string |
The error is due to a user issue, such as misconfiguration. |
ErrorMessage
An error message received in an Azure Batch error response.
Name | Type | Description |
---|---|---|
lang |
string |
The language code of the error message |
value |
string |
The text of the message. |
NameValuePair
Represents a name-value pair.
Name | Type | Description |
---|---|---|
name |
string |
The name in the name-value pair. |
value |
string |
The value in the name-value pair. |
SubtaskInformation
Information about an Azure Batch subtask.
Name | Type | Description |
---|---|---|
containerInfo |
Information about the container under which the Task is executing. |
|
endTime |
string |
The time at which the subtask completed. |
exitCode |
integer |
The exit code of the program specified on the subtask command line. |
failureInfo |
Information describing the Task failure, if any. |
|
id |
integer |
The ID of the subtask. |
nodeInfo |
Information about the Compute Node on which the subtask ran. |
|
previousState |
The previous state of the subtask. |
|
previousStateTransitionTime |
string |
The time at which the subtask entered its previous state. |
result |
The result of the Task execution. |
|
startTime |
string |
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. |
state |
The current state of the subtask. |
|
stateTransitionTime |
string |
The time at which the subtask entered its current state. |
SubtaskState
The state of the subtask.
Name | Type | Description |
---|---|---|
completed |
string |
The Task is no longer eligible to run, usually because the Task has finished successfully, or the Task has finished unsuccessfully and has exhausted its retry limit. A Task is also marked as completed if an error occurred launching the Task, or when the Task has been terminated. |
preparing |
string |
The Task has been assigned to a Compute Node, but is waiting for a required Job Preparation Task to complete on the Compute Node. If the Job Preparation Task succeeds, the Task will move to running. If the Job Preparation Task fails, the Task will return to active and will be eligible to be assigned to a different Compute Node. |
running |
string |
The Task is running on a Compute Node. This includes task-level preparation such as downloading resource files or deploying Packages specified on the Task - it does not necessarily mean that the Task command line has started executing. |
TaskContainerExecutionInformation
Contains information about the container which a Task is executing.
Name | Type | Description |
---|---|---|
containerId |
string |
The ID of the container. |
error |
string |
Detailed error information about the container. |
state |
string |
The state of the container. |
TaskExecutionResult
The result of Task execution.
Name | Type | Description |
---|---|---|
failure |
string |
There was an error during processing of the Task. The failure may have occurred before the Task process was launched, while the Task process was executing, or after the Task process exited. |
success |
string |
The Task ran successfully. |
TaskFailureInformation
Information about a Task failure.
Name | Type | Description |
---|---|---|
category |
The category of the Task error. |
|
code |
string |
An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. |
details |
A list of additional details related to the error. |
|
message |
string |
A message describing the Task error, intended to be suitable for display in a user interface. |