Ejemplo n.º 1
0
        public override StationData eachStation(StationData data, int i, int j)
        {
            ErrorPost thisPost = new ErrorPost();
            String errorMessage = "";
            bool firstPingError = true;
            foreach (PingDay thisDay in data.thePings)
            {
                if (thisDay.todayPings.Count > 10)
                {

                    if (firstPingError)
                    {
                        errorMessage += "PING ERROR: ";
                        firstPingError = false;

                    }
                        for(int a = 0;a< thisDay.todayPings.Count-1; a++)
                        {
                            if (thisDay.todayPings[a].result.Equals("Error"))
                            {
                                if (thisDay.todayPings[a].stackTrace.Equals("No such host is known"))
                                {

                                    errorMessage += "\n The host is unknown";
                                }
                                else
                                {
                                    errorMessage += "unkown error: " + thisDay.todayPings[j].stackTrace;
                                }

                            }

                        }

                }

            }

            for (int k = 0; k < data.andonData.Count - 1; k++)
            {
                String andonData = "ID : " + data.andonData[k].ID + ", Countermeasure : " + data.andonData[k].Countermeasure + ", DTID : " + data.andonData[k].DTID
                    + ", Loadtime : " + data.andonData[k].LoadTime + ", DowntimeType : " + data.andonData[k].DowntimeType + ", Operator : " + data.andonData[k].Operator
                    + "Concern Type : " + data.andonData[k].ConcernType + "\n";
            }

                return data;
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> Create(int applicationGroupId, int applicationId, [FromBody] ErrorPost errorCreate)
 {
     try
     {
         return(Json(await _errorTemplateRepository.Create(applicationId, errorCreate)));
     }
     catch (Exception e)
     {
         _logger.LogError($"[{System.Reflection.MethodBase.GetCurrentMethod().Name}] {e.Message ?? ""}", e);
         return(BadRequest(e.Message ?? ""));
     }
 }