Condividi tramite


JobOperationsExtensions.Disable Method

Definition

Disables the specified Job, preventing new Tasks from running.

public static Microsoft.Azure.Batch.Protocol.Models.JobDisableHeaders Disable (this Microsoft.Azure.Batch.Protocol.IJobOperations operations, string jobId, Microsoft.Azure.Batch.Protocol.Models.DisableJobOption disableTasks, Microsoft.Azure.Batch.Protocol.Models.JobDisableOptions jobDisableOptions = default);
static member Disable : Microsoft.Azure.Batch.Protocol.IJobOperations * string * Microsoft.Azure.Batch.Protocol.Models.DisableJobOption * Microsoft.Azure.Batch.Protocol.Models.JobDisableOptions -> Microsoft.Azure.Batch.Protocol.Models.JobDisableHeaders
<Extension()>
Public Function Disable (operations As IJobOperations, jobId As String, disableTasks As DisableJobOption, Optional jobDisableOptions As JobDisableOptions = Nothing) As 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

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