Пример #1
0
        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);
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        public QueryResponse Put([FromBody] NativeExecJob model)
        {
            Logger.DebugFormat("Entered NativeJobsController.Put(). Job Name = {0}", model.JobName);

            return(CreateJob(model));
        }