IJobOperations.EnableWithHttpMessagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enables the specified Job, allowing new Tasks to run.
public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.JobEnableHeaders>> EnableWithHttpMessagesAsync (string jobId, Microsoft.Azure.Batch.Protocol.Models.JobEnableOptions jobEnableOptions = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member EnableWithHttpMessagesAsync : string * Microsoft.Azure.Batch.Protocol.Models.JobEnableOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationHeaderResponse<Microsoft.Azure.Batch.Protocol.Models.JobEnableHeaders>>
Public Function EnableWithHttpMessagesAsync (jobId As String, Optional jobEnableOptions As JobEnableOptions = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationHeaderResponse(Of JobEnableHeaders))
Parameters
- jobId
- String
The ID of the Job to enable.
- jobEnableOptions
- JobEnableOptions
Additional parameters for the operation
- customHeaders
- Dictionary<String,List<String>>
The headers that will be added to request.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
Exceptions
Thrown when the operation returned an invalid status code
Thrown when a required parameter is null
Remarks
When you call this API, the Batch service sets a disabled Job to the enabling state. After the this operation is completed, the Job moves to the active state, and scheduling of new Tasks under the Job resumes. The Batch service does not allow a Task to remain in the active state for more than 180 days. Therefore, if you enable a Job containing active Tasks which were added more than 180 days ago, those Tasks will not run.