Condividi tramite


JobOperationsExtensions.DisableAsync Method

Definition

Disables the specified Job, preventing new Tasks from running.

public static System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.JobDisableHeaders> DisableAsync (this Microsoft.Azure.Batch.Protocol.IJobOperations operations, string jobId, Microsoft.Azure.Batch.Protocol.Models.DisableJobOption disableTasks, Microsoft.Azure.Batch.Protocol.Models.JobDisableOptions jobDisableOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member DisableAsync : Microsoft.Azure.Batch.Protocol.IJobOperations * string * Microsoft.Azure.Batch.Protocol.Models.DisableJobOption * Microsoft.Azure.Batch.Protocol.Models.JobDisableOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.JobDisableHeaders>
<Extension()>
Public Function DisableAsync (operations As IJobOperations, jobId As String, disableTasks As DisableJobOption, Optional jobDisableOptions As JobDisableOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of JobDisableHeaders)

Parameters

operations
IJobOperations

The operations group for this extension method.

jobId
String

The ID of the Job to disable.

disableTasks
DisableJobOption

What to do with active Tasks associated with the Job. Possible values include: 'requeue', 'terminate', 'wait'

jobDisableOptions
JobDisableOptions

Additional parameters for the operation

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

The Batch Service immediately moves the Job to the disabling state. Batch then uses the disableTasks parameter to determine what to do with the currently running Tasks of the Job. The Job remains in the disabling state until the disable operation is completed and all Tasks have been dealt with according to the disableTasks option; the Job then moves to the disabled state. No new Tasks are started under the Job until it moves back to active state. If you try to disable a Job that is in any state other than active, disabling, or disabled, the request fails with status code 409.

Applies to