Class TaskSchedulerController

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

@RestController @RequestMapping("/tasks/schedules") @ExposesResourceFor(ScheduleInfoResource.class) public class TaskSchedulerController extends Object
Controller for operations on ScheduleInfo. This includes CRUD operations.
Author:
Glenn Renfro, Christian Tzolov, Ilayaperumal Gopinathan
  • Constructor Details

    • TaskSchedulerController

      public TaskSchedulerController(SchedulerService schedulerService)
      Create a TaskSchedulerController that delegates
      Parameters:
      schedulerService - the scheduler service to use to delegate task scheduler operations.
  • Method Details

    • list

      @GetMapping("") @ResponseStatus(OK) public org.springframework.hateoas.PagedModel<ScheduleInfoResource> list(org.springframework.data.domain.Pageable pageable, @RequestParam(required=false) String platform, org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> assembler)
      Return a page-able list of ScheduleInfos.
      Parameters:
      assembler - assembler for the ScheduleInfo
      platform - the name of the platform from which schedules will be retrieved.
      pageable - Pageable to be used
      Returns:
      a list of Schedules
    • getSchedule

      @GetMapping("/{name}") @ResponseStatus(OK) public ScheduleInfoResource getSchedule(@PathVariable("name") String scheduleName, @RequestParam(required=false) String platform)
      Return a ScheduleInfo for a specific Schedule.
      Parameters:
      scheduleName - assembler for the ScheduleInfo
      platform - the name of the platform from which the schedule will be retrieved.
      Returns:
      a ScheduleInfoResource instance for the scheduleName specified.
    • filteredList

      @RequestMapping("/instances/{taskDefinitionName}") public org.springframework.hateoas.PagedModel<ScheduleInfoResource> filteredList(@PathVariable String taskDefinitionName, @RequestParam(required=false) String platform, org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> assembler)
      Return a page-able list of ScheduleInfos for a specific TaskDefinition name.
      Parameters:
      taskDefinitionName - name of the taskDefinition to search.
      platform - name of the platform from which the list is retrieved.
      assembler - assembler for the ScheduleInfo.
      Returns:
      a list of Schedules.
    • deleteSchedulesforDefinition

      @DeleteMapping("/instances/{taskDefinitionName}") @ResponseStatus(OK) public void deleteSchedulesforDefinition(@PathVariable String taskDefinitionName)
      Remove schedules for a specific TaskDefinition name .
      Parameters:
      taskDefinitionName - the name of the TaskDefinition.
    • save

      @PostMapping("") @ResponseStatus(CREATED) public void save(@RequestParam String scheduleName, @RequestParam String taskDefinitionName, @RequestParam String properties, @RequestParam(required=false) String arguments, @RequestParam(required=false) String platform)
      Create a schedule for an existing TaskDefinition name.
      Parameters:
      scheduleName - the name of the schedule being created.
      taskDefinitionName - the name of the existing task to be executed (required)
      properties - the runtime properties for the task, as a comma-delimited list of key=value pairs
      arguments - the runtime commandline arguments
      platform - the name of the platform for which the schedule is created.
    • unschedule

      @DeleteMapping("/{scheduleName}") @ResponseStatus(OK) public void unschedule(@PathVariable String scheduleName, @RequestParam(required=false) String platform)
      Unschedule the schedule from the Scheduler.
      Parameters:
      scheduleName - name of the schedule to be deleted
      platform - name of the platform from which the schedule is deleted.