Esempio n. 1
0
        public ActionResult RunFilterAgainstAllEvents()
        {
            OneFilterRequest request = ApiRequestBase.ParseRequest <OneFilterRequest>(this);

            if (!request.Validate(out Project p, out ApiResponseBase error))
            {
                return(Json(error));
            }

            using (FilterEngine fe = new FilterEngine(request.projectName))
                fe.RunFilterAgainstAllEvents(request.filterId, true);
            return(Json(new ApiResponseBase(true)));
        }
Esempio n. 2
0
        public ActionResult GetFilter()
        {
            OneFilterRequest request = ApiRequestBase.ParseRequest <OneFilterRequest>(this);

            if (!request.Validate(out Project p, out ApiResponseBase error))
            {
                return(Json(error));
            }

            GetFilterResponse response = new GetFilterResponse();

            using (DB db = new DB(p.Name))
                response.filter = db.GetFilter(request.filterId);
            return(Json(response));
        }
Esempio n. 3
0
        public ActionResult DeleteFilter()
        {
            OneFilterRequest request = ApiRequestBase.ParseRequest <OneFilterRequest>(this);

            if (!request.Validate(out Project p, out ApiResponseBase error))
            {
                return(Json(error));
            }

            using (DB db = new DB(p.Name))
            {
                if (db.DeleteFilter(request.filterId))
                {
                    Logger.Info("[" + p.Name + "] Filter " + request.filterId + " was deleted by \"" + session.userName + "\"");
                    return(Json(new ApiResponseBase(true)));
                }
                else
                {
                    return(ApiError("Unable to delete filter " + request.filterId));
                }
            }
        }