org.springframework.cloud.dataflow.server.controller

## Class JobInstanceController

- java.lang.Object
- - org.springframework.cloud.dataflow.server.controller.JobInstanceController

-     @RestController
       @RequestMapping(value="/jobs/instances")
       @ExposesResourceFor(value=JobInstanceResource.class)
      public class JobInstanceController
      extends Object

  Controller for operations on `JobInstance`. This includes obtaining Job Instance information from the job service.
  Author:
    Glenn Renfro, Gunnar Hillert

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobInstanceController(TaskJobService taskJobService)` Creates a `JobInstanceController` that retrieves Job Instance information.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.hateoas.PagedModel<JobInstanceResource>` | `list(String jobName, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<JobInstanceExecutions> assembler)` Return a page-able list of `JobInstanceResource` defined jobs.
    `JobInstanceResource` | `view(long id)` View the details of a single task instance, specified by id.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JobInstanceController

          @Autowired
          public JobInstanceController(TaskJobService taskJobService)

      Creates a `JobInstanceController` that retrieves Job Instance information.
      Parameters:
        `taskJobService` - the `TaskJobService` used for retrieving batch instance data.

  - ### Method Detail

    - #### list

          @RequestMapping(value="",
                          method=GET,
                          params="name")
           @ResponseStatus(value=OK)
          public org.springframework.hateoas.PagedModel<JobInstanceResource> list(@RequestParam(value="name")
                                                                                                                                                                                                  String jobName,
                                                                                                                                                                                                  org.springframework.data.domain.Pageable pageable,
                                                                                                                                                                                                  org.springframework.data.web.PagedResourcesAssembler<JobInstanceExecutions> assembler)
                                                                                                                                                                                           throws org.springframework.batch.core.launch.NoSuchJobException

      Return a page-able list of `JobInstanceResource` defined jobs.
      Parameters:
        `jobName` - the name of the job
        `pageable` - page-able collection of `JobInstance`s.
        `assembler` - for the `JobInstance`s
      Returns:
        a list of Job Instance
      Throws:
        `org.springframework.batch.core.launch.NoSuchJobException` - if the job for jobName specified does not exist.

    - #### view

          @RequestMapping(value="/{id}",
                          method=GET)
           @ResponseStatus(value=OK)
          public JobInstanceResource view(@PathVariable(value="id")
                                                                                                                                long id)
                                                                                                                         throws org.springframework.batch.core.launch.NoSuchJobInstanceException,
                                                                                                                                org.springframework.batch.core.launch.NoSuchJobException

      View the details of a single task instance, specified by id.
      Parameters:
        `id` - the id of the requested `JobInstance`
      Returns:
        the `JobInstance`
      Throws:
        `org.springframework.batch.core.launch.NoSuchJobInstanceException` - if job instance for the id does not exist.
        `org.springframework.batch.core.launch.NoSuchJobException` - if the job for the job instance does not exist.

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.