JobOperationsExtensions.Terminate(IJobOperations, String, String, JobTerminateOptions) 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 = null, Microsoft.Azure.Batch.Protocol.Models.JobTerminateOptions jobTerminateOptions = null);
static member Terminate : Microsoft.Azure.Batch.Protocol.IJobOperations * string * string * Microsoft.Azure.Batch.Protocol.Models.JobTerminateOptions -> Microsoft.Azure.Batch.Protocol.Models.JobTerminateHeaders

Parameters

operations
IJobOperations

The operations group for this extension method.

jobId
System.String

The ID of the job to terminate.

terminateReason
System.String

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

jobTerminateOptions
JobTerminateOptions

Additional parameters for the operation

Returns

JobTerminateHeaders

Remarks

When a Terminate Job request is received, the Batch service sets the job to the terminating state. The Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release tasks. The job then moves into the completed state.

Applies to