public List <string> SubmitJobs([FromBody] List <Job> newJobs, string batchId = "") { try { // Parameter validations GeresAssertionHelper.AssertNull(newJobs, "newJobs"); foreach (var j in newJobs) { AssertJobParameter(j); } var logJobs = string.Join(", ", newJobs.Select(j => j.JobName).ToArray()); GeresEventSource.Log.WebApiSubmitJobsReceived(newJobs.Count, logJobs, logJobs, batchId); var jobIds = _jobController.SubmitJobs(newJobs, batchId); GeresEventSource.Log.WebApiSubmitJobsSuccessful(newJobs.Count, string.Join(", ", jobIds.ToArray()), batchId); return(jobIds); } catch (ArgumentException ex) { Trace.TraceWarning("WebAPI - JobController -- Invalid job passed into system: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); GeresEventSource.Log.WebApiSubmitJobsInvalidParameterSubmitted(batchId, ex.Message, ex.StackTrace); throw new HttpResponseException(HttpStatusCode.BadRequest); } catch (InvalidOperationException ex) { Trace.TraceWarning("WebAPI - JobController -- Job could not be submitted to system: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); var logJobs = string.Join(", ", newJobs.Select(j => j.JobName).ToArray()); GeresEventSource.Log.WebApiSubmitJobsFailed(newJobs.Count, logJobs, logJobs, batchId, ex.Message, ex.StackTrace); throw new HttpResponseException(HttpStatusCode.BadRequest); } catch (Exception ex) { Trace.TraceError("WebAPI - JobController -- Unknown exception occured: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); GeresEventSource.Log.WebApiUnknownExceptionOccured(ex.Message, ex.StackTrace); throw new HttpResponseException(HttpStatusCode.InternalServerError); } }