public IActionResult Index()
 {
     var result = _jobDefinitionService.GetJobDefinitions(User.Identity.GetUserProfileId() ?? default(long));
     if(result.Status != StatusEnum.Success)
     {
         return BadRequest();
     }
     return View(result.Value);
 }
        public async Task <IActionResult> GetJobDefinitions(int projectId)
        {
            _logger.LogInformation("Getting job definitions in project {projectId}", projectId);

            var jobDefinitions = await _jobDefinitionService.GetJobDefinitions(projectId);

            var results = _mapper.Map <List <JobDefinitionDto> >(jobDefinitions);

            return(Ok(results));
        }
示例#3
0
        public async Task <IActionResult> GetJobDefinitions(int projectId)
        {
            _logger.LogRequest("Getting job definitions in project {projectId}", projectId);

            var jobDefinitions = await _jobDefinitionService.GetJobDefinitions(projectId);

            var results = _mapper.Map <List <JobDefinitionDto> >(jobDefinitions);

            _logger.LogResponse("Job definitions in project {projectId} retrieved. Reponse body: {@results}", projectId, results);

            return(Ok(results));
        }
示例#4
0
        public override string Execute()
        {
            Console.WriteLine($"Trying to get job definitions for project {Project}...");

            string message;

            var project = _projectService.GetProjectByName(Project).Result;

            if (project != null)
            {
                var jobs = _jobDefinitionService.GetJobDefinitions(project.Id).Result;
                message = jobs.ToListCliString($"Found {jobs.Count} job definition(s):", excludedFields: new string[] {
                    "ProjectId",
                    "Tasks"
                });
            }
            else
            {
                message = $"Project {Project} was not found";
            }

            return(message);
        }