예제 #1
0
 /// <summary>
 /// Reactivates a Task, allowing it to run again even if its retry count has
 /// been exhausted.
 /// </summary>
 /// <remarks>
 /// Reactivation makes a Task eligible to be retried again up to its maximum
 /// retry count. The Task's state is changed to active. As the Task is no
 /// longer in the completed state, any previous exit code or failure
 /// information is no longer available after reactivation. Each time a Task is
 /// reactivated, its retry count is reset to 0. Reactivation will fail for
 /// Tasks that are not completed or that previously completed successfully
 /// (with an exit code of 0). Additionally, it will fail if the Job has
 /// completed (or is terminating or deleting).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job containing the Task.
 /// </param>
 /// <param name='taskId'>
 /// The ID of the Task to reactivate.
 /// </param>
 /// <param name='taskReactivateOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static TaskReactivateHeaders Reactivate(this ITaskOperations operations, string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions))
 {
     return(operations.ReactivateAsync(jobId, taskId, taskReactivateOptions).GetAwaiter().GetResult());
 }
예제 #2
0
 /// <summary>
 /// Reactivates a Task, allowing it to run again even if its retry count has
 /// been exhausted.
 /// </summary>
 /// <remarks>
 /// Reactivation makes a Task eligible to be retried again up to its maximum
 /// retry count. The Task's state is changed to active. As the Task is no
 /// longer in the completed state, any previous exit code or failure
 /// information is no longer available after reactivation. Each time a Task is
 /// reactivated, its retry count is reset to 0. Reactivation will fail for
 /// Tasks that are not completed or that previously completed successfully
 /// (with an exit code of 0). Additionally, it will fail if the Job has
 /// completed (or is terminating or deleting).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job containing the Task.
 /// </param>
 /// <param name='taskId'>
 /// The ID of the Task to reactivate.
 /// </param>
 /// <param name='taskReactivateOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TaskReactivateHeaders> ReactivateAsync(this ITaskOperations operations, string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ReactivateWithHttpMessagesAsync(jobId, taskId, taskReactivateOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }
예제 #3
0
 /// <summary>
 /// Reactivates the specified task.
 /// </summary>
 /// <remarks>
 /// Reactivation makes a task eligible to be retried again up to its maximum
 /// retry count. This will fail for tasks that are not completed or that
 /// previously completed successfully (with an exit code of 0). Additionally,
 /// this will fail if the job has completed (or is terminating or deleting).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The id of the job containing the task.
 /// </param>
 /// <param name='taskId'>
 /// The id of the task to reactivate.
 /// </param>
 /// <param name='taskReactivateOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static TaskReactivateHeaders Reactivate(this ITaskOperations operations, string jobId, string taskId, TaskReactivateOptions taskReactivateOptions = default(TaskReactivateOptions))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ITaskOperations)s).ReactivateAsync(jobId, taskId, taskReactivateOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }