public async Task <IActionResult> AllIntegrationEvents(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <IntegrationEvent> oDataHelper = new ODataHelper <IntegrationEvent>();
                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                var response = _repository.Find(null, oData.Filter, oData.Sort, oData.SortDirection, oData.Skip, oData.Top);
                IntegrationEventEntitiesLookupViewModel eventLogList = new IntegrationEventEntitiesLookupViewModel();

                if (response != null)
                {
                    eventLogList.EntityNameList = new List <string>();

                    foreach (var item in response.Items)
                    {
                        eventLogList.EntityNameList.Add(item.EntityType);
                    }
                    eventLogList.EntityNameList = eventLogList.EntityNameList.Distinct().ToList();
                }
                return(Ok(eventLogList));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
        public IActionResult Get(string driveName = null, string file = null,
                                 [FromQuery(Name = "$filter")] string filter   = "",
                                 [FromQuery(Name = "$orderby")] string orderBy = "",
                                 [FromQuery(Name = "$top")] int top            = 100,
                                 [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <FileFolderViewModel> oDataHelper = new ODataHelper <FileFolderViewModel>();

                var  oData  = oDataHelper.GetOData(HttpContext, oDataHelper);
                bool?isFile = Convert.ToBoolean(file);
                if (file == null)
                {
                    isFile = null;
                }
                var filesFolders = _manager.GetFilesFolders(isFile, driveName, oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take);

                return(Ok(filesFolders)); //return all files/folders
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
예제 #3
0
        public async Task <IActionResult> JobCheckpoints(
            string jobId,
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0
            )
        {
            try
            {
                Job job = _repository.GetOne(new Guid(jobId));
                if (job == null)
                {
                    return(NotFound("The Job ID provided does not match any existing Jobs"));
                }

                ODataHelper <JobCheckpoint> oDataHelper = new ODataHelper <JobCheckpoint>();

                Guid parentguid = Guid.Empty;

                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                return(Ok(_jobCheckpointRepo.Find(parentguid, oData.Filter, oData.Sort, oData.SortDirection, oData.Skip,
                                                  oData.Top).Items.Where(c => c.JobId == new Guid(jobId))));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
        public async Task <IActionResult> AgentHeartbeats(
            string agentId,
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0
            )
        {
            try
            {
                Agent agent = _agentRepo.GetOne(new Guid(agentId));
                if (agent == null)
                {
                    return(NotFound("The Agent ID provided does not match any existing Agents"));
                }

                ODataHelper <AgentHeartbeat> oDataHelper = new ODataHelper <AgentHeartbeat>();

                Guid parentguid = Guid.Parse(agentId);

                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                var result = _agentHeartbeatRepo.FindAllHeartbeats(parentguid, oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
예제 #5
0
        public IActionResult Get(string driveId, string type = null, string path = null,
                                 [FromQuery(Name = "$filter")] string filter   = "",
                                 [FromQuery(Name = "$orderby")] string orderBy = "",
                                 [FromQuery(Name = "$top")] int top            = 100,
                                 [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <FileFolderViewModel> oDataHelper = new ODataHelper <FileFolderViewModel>();

                var  oData  = oDataHelper.GetOData(HttpContext, oDataHelper);
                bool?isFile = true;
                if (string.IsNullOrEmpty(type))
                {
                    isFile = null;
                }
                else if (type == "Files")
                {
                    isFile = true;
                }
                else if (type == "Folders")
                {
                    isFile = false;
                }
                var response = _manager.GetFilesFolders(driveId, isFile, oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take, path);

                return(Ok(response)); //return all files / folders / files and folders
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
        public PaginatedList <SubscriptionAttemptViewModel> View(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0)
        {
            ODataHelper <SubscriptionAttemptViewModel> oDataHelper = new ODataHelper <SubscriptionAttemptViewModel>();

            var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

            return(repository.FindAllView(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take));
        }
예제 #7
0
        public PaginatedList <AllQueueItemAttachmentsViewModel> GetView(string queueItemId,
                                                                        [FromQuery(Name = "$filter")] string filter   = "",
                                                                        [FromQuery(Name = "$orderby")] string orderBy = "",
                                                                        [FromQuery(Name = "$top")] int top            = 100,
                                                                        [FromQuery(Name = "$skip")] int skip          = 0)
        {
            ODataHelper <AllQueueItemAttachmentsViewModel> oDataHelper = new ODataHelper <AllQueueItemAttachmentsViewModel>();

            var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

            return(manager.GetQueueItemAttachmentsAndNames(Guid.Parse(queueItemId), oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take));
        }
예제 #8
0
        public PaginatedList <AllSchedulesViewModel> Get(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0)
        {
            ODataHelper <AllSchedulesViewModel> oDataHelper = new ODataHelper <AllSchedulesViewModel>();

            var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

            return(manager.GetScheduleAgentsandAutomations(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take));
        }
예제 #9
0
        public PaginatedList <AllQueueItemsViewModel> View(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0
            )
        {
            ODataHelper <AllQueueItemsViewModel> oDataHelper = new ODataHelper <AllQueueItemsViewModel>();

            var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

            return(manager.GetQueueItemsAndBinaryObjectIds(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take));
        }
        public PaginatedList <AutomationExecutionViewModel> View(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0
            )
        {
            ODataHelper <AutomationExecutionViewModel> oDataHelper = new ODataHelper <AutomationExecutionViewModel>();

            var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

            return(automationExecutionLogManager.GetAutomationAndAgentNames(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take));
        }
        public async Task <IActionResult> GetView(string queueItemId,
                                                  [FromQuery(Name = "$filter")] string filter   = "",
                                                  [FromQuery(Name = "$orderby")] string orderBy = "",
                                                  [FromQuery(Name = "$top")] int top            = 100,
                                                  [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <AllQueueItemAttachmentsViewModel> oDataHelper = new ODataHelper <AllQueueItemAttachmentsViewModel>();
                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                return(Ok(_manager.GetQueueItemAttachmentsAndNames(Guid.Parse(queueItemId), oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take)));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
        public async Task <IActionResult> View(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <SubscriptionAttemptViewModel> oDataHelper = new ODataHelper <SubscriptionAttemptViewModel>();
                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                return(Ok(_repository.FindAllView(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take)));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
        public async Task <IActionResult> Get(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <AllSchedulesViewModel> oDataHelper = new ODataHelper <AllSchedulesViewModel>();
                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                return(Ok(_manager.GetScheduleAgentsandAutomations(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take)));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }