@RequestMapping(value = "", method = RequestMethod.GET, params = "jobname", produces = "application/json")
	@ResponseStatus(HttpStatus.OK)
	public Collection<JobInstanceInfoResource> instancesForJob(@RequestParam("jobname") String jobName,
			@RequestParam(defaultValue = "0") int startJobInstance, @RequestParam(defaultValue = "20") int pageSize) {

		try {
			Collection<JobInstance> jobInstances = jobService.listJobInstances(jobName, startJobInstance, pageSize);
			List<JobInstanceInfoResource> result = new ArrayList<JobInstanceInfoResource>();
			for (JobInstance jobInstance : jobInstances) {
				List<JobExecution> jobExecutions = (List<JobExecution>) jobService.getJobExecutionsForJobInstance(
						jobName, jobInstance.getId());
				List<JobExecutionInfo> jobExecutionInfos = new ArrayList<JobExecutionInfo>();
				for (JobExecution jobExecution : jobExecutions) {
					jobExecutionInfos.add(new JobExecutionInfo(jobExecution, timeZone));
				}
				result.add(jobInstanceInfoResourceAssembler.toResource(new JobInstanceInfo(jobInstance,
						jobExecutionInfos)));
			}
			return result;
		}
		catch (NoSuchJobException e) {
			throw new NoSuchBatchJobException(jobName);
		}
	}
Return a paged collection of job instances for a given job.

@param jobName name of the batch job
@param startJobInstance start index for the job instance
@param pageSize page size for the list
@return collection of JobInstances by job name
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/BatchJobInstancesController.java