public QueryResponse Put([FromBody] NativeExecJob model) { Logger.DebugFormat("Entered NativeJobsController.Put(). Job Name = {0}", model.JobName); var authorizedJobGroups = _permissionsHelper.GetAuthorizedJobGroups().ToList(); if ((authorizedJobGroups.Contains(model.JobGroup) || authorizedJobGroups.Contains("*")) && model.JobGroup != "*") { return(CreateJob(model)); } throw new HttpResponseException(HttpStatusCode.Unauthorized); }
private QueryResponse CreateJob(NativeExecJob model) { var dataMap = new Dictionary <string, object> { { "command", model.Command }, { "parameters", model.Parameters }, { "waitForProcess", model.WaitForProcess.ToString() }, { "consumeStreams", model.ConsumeStreams.ToString() }, { "workingDirectory", model.WorkingDirectory } }; return(base.CreateJob(model, typeof(NativeJob), dataMap, model.Description)); }
public QueryResponse Post([FromBody] NativeExecJob model) { Logger.DebugFormat("Entered NativeJobsController.Post(). Job Name = {0}", model.JobName); var dataMap = new Dictionary <string, object> { { "command", model.Command }, { "parameters", model.Parameters }, { "waitForProcess", model.WaitForProcess.ToString() }, { "consumeStreams", model.ConsumeStreams.ToString() }, { "workingDirectory", model.WorkingDirectory } }; return(base.CreateJob(model, typeof(NativeJob), dataMap, model.Description)); }
public QueryResponse Put([FromBody] NativeExecJob model) { Logger.DebugFormat("Entered NativeJobsController.Put(). Job Name = {0}", model.JobName); return(CreateJob(model)); }