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, Corneil du Plessis
  • Method Details

    • 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

      LaunchResponseResource 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 TaskExecutions.
      Parameters:
      ids - comma delimited set of TaskExecution ids to stop.
    • stop

      void stop(String ids, String platform)
      Request the stop of a group TaskExecutions.
      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.
    • thinExecutionList

      org.springframework.hateoas.PagedModel<TaskExecutionThinResource> thinExecutionList()
      Returns:
      the list of thin task executions known to the system.
    • thinExecutionListByTaskName

      org.springframework.hateoas.PagedModel<TaskExecutionThinResource> thinExecutionListByTaskName(String taskName)
      List task executions filtered by task name.
      Returns:
      the page of task executions for the given task name.
    • 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.
      Returns:
      the number of task executions.
    • 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.