Jobs

Creates a Job to the specified Account.

Changed on

The Batch service supports two ways to control the work done as part of a Job. In the first approach, the user specifies a Job Manager Task. The Batch service launches this Task when it is ready to start the Job. The Job Manager Task controls all other Tasks that run under this Job, by using the Task APIs. In the second approach, the user directly controls the execution of Tasks under an active Job, by using the Task APIs. Also note: when naming Jobs, avoid including sensitive information such as user names or secret project names. This information may appear in telemetry logs accessible to Microsoft Support engineers.

post/jobs

Request

  • Base URL
    {endpoint}
  • Auth
    OAuth 2
    Implicithttps://login.microsoftonline.com/common/oauth2/v2.0/authorize
    Scopeshttps://batch.core.windows.net//.default

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

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.

Request body

idstring required

A string that uniquely identifies the Job within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case).

displayNamestring

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

usesTaskDependenciesboolean

Whether Tasks in the Job can define dependencies on each other. The default is false.

priorityinteger

The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.

allowTaskPreemptionboolean

Whether Tasks in this job can be preempted by other high priority jobs. (This property is not available by default. Please contact support for more information) If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API.

maxParallelTasksinteger

The maximum number of tasks that can be executed in parallel for the job. (This property is not available by default. Please contact support for more information) The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API.

onAllTasksComplete'noaction' | 'terminatejob'

The action the Batch service should take when all Tasks in the Job are in the completed state.

onTaskFailure'noaction' | 'performexitoptionsjobaction'

TaskFailure enums

Response

The request has succeeded and a new resource has been created as a result.

Changes

    • warning

      deleted the query request parameter timeout

    • info

      api operation id Job_Add removed and replaced with Jobs_CreateJob

    • info

      added the new optional query request parameter timeOut