/// <summary> /// Get the Status of PSU ALERT for all blades /// </summary> public AllBladesPsuAlertResponse GetAllBladesPsuAlert() { AllBladesPsuAlertResponse responses = new AllBladesPsuAlertResponse(); responses.completionCode = Contracts.CompletionCode.Unknown; responses.statusDescription = String.Empty; responses.bladePsuAlertCollection = new List<BladePsuAlertResponse>(); Contracts.CompletionCode[] bladeInternalResponseCollection = new Contracts.CompletionCode[ConfigLoaded.Population]; Tracer.WriteUserLog("Invoked GetAllBladesPsuAlert"); Tracer.WriteInfo("Received GetAllBladesPsuAlert"); for (int loop = 0; loop < ConfigLoaded.Population; loop++) { responses.bladePsuAlertCollection.Add(GetBladePsuAlert(loop + 1)); // Set the internal blade response to the blade completion code. bladeInternalResponseCollection[loop] = responses.bladePsuAlertCollection[loop].completionCode; } Contracts.ChassisResponse varResponse = new Contracts.ChassisResponse(); varResponse = ChassisManagerUtil.ValidateAllBladeResponse(bladeInternalResponseCollection); responses.completionCode = varResponse.completionCode; responses.statusDescription = varResponse.statusDescription; return responses; }
/// <summary> /// command specific implementation /// argVal command class member has all user-entered command argument indicators and parameter values /// Currently just prints all argument indicators and argument values /// </summary> internal override void commandImplementation() { BladePsuAlertResponse myResponse = new BladePsuAlertResponse(); AllBladesPsuAlertResponse myResponses = new AllBladesPsuAlertResponse(); try { if (this.argVal.ContainsKey('a')) { myResponses = WcsCli2CmConnectionManager.channel.GetAllBladesPsuAlert(); } else if (this.argVal.ContainsKey('i')) { dynamic bladeId = null; if (this.argVal.TryGetValue('i', out bladeId)) { myResponse = WcsCli2CmConnectionManager.channel.GetBladePsuAlert((int)bladeId); } else { Console.WriteLine(WcsCliConstants.commandFailure + " No blade ID specified, please look at command help"); return; } } } catch (Exception ex) { SharedFunc.ExceptionOutput(ex); return; } if ((this.argVal.ContainsKey('a') && myResponses == null) || (this.argVal.ContainsKey('a') && myResponses.bladePsuAlertCollection == null) || myResponse == null) { Console.WriteLine(WcsCliConstants.serviceResponseEmpty); return; } if (this.argVal.ContainsKey('a')) { foreach (var response in myResponses.bladePsuAlertCollection) { if (ResponseValidation.ValidateBladeResponse(response.bladeNumber, "PSU ALERT BMC GPI Status", response, false)) { Console.WriteLine(WcsCliConstants.commandSuccess + string.Format(" PSU Alert BMC GPI Status for blade: {0} = {1}", response.bladeNumber, response.PsuAlertGpi)); Console.WriteLine("Auto PROCHOT on switch GPI Enabled/Disabled for blade: {0} = {1}", response.bladeNumber, response.AutoProchotEnabled); Console.WriteLine("BMC PROCHOT on switch GPI Enabled/Disabled for blade: {0} = {1}", response.bladeNumber, response.BmcProchotEnabled); } } } else { if (ResponseValidation.ValidateBladeResponse(myResponse.bladeNumber, "PSU ALERT BMC GPI Status", myResponse, false)) { Console.WriteLine(WcsCliConstants.commandSuccess + string.Format(" PSU Alert BMC GPI Status for blade: {0} = {1}", myResponse.bladeNumber, myResponse.PsuAlertGpi)); Console.WriteLine("Auto PROCHOT on switch GPI Enabled/Disabled for blade: {0} = {1}", myResponse.bladeNumber, myResponse.AutoProchotEnabled); Console.WriteLine("BMC PROCHOT on switch GPI Enabled/Disabled for blade: {0} = {1}", myResponse.bladeNumber, myResponse.BmcProchotEnabled); } } }