Share via


JobOperationsExtensions.DeleteAsync Method

Definition

Deletes a Job.

public static System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.JobDeleteHeaders> DeleteAsync (this Microsoft.Azure.Batch.Protocol.IJobOperations operations, string jobId, Microsoft.Azure.Batch.Protocol.Models.JobDeleteOptions jobDeleteOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member DeleteAsync : Microsoft.Azure.Batch.Protocol.IJobOperations * string * Microsoft.Azure.Batch.Protocol.Models.JobDeleteOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.JobDeleteHeaders>
<Extension()>
Public Function DeleteAsync (operations As IJobOperations, jobId As String, Optional jobDeleteOptions As JobDeleteOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of JobDeleteHeaders)

Parameters

operations
IJobOperations

The operations group for this extension method.

jobId
String

The ID of the Job to delete.

jobDeleteOptions
JobDeleteOptions

Additional parameters for the operation

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task data; that is, if the Job contains Tasks which are still retained on Compute Nodes, the Batch services deletes those Tasks' working directories and all their contents. When a Delete Job request is received, the Batch service sets the Job to the deleting state. All update operations on a Job that is in deleting state will fail with status code 409 (Conflict), with additional information indicating that the Job is being deleted.

Applies to