示例#1
0
 /// <summary>
 /// Terminates the specified job, marking it as completed.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The id of the job to terminate.
 /// </param>
 /// <param name='terminateReason'>
 /// The text you want to appear as the job's TerminateReason. The default is
 /// 'UserTerminate'.
 /// </param>
 /// <param name='jobTerminateOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <JobTerminateHeaders> TerminateAsync(this IJobOperations operations, string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.TerminateWithHttpMessagesAsync(jobId, terminateReason, jobTerminateOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }
示例#2
0
 /// <summary>
 /// Terminates the specified job, marking it as completed.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The id of the job to terminate.
 /// </param>
 /// <param name='terminateReason'>
 /// The text you want to appear as the job's TerminateReason. The default is
 /// 'UserTerminate'.
 /// </param>
 /// <param name='jobTerminateOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static JobTerminateHeaders Terminate(this IJobOperations operations, string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IJobOperations)s).TerminateAsync(jobId, terminateReason, jobTerminateOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#3
0
 public virtual Response Terminate(string jobId, JobTerminateParameter jobTerminateParameter, JobTerminateOptions jobTerminateOptions, CancellationToken cancellationToken = default)
 {
     return(RestClient.Terminate(jobId, jobTerminateParameter, jobTerminateOptions, cancellationToken).GetRawResponse());
 }
示例#4
0
 /// <summary>
 /// Terminates the specified Job, marking it as completed.
 /// </summary>
 /// <remarks>
 /// When a Terminate Job request is received, the Batch service sets the Job to
 /// the terminating state. The Batch service then terminates any running Tasks
 /// associated with the Job and runs any required Job release Tasks. Then the
 /// Job moves into the completed state. If there are any Tasks in the Job in
 /// the active state, they will remain in the active state. Once a Job is
 /// terminated, new Tasks cannot be added and any remaining active Tasks will
 /// not be scheduled.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job to terminate.
 /// </param>
 /// <param name='terminateReason'>
 /// The text you want to appear as the Job's TerminateReason. The default is
 /// 'UserTerminate'.
 /// </param>
 /// <param name='jobTerminateOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static JobTerminateHeaders Terminate(this IJobOperations operations, string jobId, string terminateReason = default(string), JobTerminateOptions jobTerminateOptions = default(JobTerminateOptions))
 {
     return(operations.TerminateAsync(jobId, terminateReason, jobTerminateOptions).GetAwaiter().GetResult());
 }
示例#5
0
 public virtual async Task <Response> TerminateAsync(string jobId, JobTerminateParameter jobTerminateParameter, JobTerminateOptions jobTerminateOptions, CancellationToken cancellationToken = default)
 {
     return((await RestClient.TerminateAsync(jobId, jobTerminateParameter, jobTerminateOptions, cancellationToken).ConfigureAwait(false)).GetRawResponse());
 }