org.springframework.cloud.dataflow.server.controller

## Class TaskSchedulerController

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

-     @RestController
       @RequestMapping(value="/tasks/schedules")
       @ExposesResourceFor(value=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

    Constructors
    Constructor and Description
    `TaskSchedulerController(SchedulerService schedulerService)` Create a `TaskSchedulerController` that delegates task scheduling operations via `SchedulerService`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deleteSchedulesforDefinition(String taskDefinitionName)` Remove schedules for a specific `TaskDefinition` 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 of `ScheduleInfo`s for a specific `TaskDefinition` name.
    `ScheduleInfoResource` | `getSchedule(String scheduleName, String platform)` Return a `ScheduleInfo` 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 of `ScheduleInfo`s.
    `void` | `save(String scheduleName, String taskDefinitionName, String properties, String arguments, String platform)` Create a schedule for an existing `TaskDefinition` name.
    `void` | `unschedule(String scheduleName, String platform)` Unschedule the schedule from the Scheduler.

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

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

- - ### Constructor Detail

    - #### TaskSchedulerController

          public TaskSchedulerController(SchedulerService schedulerService)

      Create a `TaskSchedulerController` that delegates
      - task scheduling operations via `SchedulerService`
      Parameters:
        `schedulerService` - the scheduler service to use to delegate task scheduler operations.

  - ### Method Detail

    - #### list

          @RequestMapping(value="",
                          method=GET)
           @ResponseStatus(value=OK)
          public org.springframework.hateoas.PagedModel<ScheduleInfoResource> list(org.springframework.data.domain.Pageable pageable,
                                                                                                                                                                    @RequestParam(value="platform",required=false)
                                                                                                                                                                    String platform,
                                                                                                                                                                    org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> assembler)

      Return a page-able list of `ScheduleInfo`s.
      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

          @RequestMapping(value="/{name}",
                          method=GET)
           @ResponseStatus(value=OK)
          public ScheduleInfoResource getSchedule(@PathVariable(value="name")
                                                                                                                                          String scheduleName,
                                                                                                                                          @RequestParam(value="platform",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(value="/instances/{taskDefinitionName}")
          public org.springframework.hateoas.PagedModel<ScheduleInfoResource> filteredList(@PathVariable
                                                                                                                                                    String taskDefinitionName,
                                                                                                                                                    @RequestParam(value="platform",required=false)
                                                                                                                                                    String platform,
                                                                                                                                                    org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo> assembler)

      Return a page-able list of `ScheduleInfo`s 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

          @RequestMapping(value="/instances/{taskDefinitionName}",
                          method=DELETE)
           @ResponseStatus(value=OK)
          public void deleteSchedulesforDefinition(@PathVariable
                                                                                                                                                                      String taskDefinitionName)

      Remove schedules for a specific `TaskDefinition` name .
      Parameters:
        `taskDefinitionName` - the name of the `TaskDefinition`.

    - #### save

          @RequestMapping(value="",
                          method=POST)
           @ResponseStatus(value=CREATED)
          public void save(@RequestParam(value="scheduleName")
                                                                                                                  String scheduleName,
                                                                                                                  @RequestParam(value="taskDefinitionName")
                                                                                                                  String taskDefinitionName,
                                                                                                                  @RequestParam
                                                                                                                  String properties,
                                                                                                                  @RequestParam(required=false)
                                                                                                                  String arguments,
                                                                                                                  @RequestParam(value="platform",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

          @RequestMapping(value="/{scheduleName}",
                          method=DELETE)
           @ResponseStatus(value=OK)
          public void unschedule(@PathVariable(value="scheduleName")
                                                                                                                                    String scheduleName,
                                                                                                                                    @RequestParam(value="platform",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.

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