Search in sources :

Example 1 with JobQuery

use of org.platformlayer.ops.tasks.JobQuery in project platformlayer by platformlayer.

the class JobsCollectionResource method getActiveJobs.

@GET
@Produces({ XML, JSON })
public JobDataList getActiveJobs() throws OpsException {
    JobQuery jobQuery = JobQuery.build(getProject(), filterTarget);
    List<JobData> jobList = jobRegistry.listRecentJobs(jobQuery);
    JobDataList jobs = JobDataList.create();
    jobs.jobs = Lists.newArrayList();
    for (JobData jobData : jobList) {
        jobs.jobs.add(jobData);
    }
    return jobs;
}
Also used : JobQuery(org.platformlayer.ops.tasks.JobQuery) JobDataList(org.platformlayer.jobs.model.JobDataList) JobData(org.platformlayer.jobs.model.JobData) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with JobQuery

use of org.platformlayer.ops.tasks.JobQuery in project platformlayer by platformlayer.

the class JobsCollectionResource method getExecutions.

@GET
@Path("runs")
@Produces({ XML, JSON })
public JobExecutionList getExecutions() throws OpsException {
    JobQuery jobQuery = JobQuery.build(getProject(), filterTarget);
    JobExecutionList executions = jobRegistry.listRecentExecutions(jobQuery);
    return executions;
}
Also used : JobQuery(org.platformlayer.ops.tasks.JobQuery) JobExecutionList(org.platformlayer.jobs.model.JobExecutionList) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)2 Produces (javax.ws.rs.Produces)2 JobQuery (org.platformlayer.ops.tasks.JobQuery)2 Path (javax.ws.rs.Path)1 JobData (org.platformlayer.jobs.model.JobData)1 JobDataList (org.platformlayer.jobs.model.JobDataList)1 JobExecutionList (org.platformlayer.jobs.model.JobExecutionList)1