ITaskOperations.AddWithHttpMessagesAsync(String, TaskAddParameter, TaskAddOptions, Dictionary<String,List<String>>, CancellationToken) Method

Definition

Adds a task to the specified job.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.TaskAddHeaders>> AddWithHttpMessagesAsync (string jobId, Microsoft.Azure.Batch.Protocol.Models.TaskAddParameter task, Microsoft.Azure.Batch.Protocol.Models.TaskAddOptions taskAddOptions = null, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = null);
abstract member AddWithHttpMessagesAsync : string * Microsoft.Azure.Batch.Protocol.Models.TaskAddParameter * Microsoft.Azure.Batch.Protocol.Models.TaskAddOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.TaskAddHeaders>>

Parameters

jobId
System.String

The ID of the job to which the task is to be added.

task
TaskAddParameter

The task to be added.

taskAddOptions
TaskAddOptions

Additional parameters for the operation

customHeaders
System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.List<System.String>>

The headers that will be added to request.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<TaskAddHeaders>>

Exceptions

Thrown when the operation returned an invalid status code

Thrown when a required parameter is null

Remarks

The maximum lifetime of a task from addition to completion is 7 days. If a task has not completed within 7 days of being added it will be terminated by the Batch service and left in whatever state it was in at that time.

Applies to