示例#1
0
        public ConfigResponse Post(ConfigCommitRequest request)
        {
            logger.Debug("id's {0} {1}", request.MainPart, request.ModulesPart);

            string errors = "";
            bool   resp   = false;

            resp = QueueService.ModProducer.broker.ValidateAndCommitConfigurations(request.MainPart, request.ModulesPart, request.AssemblysPart, out errors, request.Reset, request.Restart);
            if (resp)
            {
                errors = "OK";
            }
            else
            {
                return(new ConfigResponse()
                {
                    Result = errors,
                    ConfigCommitID = null
                });
            }
            return(new ConfigResponse()
            {
                Result = errors, // OR SOME ERROR DESCRIPTION
                ConfigCommitID = null
            });
        }
示例#2
0
        public void Options(ConfigCommitRequest request)
        {
            var resp = this.Response;

            resp.StatusCode = 200;
            resp.AddHeader("Access-Control-Allow-Origin", "*");
            resp.AddHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
            resp.AddHeader("Access-Control-Allow-Headers", "X-PINGOTHER, Content-Type");
            resp.AddHeader("Access-Control-Max-Age", "1728000");

            resp.End();
        }
示例#3
0
        public ConfigResponse Post(ConfigCommitRequest request)
        {
            logger.Debug("id's {0} {1}", request.MainPart, request.ModulesPart);

            string errors = "";
            bool resp = false;

            resp = QueueService.ModProducer.broker.ValidateAndCommitConfigurations(request.MainPart, request.ModulesPart, request.AssemblysPart, out errors, request.Reset, request.Restart);
            if (resp)
            {
                errors = "OK";
            }
            else
            {
                return new ConfigResponse()
                {
                    Result = errors,
                    ConfigCommitID = null
                };
            }
            return new ConfigResponse()
            {
                Result = errors, // OR SOME ERROR DESCRIPTION
                ConfigCommitID = null
            };
        }
示例#4
0
        public void Options(ConfigCommitRequest request)
        {
            var resp = this.Response;
            resp.StatusCode = 200;
            resp.AddHeader("Access-Control-Allow-Origin", "*");
            resp.AddHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS");
            resp.AddHeader("Access-Control-Allow-Headers", "X-PINGOTHER, Content-Type");
            resp.AddHeader("Access-Control-Max-Age", "1728000");

            resp.End();
        }