/// <summary> /// Disables task scheduling on the specified compute node. /// </summary> /// <remarks> /// You can disable task scheduling on a node only if its current scheduling /// state is enabled. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node on which you want to disable task scheduling. /// </param> /// <param name='nodeDisableSchedulingOption'> /// What to do with currently running tasks when disabling task scheduling on /// the compute node. The default value is requeue. Possible values include: /// 'requeue', 'terminate', 'taskCompletion' /// </param> /// <param name='computeNodeDisableSchedulingOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ComputeNodeDisableSchedulingHeaders> DisableSchedulingAsync(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption?nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DisableSchedulingWithHttpMessagesAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Disables task scheduling on the specified compute node. /// </summary> /// <remarks> /// You can disable task scheduling on a node only if its current scheduling /// state is enabled. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The ID of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The ID of the compute node on which you want to disable task scheduling. /// </param> /// <param name='nodeDisableSchedulingOption'> /// What to do with currently running tasks when disabling task scheduling on /// the compute node. The default value is requeue. Possible values include: /// 'requeue', 'terminate', 'taskCompletion' /// </param> /// <param name='computeNodeDisableSchedulingOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeDisableSchedulingHeaders DisableScheduling(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption?nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions)) { return(operations.DisableSchedulingAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions).GetAwaiter().GetResult()); }
public virtual Response DisableScheduling(string poolId, string nodeId, NodeDisableSchedulingParameter nodeDisableSchedulingParameter, ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions, CancellationToken cancellationToken = default) { return(RestClient.DisableScheduling(poolId, nodeId, nodeDisableSchedulingParameter, computeNodeDisableSchedulingOptions, cancellationToken).GetRawResponse()); }
/// <summary> /// Disables task scheduling on the specified compute node. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolId'> /// The id of the pool that contains the compute node. /// </param> /// <param name='nodeId'> /// The id of the compute node on which you want to disable task scheduling. /// </param> /// <param name='nodeDisableSchedulingOption'> /// What to do with currently running tasks when disable task scheduling on /// the compute node. The default value is requeue. Possible values include: /// 'requeue', 'terminate', 'taskcompletion' /// </param> /// <param name='computeNodeDisableSchedulingOptions'> /// Additional parameters for the operation /// </param> public static ComputeNodeDisableSchedulingHeaders DisableScheduling(this IComputeNodeOperations operations, string poolId, string nodeId, DisableComputeNodeSchedulingOption?nodeDisableSchedulingOption = default(DisableComputeNodeSchedulingOption?), ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions = default(ComputeNodeDisableSchedulingOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IComputeNodeOperations)s).DisableSchedulingAsync(poolId, nodeId, nodeDisableSchedulingOption, computeNodeDisableSchedulingOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
public virtual async Task <Response> DisableSchedulingAsync(string poolId, string nodeId, NodeDisableSchedulingParameter nodeDisableSchedulingParameter, ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions, CancellationToken cancellationToken = default) { return((await RestClient.DisableSchedulingAsync(poolId, nodeId, nodeDisableSchedulingParameter, computeNodeDisableSchedulingOptions, cancellationToken).ConfigureAwait(false)).GetRawResponse()); }