v1

latestSwagger 2.02026-07-1377151733.6 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

$selectstring

An OData $select clause.

$expandstring

An OData $expand clause.

timeoutinteger

The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.

api-versionstring required

Client API Version.

Headers

client-request-idstring 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-idboolean

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

ocp-datestring 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.

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.

If-Modified-Sincestring date-time-rfc1123

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

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.

Response

A response containing the task.

idstring

The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.

displayNamestring

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

urlstring
eTagstring

This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.

lastModifiedstring date-time
creationTimestring date-time
state'active' | 'preparing' | 'running' | 'completed'
stateTransitionTimestring date-time
previousState'active' | 'preparing' | 'running' | 'completed'
previousStateTransitionTimestring date-time

This property is not set if the task is in its initial Active state.

commandLinestring

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://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).