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
ConstructorDescriptionTaskSchedulerController
(SchedulerService schedulerService) Create aTaskSchedulerController
that delegates task scheduling operations viaSchedulerService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteSchedulesforDefinition
(String taskDefinitionName) Remove schedules for a specificTaskDefinition
name .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 ofScheduleInfo
s for a specificTaskDefinition
name.getSchedule
(String scheduleName, String platform) Return aScheduleInfo
for 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 ofScheduleInfo
s.void
save
(String scheduleName, String taskDefinitionName, String properties, String arguments, String platform) Create a schedule for an existingTaskDefinition
name.void
unschedule
(String scheduleName, String platform) Unschedule the schedule from the Scheduler.
-
Constructor Details
-
TaskSchedulerController
Create aTaskSchedulerController
that 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 ofScheduleInfo
s.- Parameters:
assembler
- assembler for theScheduleInfo
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 aScheduleInfo
for a specific Schedule.- Parameters:
scheduleName
- assembler for theScheduleInfo
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 ofScheduleInfo
s for a specificTaskDefinition
name.- 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 specificTaskDefinition
name .- 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 existingTaskDefinition
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 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.
-