Inheritance: Microsoft.Azure.Commands.Batch.Models.ComputeNodeOperationParameters
        public override void ExecuteCmdlet()
        {
            DisableComputeNodeSchedulingParameters parameters = new DisableComputeNodeSchedulingParameters(this.BatchContext, 
                this.PoolId, this.Id, this.ComputeNode, this.AdditionalBehaviors)
            {
                DisableSchedulingOption = this.DisableSchedulingOption
            };

            BatchClient.DisableComputeNodeScheduling(parameters);
        }
Exemple #2
0
        /// <summary>
        /// Disables task scheduling on the specified compute node.
        /// </summary>
        /// <param name="parameters">The parameters specifying the compute node.</param>
        public void DisableComputeNodeScheduling(DisableComputeNodeSchedulingParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            string computeNodeId = parameters.ComputeNode == null ? parameters.ComputeNodeId : parameters.ComputeNode.Id;

            WriteVerbose(string.Format(Resources.DisableComputeNodeScheduling, computeNodeId));

            if (parameters.ComputeNode != null)
            {
                parameters.ComputeNode.omObject.DisableScheduling(parameters.DisableSchedulingOption, parameters.AdditionalBehaviors);
            }
            else
            {
                PoolOperations poolOperations = parameters.Context.BatchOMClient.PoolOperations;
                poolOperations.DisableComputeNodeScheduling(parameters.PoolId, parameters.ComputeNodeId, parameters.DisableSchedulingOption,
                                                            parameters.AdditionalBehaviors);
            }
        }
        /// <summary>
        /// Disables task scheduling on the specified compute node.
        /// </summary>
        /// <param name="parameters">The parameters specifying the compute node.</param>
        public void DisableComputeNodeScheduling(DisableComputeNodeSchedulingParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            string computeNodeId = parameters.ComputeNode == null ? parameters.ComputeNodeId : parameters.ComputeNode.Id;
            WriteVerbose(string.Format(Resources.DisableComputeNodeScheduling, computeNodeId));

            if (parameters.ComputeNode != null)
            {
                parameters.ComputeNode.omObject.DisableScheduling(parameters.DisableSchedulingOption, parameters.AdditionalBehaviors);
            }
            else
            {
                PoolOperations poolOperations = parameters.Context.BatchOMClient.PoolOperations;
                poolOperations.DisableComputeNodeScheduling(parameters.PoolId, parameters.ComputeNodeId, parameters.DisableSchedulingOption,
                    parameters.AdditionalBehaviors);
            }
        }