Bagikan melalui


ITaskOperations.AddCollectionWithHttpMessagesAsync Method

Definition

Adds a collection of Tasks to the specified Job.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Batch.Protocol.Models.TaskAddCollectionResult,Microsoft.Azure.Batch.Protocol.Models.TaskAddCollectionHeaders>> AddCollectionWithHttpMessagesAsync (string jobId, System.Collections.Generic.IList<Microsoft.Azure.Batch.Protocol.Models.TaskAddParameter> value, Microsoft.Azure.Batch.Protocol.Models.TaskAddCollectionOptions taskAddCollectionOptions = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member AddCollectionWithHttpMessagesAsync : string * System.Collections.Generic.IList<Microsoft.Azure.Batch.Protocol.Models.TaskAddParameter> * Microsoft.Azure.Batch.Protocol.Models.TaskAddCollectionOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Batch.Protocol.Models.TaskAddCollectionResult, Microsoft.Azure.Batch.Protocol.Models.TaskAddCollectionHeaders>>
Public Function AddCollectionWithHttpMessagesAsync (jobId As String, value As IList(Of TaskAddParameter), Optional taskAddCollectionOptions As TaskAddCollectionOptions = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of TaskAddCollectionResult, TaskAddCollectionHeaders))

Parameters

jobId
String

The ID of the Job to which the Task collection is to be added.

value
IList<TaskAddParameter>

The collection of Tasks to add. The maximum count of Tasks is 100. The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer Tasks.

taskAddCollectionOptions
TaskAddCollectionOptions

Additional parameters for the operation

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Exceptions

Thrown when the operation returned an invalid status code

Thrown when unable to deserialize the response

Thrown when a required parameter is null

Remarks

Note that each Task must have a unique ID. The Batch service may not return the results for each Task in the same order the Tasks were submitted in this request. If the server times out or the connection is closed during the request, the request may have been partially or fully processed, or not at all. In such cases, the user should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request. For example, you should use the same Task IDs during a retry so that if the prior operation succeeded, the retry will not create extra Tasks unexpectedly. If the response contains any Tasks which failed to add, a client can retry the request. In a retry, it is most efficient to resubmit only Tasks that failed to add, and to omit Tasks that were successfully added on the first attempt. The maximum lifetime of a Task from addition to completion is 180 days. If a Task has not completed within 180 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