Beispiel #1
0
 /// <summary>
 /// Adds a collection of Tasks to the specified Job.
 /// </summary>
 /// <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.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job to which the Task collection is to be added.
 /// </param>
 /// <param name='value'>
 /// 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.
 /// </param>
 /// <param name='taskAddCollectionOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static TaskAddCollectionResult AddCollection(this ITaskOperations operations, string jobId, IList <TaskAddParameter> value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions))
 {
     return(operations.AddCollectionAsync(jobId, value, taskAddCollectionOptions).GetAwaiter().GetResult());
 }
Beispiel #2
0
 /// <summary>
 /// Adds a collection of Tasks to the specified Job.
 /// </summary>
 /// <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.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job to which the Task collection is to be added.
 /// </param>
 /// <param name='value'>
 /// 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.
 /// </param>
 /// <param name='taskAddCollectionOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TaskAddCollectionResult> AddCollectionAsync(this ITaskOperations operations, string jobId, IList <TaskAddParameter> value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddCollectionWithHttpMessagesAsync(jobId, value, taskAddCollectionOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Adds a collection of tasks to the specified job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The id of the job to which the task collection is to be added.
 /// </param>
 /// <param name='value'>
 /// The collection of tasks to add.
 /// </param>
 /// <param name='taskAddCollectionOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static TaskAddCollectionResult AddCollection(this ITaskOperations operations, string jobId, System.Collections.Generic.IList <TaskAddParameter> value, TaskAddCollectionOptions taskAddCollectionOptions = default(TaskAddCollectionOptions))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ITaskOperations)s).AddCollectionAsync(jobId, value, taskAddCollectionOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }