org.springframework.cloud.dataflow.rest.client

## Interface TaskOperations

- All Known Implementing Classes:
    TaskTemplate

      public interface TaskOperations

  Interface defining operations available against tasks.
  Author:
    Glenn Renfro, Michael Minella, Gunnar Hillert, David Turanski

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup(long id)` Cleanup any resources associated with the execution for the id specified.
    `void` | `cleanup(long id, boolean removeData)` Cleanup any resources associated with the execution for the id specified.
    `void` | `cleanupAllTaskExecutions(boolean completed, String taskName)` Cleanup any resources associated with the matching task executions.
    `TaskDefinitionResource` | `create(String name, String definition, String description)` Create a new task definition
    `Collection<CurrentTaskExecutionsResource>` | `currentTaskExecutions()` Return information including the count of currently executing tasks and task execution limits.
    `void` | `destroy(String name)` Destroy an existing task.
    `void` | `destroy(String name, boolean cleanup)` Destroy an existing task with the flag to cleanup task resources.
    `void` | `destroyAll()` Destroy all existing tasks.
    `org.springframework.hateoas.PagedModel<TaskExecutionResource>` | `executionList()`
    `org.springframework.hateoas.PagedModel<TaskExecutionResource>` | `executionListByTaskName(String taskName)` List task executions known to the system filtered by task name.
    `Integer` | `getAllTaskExecutionsCount(boolean completed, String taskName)` Get the task executions count with the option to filter only the completed task executions.
    `long` | `launch(String name, Map<String,String> properties, List<String> arguments)` Launch an already created task.
    `org.springframework.hateoas.PagedModel<TaskDefinitionResource>` | `list()`
    `org.springframework.hateoas.PagedModel<LauncherResource>` | `listPlatforms()`
    `void` | `stop(String ids)` Request the stop of a group `TaskExecution`s.
    `void` | `stop(String ids, String platform)` Request the stop of a group `TaskExecution`s.
    `String` | `taskExecutionLog(String externalExecutionId)` Return the task execution log.
    `String` | `taskExecutionLog(String externalExecutionId, String platform)` Return the task execution log.
    `TaskExecutionResource` | `taskExecutionStatus(long id)` Return the `TaskExecutionResource` for the id specified.
    `TaskAppStatusResource` | `validateTaskDefinition(String taskDefinitionName)` Return the validation status for the tasks in an definition.

- - ### Method Detail

    - #### list

          org.springframework.hateoas.PagedModel<TaskDefinitionResource> list()

      Returns:
        the list tasks known to the system.

    - #### listPlatforms

          org.springframework.hateoas.PagedModel<LauncherResource> listPlatforms()

      Returns:
        the list of platform accounts for tasks.

    - #### create

          TaskDefinitionResource create(String name,
                                        String definition,
                                        String description)

      Create a new task definition
      Parameters:
        `name` - the name of the task
        `definition` - the task definition DSL
        `description` - the description of the task definition
      Returns:
        the task definition

    - #### launch

          long launch(String name,
                      Map<String,String> properties,
                      List<String> arguments)

      Launch an already created task.
      Parameters:
        `name` - the name of the task
        `properties` - the deployment properties
        `arguments` - the command line arguments
      Returns:
        long containing the TaskExecutionId

    - #### stop

          void stop(String ids)

      Request the stop of a group `TaskExecution`s.
      Parameters:
        `ids` - comma delimited set of `TaskExecution` ids to stop.

    - #### stop

          void stop(String ids,
                    String platform)

      Request the stop of a group `TaskExecution`s.
      Parameters:
        `ids` - comma delimited set of `TaskExecution` ids to stop.
        `platform` - the platform name where the task is executing.

    - #### destroy

          void destroy(String name)

      Destroy an existing task.
      Parameters:
        `name` - the name of the task

    - #### destroy

          void destroy(String name,
                       boolean cleanup)

      Destroy an existing task with the flag to cleanup task resources.
      Parameters:
        `name` - the name of the task
        `cleanup` - flag indicates task execution cleanup

    - #### executionList

          org.springframework.hateoas.PagedModel<TaskExecutionResource> executionList()

      Returns:
        the list task executions known to the system.

    - #### executionListByTaskName

          org.springframework.hateoas.PagedModel<TaskExecutionResource> executionListByTaskName(String taskName)

      List task executions known to the system filtered by task name.
      Parameters:
        `taskName` - of the executions.
      Returns:
        the paged list of task executions for the given task name

    - #### taskExecutionStatus

          TaskExecutionResource taskExecutionStatus(long id)

      Return the `TaskExecutionResource` for the id specified.
      Parameters:
        `id` - identifier of the task execution
      Returns:
        `TaskExecutionResource`

    - #### taskExecutionLog

          String taskExecutionLog(String externalExecutionId)

      Return the task execution log. The platform from which to retrieve the log will be set to `default`.
      Parameters:
        `externalExecutionId` - the external execution identifier of the task execution.
      Returns:
        `String` containing the log.

    - #### taskExecutionLog

          String taskExecutionLog(String externalExecutionId,
                                  String platform)

      Return the task execution log.
      Parameters:
        `externalExecutionId` - the external execution identifier of the task execution.
        `platform` - the platform from which to obtain the log.
      Returns:
        `String` containing the log.

    - #### currentTaskExecutions

          Collection<CurrentTaskExecutionsResource> currentTaskExecutions()

      Return information including the count of currently executing tasks and task execution limits.
      Returns:
        Collection of `CurrentTaskExecutionsResource`

    - #### cleanup

          void cleanup(long id)

      Cleanup any resources associated with the execution for the id specified.
      Parameters:
        `id` - identifier of the task execution

    - #### cleanup

          void cleanup(long id,
                       boolean removeData)

      Cleanup any resources associated with the execution for the id specified.
      Parameters:
        `id` - identifier of the task execution
        `removeData` - delete the history of the execution

    - #### cleanupAllTaskExecutions

          void cleanupAllTaskExecutions(boolean completed,
                                        String taskName)

      Cleanup any resources associated with the matching task executions.
      Parameters:
        `completed` - cleanup only completed task executions
        `taskName` - the name of the task to cleanup, if null then all the tasks are considered.

    - #### getAllTaskExecutionsCount

          Integer getAllTaskExecutionsCount(boolean completed,
                                            String taskName)

      Get the task executions count with the option to filter only the completed task executions.
      Parameters:
        `completed` - cleanup only completed task executions
        `taskName` - the name of the task to cleanup, if null then all the tasks are considered.

    - #### validateTaskDefinition

          TaskAppStatusResource validateTaskDefinition(String taskDefinitionName)
                                                throws OperationNotSupportedException

      Return the validation status for the tasks in an definition.
      Parameters:
        `taskDefinitionName` - The name of the task definition to be validated.
      Returns:
        `TaskAppStatusResource` containing the task app statuses.
      Throws:
        `OperationNotSupportedException` - if the server does not support task validation

    - #### destroyAll

          void destroyAll()

      Destroy all existing tasks.

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