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 Summary
ConstructorsConstructorDescriptionTaskSchedulerController(SchedulerService schedulerService) Create aTaskSchedulerControllerthat delegates task scheduling operations viaSchedulerService -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteSchedulesforDefinition(String taskDefinitionName) Remove schedules for a specificTaskDefinitionname .org.springframework.hateoas.PagedModel<ScheduleInfoResource>filteredList(String taskDefinitionName, String platform, org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> assembler) Return a page-able list ofScheduleInfos for a specificTaskDefinitionname.getSchedule(String scheduleName, String platform) Return aScheduleInfofor a specific Schedule.org.springframework.hateoas.PagedModel<ScheduleInfoResource>list(org.springframework.data.domain.Pageable pageable, String platform, org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> assembler) Return a page-able list ofScheduleInfos.voidsave(String scheduleName, String taskDefinitionName, String properties, String arguments, String platform) Create a schedule for an existingTaskDefinitionname.voidunschedule(String scheduleName, String platform) Unschedule the schedule from the Scheduler.
-
Constructor Details
-
TaskSchedulerController
Create aTaskSchedulerControllerthat delegates- task scheduling operations via
SchedulerService
- Parameters:
schedulerService- the scheduler service to use to delegate task scheduler operations.
- task scheduling operations via
-
-
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 ofScheduleInfos.- Parameters:
assembler- assembler for theScheduleInfoplatform- the name of the platform from which schedules will be retrieved.pageable-Pageableto 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 aScheduleInfofor a specific Schedule.- Parameters:
scheduleName- assembler for theScheduleInfoplatform- the name of the platform from which the schedule will be retrieved.- Returns:
- a
ScheduleInfoResourceinstance 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 ofScheduleInfos for a specificTaskDefinitionname.- Parameters:
taskDefinitionName- name of the taskDefinition to search.platform- name of the platform from which the list is retrieved.assembler- assembler for theScheduleInfo.- Returns:
- a list of Schedules.
-
deleteSchedulesforDefinition
@DeleteMapping("/instances/{taskDefinitionName}") @ResponseStatus(OK) public void deleteSchedulesforDefinition(@PathVariable String taskDefinitionName) Remove schedules for a specificTaskDefinitionname .- Parameters:
taskDefinitionName- the name of theTaskDefinition.
-
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 existingTaskDefinitionname.- 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 pairsarguments- the runtime commandline argumentsplatform- 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 deletedplatform- name of the platform from which the schedule is deleted.
-