/// <summary>
        /// Set PSU ALERT Default Power Cap
        /// </summary>
        private Contracts.BladeResponse SetPsuAlertDefaultPowerCap(int bladeId, ushort defaultPowerCap, ushort waitTime)
        {
            Contracts.BladeResponse response = new Contracts.BladeResponse();
            response.completionCode = Contracts.CompletionCode.Unknown;
            response.bladeNumber = bladeId;
            response.statusDescription = String.Empty;

            // Issue IPMI command
            bool setDpc = WcsBladeFacade.SetDefaultPowerLimit((byte)bladeId, defaultPowerCap, waitTime);

            if (!setDpc)
            {
                response.completionCode = Contracts.CompletionCode.Failure;
                Tracer.WriteError("SetBladePsuAlertDefaultPowerCap failed");
            }
            else
            {
                response.completionCode = Contracts.CompletionCode.Success;
                response.statusDescription = response.completionCode.ToString();
            }

            return response;
        }
        /// <summary>
        /// Set PSU ALERT Default Power Cap
        /// </summary>
        public Contracts.BladeResponse SetBladePsuAlertDefaultPowerCap(int bladeId, ushort defaultPowerCapInWatts, ushort waitTimeInMsecs)
        {
            Contracts.BladeResponse response = new Contracts.BladeResponse();
            response.completionCode = Contracts.CompletionCode.Unknown;
            response.statusDescription = String.Empty;
            response.bladeNumber = bladeId;

            Tracer.WriteUserLog("Invoked SetBladePsuAlertDefaultPowerCap({0})", bladeId);
            Tracer.WriteInfo("Received SetBladePsuAlertDefaultPowerCap({0})", bladeId);

            if (!ConfigLoaded.PowerAlertDrivenPowerCapAPIsEnabled)
            {
                Tracer.WriteInfo("SetBladePsuAlertDefaultPowerCap: User requested API not enabled in app.config");
                response.completionCode = Contracts.CompletionCode.CommandNotValidAtThisTime;
                response.statusDescription = "PSU alert driven power cap commands are not enabled for this blade";
                return response;
            }

            Contracts.ChassisResponse varResponse = ValidateRequest("SetBladePsuAlertDefaultPowerCap", bladeId);
            if (varResponse.completionCode != Contracts.CompletionCode.Success)
            {
                response.completionCode = varResponse.completionCode;
                response.statusDescription = varResponse.statusDescription;
                return response;
            }

            BladeResponse setDpc = SetPsuAlertDefaultPowerCap(bladeId, defaultPowerCapInWatts, waitTimeInMsecs);

            response.completionCode = setDpc.completionCode;
            response.statusDescription = response.completionCode.ToString();

            return response;
        }
        /// <summary>
        /// Activate Deactivate PSU ALERT Action
        /// </summary>
        private Contracts.BladeResponse BladeActivateDeactivatePsuAlert(int bladeId, bool enableProchot, int action, bool removeCap)
        {
            Contracts.BladeResponse response = new Contracts.BladeResponse();
            response.completionCode = Contracts.CompletionCode.Unknown;
            response.bladeNumber = bladeId;
            response.statusDescription = String.Empty;

            Ipmi.BmcPsuAlertAction bmcAction = Ipmi.BmcPsuAlertAction.NoAction;

            if (action == 0)
                bmcAction = Ipmi.BmcPsuAlertAction.NoAction;
            else if (action == 1)
                bmcAction = Ipmi.BmcPsuAlertAction.DpcOnly;
            else if (action == 2)
                bmcAction = Ipmi.BmcPsuAlertAction.ProcHotAndDpc;
            else
            {
                response.statusDescription = CompletionCode.ParameterOutOfRange.ToString();
                return response;
            }

            // Issue IPMI command
            bool activePsuAlert = WcsBladeFacade.ActivatePsuAlert((byte)bladeId, enableProchot, bmcAction, removeCap);

            if (!activePsuAlert)
            {
                response.completionCode = Contracts.CompletionCode.Failure;
                Tracer.WriteError("ActivateDeactivatePsuAlert failed");
            }
            else
            {
                response.completionCode = Contracts.CompletionCode.Success;
            }

            response.statusDescription = response.completionCode.ToString();

            return response;
        }
        /// <summary>
        /// Activate Deactivate PSU ALERT Action against the given blade
        /// </summary>
        public Contracts.BladeResponse SetBladePsuAlert(int bladeId, bool enableProchot, int action, bool removeCap)
        {
            Contracts.BladeResponse response = new Contracts.BladeResponse();
            Tracer.WriteUserLog("Invoked SetBladePsuAlert({0})", bladeId);
            Tracer.WriteInfo("Received SetBladePsuAlert({0})", bladeId);

            response.bladeNumber = bladeId;
            response.completionCode = Contracts.CompletionCode.Unknown;
            response.statusDescription = String.Empty;

            if (!ConfigLoaded.PowerAlertDrivenPowerCapAPIsEnabled)
            {
                Tracer.WriteInfo("SetBladePsuAlert: User requested API not enabled in app.config");
                response.completionCode = Contracts.CompletionCode.CommandNotValidAtThisTime;
                response.statusDescription = "PSU alert driven power cap commands are not enabled for this blade";
                return response;
            }

            Contracts.ChassisResponse varResponse = ValidateRequest("SetBladePsuAlert", bladeId);
            if (varResponse.completionCode != Contracts.CompletionCode.Success)
            {
                response.completionCode = varResponse.completionCode;
                response.statusDescription = varResponse.statusDescription;
                return response;
            }

            BladeResponse activatePsuAlert = BladeActivateDeactivatePsuAlert(bladeId, enableProchot, action, removeCap);

            response.completionCode = activatePsuAlert.completionCode;
            response.statusDescription = response.completionCode.ToString();

            return response;
        }