Example #1
0
        /// <summary>
        /// Get the jobs list of a project
        /// </summary>
        /// <param name="projectId">The ID, path or <see cref="Project"/> of the project.</param>
        /// <param name="options">Query options.</param>
        public async Task <IList <Job> > GetJobsAsync(ProjectId projectId, Action <JobQueryOptions> options = null)
        {
            var queryOptions = new JobQueryOptions();

            options?.Invoke(queryOptions);

            string url = _jobQueryBuilder.Build($"projects/{projectId}/jobs", queryOptions);

            return(await _httpFacade.GetPagedList <Job>(url));
        }
Example #2
0
 /// <summary>
 /// Finds all.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public IList <JobState> FindAll(JobQueryOptions options)
 {
     return(context.JobStates.Where(js => options.Statuses.ToArray().Contains(js.Status)).ToList());
 }
Example #3
0
 /// <summary>
 /// Finds the by project.
 /// </summary>
 /// <param name="projectId">The project identifier.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public IList <JobState> FindByProject(string projectId, JobQueryOptions options)
 {
     return(context.JobStates.Where(js => js.ProjectId == projectId).ToList());
 }
Example #4
0
 /// <summary>
 /// Finds the jobs by project identifier.
 /// </summary>
 /// <param name="projectId">The project identifier.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public async Task <IList <JobState> > FindByProjectIdAsync(string projectId, JobQueryOptions options)
 {
     return(await Task.FromResult(stateManager.FindByProject(projectId, options)).ConfigureAwait(true));
 }
Example #5
0
 /// <summary>
 /// Finds all jobs.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public async Task <IList <JobState> > FindAllAsync(JobQueryOptions options)
 {
     return(await Task.FromResult(stateManager.FindAll(options)).ConfigureAwait(true));
 }
Example #6
0
 /// <summary>
 /// Finds all state that matches the given options.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public IList <JobState> FindAll(JobQueryOptions options)
 {
     return(stateStore.FindAll(options));
 }
Example #7
0
 /// <summary>
 /// Finds the state by project.
 /// </summary>
 /// <param name="projectId">The project identifier.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public IList <JobState> FindByProject(string projectId, JobQueryOptions options)
 {
     return(stateStore.FindByProject(projectId, options));
 }