Class JobExecutionController

java.lang.Object
org.springframework.cloud.dataflow.server.controller.JobExecutionController

@RestController @RequestMapping("/jobs/executions") @ExposesResourceFor(JobExecutionResource.class) public class JobExecutionController extends Object
Controller for operations on JobExecution. This includes obtaining Job execution information from the job explorer.
Author:
Glenn Renfro, Gunnar Hillert, Corneil du Plessis
  • Constructor Details

    • JobExecutionController

      public JobExecutionController(TaskJobService taskJobService)
      Creates a JobExecutionController that retrieves Job Execution information from a the JobService
      Parameters:
      taskJobService - the service this controller will use for retrieving job execution information. Must not be null.
  • Method Details

    • retrieveJobsByParameters

      @GetMapping(value="", produces="application/json") @ResponseStatus(OK) public org.springframework.hateoas.PagedModel<JobExecutionResource> retrieveJobsByParameters(@RequestParam(value="name",required=false) String jobName, @RequestParam(required=false) org.springframework.batch.core.BatchStatus status, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<TaskJobExecution> assembler) throws org.springframework.batch.core.launch.NoSuchJobException, org.springframework.batch.core.launch.NoSuchJobExecutionException
      Retrieve all task job executions with the task name specified
      Parameters:
      jobName - name of the job. SQL server specific wildcards are enabled (eg.: myJob%, m_Job, ...)
      status - Optional status criteria.
      pageable - page-able collection of TaskJobExecutions.
      assembler - for the TaskJobExecutions
      Returns:
      list task/job executions with the specified jobName.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the job execution doesn't exist.
    • view

      @GetMapping(value="/{id}", produces="application/json") @ResponseStatus(OK) public JobExecutionResource view(@PathVariable long id) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      View the details of a single task execution, specified by id.
      Parameters:
      id - the id of the requested JobExecution
      Returns:
      the JobExecution
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the specified job execution for the id does not exist.
    • stopJobExecution

      @PutMapping(value="/{executionId}", params="stop=true") public ResponseEntity<Void> stopJobExecution(@PathVariable("executionId") long jobExecutionId) throws org.springframework.batch.core.launch.NoSuchJobExecutionException, org.springframework.batch.core.launch.JobExecutionNotRunningException
      Stop a Job Execution with the given jobExecutionId. Please be aware that you must provide the request parameter stop=true in order to invoke this endpoint.
      Parameters:
      jobExecutionId - the executionId of the job execution to stop.
      Throws:
      org.springframework.batch.core.launch.JobExecutionNotRunningException - if a stop is requested on a job that is not running.
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the job execution id specified does not exist.
    • restartJobExecution

      @PutMapping(value="/{executionId}", params="restart=true") @ResponseStatus(OK) public ResponseEntity<Void> restartJobExecution(@PathVariable("executionId") long jobExecutionId, @RequestParam(required=false) Boolean useJsonJobParameters) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      Restart the Job Execution with the given jobExecutionId. Please be aware that you must provide the request parameter restart=true in order to invoke this endpoint.
      Parameters:
      jobExecutionId - the executionId of the job execution to restart
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the job execution for the jobExecutionId specified does not exist.