Udostępnij za pośrednictwem


JobOperationsExtensions.Terminate Method

Definition

Terminates the specified Job, marking it as completed.

public static Microsoft.Azure.Batch.Protocol.Models.JobTerminateHeaders Terminate (this Microsoft.Azure.Batch.Protocol.IJobOperations operations, string jobId, string terminateReason = default, Microsoft.Azure.Batch.Protocol.Models.JobTerminateOptions jobTerminateOptions = default);
static member Terminate : Microsoft.Azure.Batch.Protocol.IJobOperations * string * string * Microsoft.Azure.Batch.Protocol.Models.JobTerminateOptions -> Microsoft.Azure.Batch.Protocol.Models.JobTerminateHeaders
<Extension()>
Public Function Terminate (operations As IJobOperations, jobId As String, Optional terminateReason As String = Nothing, Optional jobTerminateOptions As JobTerminateOptions = Nothing) As JobTerminateHeaders

Parameters

operations
IJobOperations

The operations group for this extension method.

jobId
String

The ID of the Job to terminate.

terminateReason
String

The text you want to appear as the Job's TerminateReason. The default is 'UserTerminate'.

jobTerminateOptions
JobTerminateOptions

Additional parameters for the operation

Returns

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.

Applies to