org.springframework.cloud.dataflow.shell.command

## Class TaskCommands

- java.lang.Object
- - org.springframework.cloud.dataflow.shell.command.TaskCommands

- All Implemented Interfaces:
    org.springframework.shell.core.CommandMarker

      @Component
      public class TaskCommands
      extends Object
      implements org.springframework.shell.core.CommandMarker

  Task commands.
  Author:
    Glenn Renfro, Michael Minella, Gunnar Hillert, Ilayaperumal Gopinathan, Janne Valkealahti, David Turanski, Mike Baranski

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected UserInput` | `userInput`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskCommands()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `availableWithCreateRole()`
    `boolean` | `availableWithDeployRole()`
    `boolean` | `availableWithDestroyRole()`
    `boolean` | `availableWithUnDeployRole()`
    `boolean` | `availableWithViewRole()`
    `String` | `cleanup(Long id, boolean all, boolean completed, String taskName, boolean force)`
    `String` | `create(String name, String dsl, String description)`
    `Table` | `currentExecutions()`
    `String` | `destroy(String name, boolean cleanup)`
    `String` | `destroyAll(boolean force)`
    `Table` | `display(long id)`
    `Table` | `executionListByName(String name)`
    `String` | `launch(String name, String properties, File propertiesFile, String arguments, String platformName)`
    `Table` | `list()`
    `Table` | `listPlatforms()`
    `String` | `retrieveTaskExecutionLog(long id, String platform)`
    `String` | `stop(String ids, String platform)`
    `List<Object>` | `validate(String name)`

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

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

- - ### Field Detail

    - #### userInput

          @Autowired
          protected UserInput userInput

  - ### Constructor Detail

    - #### TaskCommands

          public TaskCommands()

  - ### Method Detail

    - #### availableWithCreateRole

          @CliAvailabilityIndicator(value="task create")
          public boolean availableWithCreateRole()

    - #### availableWithDeployRole

          @CliAvailabilityIndicator(value="task launch")
          public boolean availableWithDeployRole()

    - #### availableWithUnDeployRole

          @CliAvailabilityIndicator(value="task execution stop")
          public boolean availableWithUnDeployRole()

    - #### availableWithDestroyRole

          @CliAvailabilityIndicator(value={"task destroy","task all destroy","task execution cleanup"})
          public boolean availableWithDestroyRole()

    - #### availableWithViewRole

          @CliAvailabilityIndicator(value={"task execution list","task list","task platform-list","task execution current","task execution status","task validate"})
          public boolean availableWithViewRole()

    - #### list

          @CliCommand(value="task list",
                      help="List created tasks")
          public Table list()

    - #### listPlatforms

          @CliCommand(value="task platform-list",
                      help="List platform accounts for tasks")
          public Table listPlatforms()

    - #### validate

          @CliCommand(value="task validate",
                      help="Validate apps contained in task definitions")
          public List<Object> validate(@CliOption(key={"","name"},help="the task definition name",mandatory=true)
                                                                                                                                          String name)
                                                                                                                                   throws OperationNotSupportedException

      Throws:
        `OperationNotSupportedException`

    - #### create

          @CliCommand(value="task create",
                      help="Create a new task definition")
          public String create(@CliOption(mandatory=true,key={"","name"},help="the name to give to the task")
                                                                                                                 String name,
                                                                                                                 @CliOption(mandatory=true,key="definition",help="a task definition, using the DSL (e.g. \"timestamp --format=YYYY\")",optionContext="disable-string-converter completion-task")
                                                                                                                 String dsl,
                                                                                                                 @CliOption(mandatory=false,key="description",help="a sort description about the task",unspecifiedDefaultValue="")
                                                                                                                 String description)

    - #### launch

          @CliCommand(value="task launch",
                      help="Launch a previously created task")
          public String launch(@CliOption(key={"","name"},help="the name of the task to launch",mandatory=true,optionContext="existing-task disable-string-converter")
                                                                                                                     String name,
                                                                                                                     @CliOption(key="properties",help="the properties for this launch")
                                                                                                                     String properties,
                                                                                                                     @CliOption(key="propertiesFile",help="the properties for this launch (as a File)")
                                                                                                                     File propertiesFile,
                                                                                                                     @CliOption(key="arguments",help="the commandline arguments for this launch")
                                                                                                                     String arguments,
                                                                                                                     @CliOption(key="platformName",help="the platform name to use for this launch")
                                                                                                                     String platformName)
                                                                                                              throws IOException

      Throws:
        `IOException`

    - #### stop

          @CliCommand(value="task execution stop",
                      help="Stop executing tasks")
          public String stop(@CliOption(key={"","ids"},help="the task execution id",mandatory=true)
                                                                                                               String ids,
                                                                                                               @CliOption(key="platformName",help="the name of the platform where the task is executing")
                                                                                                               String platform)

    - #### retrieveTaskExecutionLog

          @CliCommand(value="task execution log",
                      help="Retrieve task execution log")
          public String retrieveTaskExecutionLog(@CliOption(key={"","id"},help="the task execution id",mandatory=true)
                                                                                                                                         long id,
                                                                                                                                         @CliOption(key="platform",help="the platform of the task execution",mandatory=false)
                                                                                                                                         String platform)
                                                                                                                                  throws com.fasterxml.jackson.core.JsonProcessingException

      Throws:
        `com.fasterxml.jackson.core.JsonProcessingException`

    - #### destroy

          @CliCommand(value="task destroy",
                      help="Destroy an existing task")
          public String destroy(@CliOption(key={"","name"},help="the name of the task to destroy",mandatory=true,optionContext="existing-task disable-string-converter")
                                                                                                               String name,
                                                                                                               @CliOption(key="cleanup",help="the boolean flag to set if task executions and related resources need to be cleaned",unspecifiedDefaultValue="false",specifiedDefaultValue="true")
                                                                                                               boolean cleanup)

    - #### destroyAll

          @CliCommand(value="task all destroy",
                      help="Destroy all existing tasks")
          public String destroyAll(@CliOption(key="force",help="bypass confirmation prompt",unspecifiedDefaultValue="false",specifiedDefaultValue="true")
                                                                                                                        boolean force)

    - #### executionListByName

          @CliCommand(value="task execution list",
                      help="List created task executions filtered by taskName")
          public Table executionListByName(@CliOption(key="name",help="the task name to be used as a filter",optionContext="existing-task disable-string-converter")
                                                                                                                                                          String name)

    - #### display

          @CliCommand(value="task execution status",
                      help="Display the details of a specific task execution")
          public Table display(@CliOption(key={"","id"},help="the task execution id",mandatory=true)
                                                                                                                                               long id)

    - #### currentExecutions

          @CliCommand(value="task execution current",
                      help="Display count of currently executin tasks and related information")
          public Table currentExecutions()

    - #### cleanup

          @CliCommand(value="task execution cleanup",
                      help="Clean up any platform specific resources linked to a task execution")
          public String cleanup(@CliOption(key={"","id"},help="the task execution id")
                                                                                                                                                                    Long id,
                                                                                                                                                                    @CliOption(key="all",help="all task execution IDs",unspecifiedDefaultValue="false",specifiedDefaultValue="true")
                                                                                                                                                                    boolean all,
                                                                                                                                                                    @CliOption(key="completed-executions",help="cleanup only the completed task executions",unspecifiedDefaultValue="false",specifiedDefaultValue="true")
                                                                                                                                                                    boolean completed,
                                                                                                                                                                    @CliOption(key="task-name",help="the name of the task to cleanup")
                                                                                                                                                                    String taskName,
                                                                                                                                                                    @CliOption(key="force",help="all task execution IDs",unspecifiedDefaultValue="false",specifiedDefaultValue="true")
                                                                                                                                                                    boolean force)

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