Exemplo n.º 1
0
        /// <summary>
        /// Gets the result of evaluating an automatic scaling formula on the specified pool.
        /// </summary>
        /// <param name="parameters">The parameters specifying the pool and autoscale formula.</param>
        public PSAutoScaleEvaluation EvaluateAutoScale(AutoScaleParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            string poolId = parameters.Pool == null ? parameters.PoolId : parameters.Pool.Id;

            WriteVerbose(string.Format(Resources.EvaluateAutoScale, poolId, parameters.AutoScaleFormula));
            PoolOperations      poolOperations = parameters.Context.BatchOMClient.PoolOperations;
            AutoScaleEvaluation evaluation     = poolOperations.EvaluateAutoScale(poolId, parameters.AutoScaleFormula, parameters.AdditionalBehaviors);

            return(new PSAutoScaleEvaluation(evaluation));
        }