v22

latestSwagger 2.02026-07-1372236814.0 KB
Tasks

Gets information about the specified Task.

For multi-instance Tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary Task. Use the list subtasks API to retrieve information about subtasks.

get/jobs/{jobId}/tasks/{taskId}

Path parameters

jobIdstring required

The ID of the Job that contains the Task.

taskIdstring required

The ID of the Task to get information about.

Query parameters

api-versionstring required

The API version to use for this operation.

timeOutinteger

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.".

$selectstring[]

An OData $select clause.

$expandstring[]

An OData $expand clause.

Headers

client-request-idstring

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-idboolean

Whether the server should return the client-request-id in the response.

ocp-datestring date-time-rfc7231

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.

If-Modified-Sincestring date-time-rfc7231

A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has been modified since the specified time.

If-Unmodified-Sincestring date-time-rfc7231

A timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.

If-Matchstring

An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service exactly matches the value specified by the client.

If-None-Matchstring

An ETag value associated with the version of the resource known to the client. The operation will be performed only if the resource's current ETag on the service does not match the value specified by the client.

Response

The request has succeeded.

idstring required

A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.

displayNamestring

A display name for the Task. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.

urlstring uri required

The URL of the Task.

eTagstring required

The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.

It is a string of ASCII characters placed between double quotes, like "675af34563dc-tr34".

lastModifiedstring date-time required

The last modified time of the Task.

creationTimestring date-time required

The creation time of the Task.

state'active' | 'preparing' | 'running' | 'completed' required

BatchTaskState enums

stateTransitionTimestring date-time required

The time at which the Task entered its current state.

previousState'active' | 'preparing' | 'running' | 'completed'

BatchTaskState enums

previousStateTransitionTimestring date-time

The time at which the Task entered its previous state. This property is not set if the Task is in its initial Active state.

commandLinestring required

The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).

requiredSlotsinteger

The number of scheduling slots that the Task requires to run. The default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this must be 1.