你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IJobOperations.EnableWithHttpMessagesAsync 方法

定义

启用指定的作业,允许运行新的任务。

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))

参数

jobId
String

要启用的作业的 ID。

jobEnableOptions
JobEnableOptions

操作的其他参数

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

例外

当操作返回无效状态代码时引发

当所需参数为 null 时引发

注解

调用此 API 时,Batch 服务会将禁用的作业设置为启用状态。 完成此操作后,作业将进入活动状态,并恢复在作业下计划新任务。 Batch 服务不允许任务保持活动状态超过 180 天。 因此,如果启用包含 180 天前添加的活动任务的作业,这些任务将不会运行。

适用于