public string SubmitJob([FromBody] Job newJob, string batchId = "") { try { // Parameter Validations AssertJobParameter(newJob); GeresEventSource.Log.WebApiSubmitJobReceived(newJob.JobType, newJob.JobName, newJob.Parameters); var jobId = _jobController.SubmitJob(newJob, batchId); GeresEventSource.Log.WebApiSubmitJobSuccessful(jobId, newJob.JobType, newJob.JobName, newJob.Parameters); return(jobId); } catch (ArgumentException ex) { Trace.TraceWarning("WebAPI - JobController -- Invalid job passed into system: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); GeresEventSource.Log.WebApiSubmitJobInvalidParameterSubmitted(newJob.JobType, newJob.JobName, newJob.Parameters, 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); GeresEventSource.Log.WebApiSubmitJobFailed(newJob.JobType, newJob.JobName, newJob.Parameters, 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); } }