Interface TaskBlockService

  • All Known Subinterfaces:
    TaskBlockServiceDefaults

    @Path("/tasks/v2")
    @Consumes({"application/xml","application/json"})
    @Produces({"application/xml","application/json"})
    public interface TaskBlockService
    Manages tasks with blocks on the XL Deploy Server.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void abort​(java.lang.String taskId)
      Aborts an active task.
      StepBlockState addPause​(java.lang.String taskId, java.lang.String stepPath)
      Add a pause step at the specified position.
      void archive​(java.lang.String taskId)
      Archive an executed task.
      TaskWithBlock assign​(java.lang.String taskId, java.lang.String owner)
      Assigns a task to a different user.
      void cancel​(java.lang.String taskId)
      Cancels a stopped task.
      java.util.stream.Stream<TaskWithBlock> export​(org.joda.time.LocalDate begin, org.joda.time.LocalDate end, com.xebialabs.deployit.engine.api.dto.Paging paging)
      Searches for tasks with detailed step information.
      void forceCancel​(java.lang.String taskId)
      Force-cancels a stopped task - do a best-effort cleanup, continuing on when steps of an always-run phase fail
      void forceCancelTasks​(java.util.List<java.lang.String> taskIds)
      Force-cancels stopped tasks - do a best-effort cleanup, continuing on when steps of an always-run phase fail
      java.util.List<TaskWithBlock> getAllCurrentTasks​(FetchMode fetchMode)
      Returns all active tasks for all users.
      BlockState getBlock​(java.lang.String taskId, java.lang.String blockPath)
      Returns a block by ID.
      java.util.List<TaskWithBlock> getCurrentSatelliteTasks​(java.lang.String satelliteId, FetchMode fetchMode)
      Returns all active satellite tasks for all users.
      java.util.List<TaskWithBlock> getMyCurrentTasks​(FetchMode fetchMode)
      Returns the active tasks of the logged in user.
      java.util.List<TaskWithBlock> getMySatelliteTasks​(java.lang.String satelliteId, FetchMode fetchMode)
      Returns all active satellite tasks the logged in user.
      com.xebialabs.deployit.engine.api.dto.TaskPathStatus getStatus​(java.lang.String taskId, java.lang.String path)
      Returns task status by path.
      StepState getStep​(java.lang.String taskId, java.lang.String stepPath, org.joda.time.DateTime ifModifiedSince)
      Retrieves information about a step.
      com.xebialabs.deployit.engine.api.dto.TaskStepLog getStepLog​(java.lang.String taskId, java.lang.String stepPath)
      Returns task status by path.
      StepBlockState getSteps​(java.lang.String taskId, java.lang.String blockPath)
      Returns a block with steps by ID.
      TaskWithBlock getTask​(java.lang.String taskId)
      Returns a full task by ID.
      TaskWithBlock getTaskByFetchMode​(java.lang.String taskId, FetchMode fetchMode)
      Returns a task by ID.
      TaskWithBlock getTaskSummary​(java.lang.String taskId)
      Returns a task summary by ID.
      java.util.stream.Stream<TaskWithBlock> query​(org.joda.time.LocalDate begin, org.joda.time.LocalDate end, com.xebialabs.deployit.engine.api.dto.Paging paging)
      Searches for archived tasks without step information.
      void schedule​(java.lang.String taskId, org.joda.time.DateTime time)
      Schedules a task.
      TaskWithBlock skip​(java.lang.String taskId, java.util.List<java.lang.String> stepIds)
      Indicates that one or more steps should be skipped.
      void start​(java.lang.String taskId)
      Starts a task.
      void stop​(java.lang.String taskId)
      Gracefully stops an active task.
      TaskWithBlock takeover​(java.lang.String taskId, java.lang.String owner)
      Takeover a task from the owner.
      TaskWithBlock unskip​(java.lang.String taskId, java.util.List<java.lang.String> stepIds)
      Indicates that one or more steps should no longer be skipped, but executed.
    • Method Detail

      • getMyCurrentTasks

        @GET
        @Path("current")
        java.util.List<TaskWithBlock> getMyCurrentTasks​(@QueryParam("fetchMode")
                                                        FetchMode fetchMode)
        Returns the active tasks of the logged in user. By default returns full tasks, but summary mode should be preferred for performance.
        Parameters:
        fetchMode - whether to strip block data for tasks or to do a full fetch
        Returns:
        a list of tasks with blocks.
      • getAllCurrentTasks

        @GET
        @Path("current/all")
        java.util.List<TaskWithBlock> getAllCurrentTasks​(@QueryParam("fetchMode")
                                                         FetchMode fetchMode)
        Returns all active tasks for all users. Only allowed for admin. By default returns full tasks, but summary mode should be preferred for performance.
        Parameters:
        fetchMode - whether to strip block data for tasks or to do a full fetch
        Returns:
        a list of tasks with blocks.
      • getMySatelliteTasks

        @GET
        @Path("current/satellite")
        java.util.List<TaskWithBlock> getMySatelliteTasks​(@QueryParam("satelliteId")
                                                          java.lang.String satelliteId,
                                                          @QueryParam("fetchMode")
                                                          FetchMode fetchMode)
        Returns all active satellite tasks the logged in user. By default returns full tasks, but summary mode should be preferred for performance.
        Parameters:
        satelliteId - the ID of the satellite where task will be executed
        fetchMode - whether to strip block data for tasks or to do a full fetch
        Returns:
        a list of tasks with blocks.
      • getCurrentSatelliteTasks

        @GET
        @Path("current/all/satellite")
        java.util.List<TaskWithBlock> getCurrentSatelliteTasks​(@QueryParam("satelliteId")
                                                               java.lang.String satelliteId,
                                                               @QueryParam("fetchMode")
                                                               FetchMode fetchMode)
        Returns all active satellite tasks for all users. Only allowed for admin. By default returns full tasks, but summary mode should be preferred for performance.
        Parameters:
        satelliteId - the ID of the satellite where task will be executed
        fetchMode - whether to strip block data for tasks or to do a full fetch
        Returns:
        a list of tasks with blocks.
      • getTaskByFetchMode

        @GET
        @Path("{taskid}")
        TaskWithBlock getTaskByFetchMode​(@PathParam("taskid")
                                         java.lang.String taskId,
                                         @QueryParam("fetchMode") @DefaultValue("FULL")
                                         FetchMode fetchMode)
        Returns a task by ID.
        Parameters:
        taskId - the ID of the task
        fetchMode - whether to strip block data for tasks or to do a full fetch (default: full)
        Returns:
        the task with blocks.
        Permission:
        Available only to admin and owner of the task
      • getTask

        @GET
        @Path("{taskid}/full")
        TaskWithBlock getTask​(@PathParam("taskid")
                              java.lang.String taskId)
        Returns a full task by ID.
        Parameters:
        taskId - the ID of the task
        Returns:
        the task with blocks.
        Permission:
        Available only to admin and owner of the task
      • getTaskSummary

        @GET
        @Path("{taskid}/summary")
        TaskWithBlock getTaskSummary​(@PathParam("taskid")
                                     java.lang.String taskId)
        Returns a task summary by ID.
        Parameters:
        taskId - the ID of the task
        Returns:
        the task with blocks.
        Permission:
        Available only to admin and owner of the task
      • getBlock

        @GET
        @Path("{taskid}/block/{blockPath}")
        BlockState getBlock​(@PathParam("taskid")
                            java.lang.String taskId,
                            @PathParam("blockPath")
                            java.lang.String blockPath)
        Returns a block by ID.
        Parameters:
        taskId - the ID of the task
        blockPath - the ID of the block
        Returns:
        the block.
        Permission:
        Available only to admin and owner of the task
      • getSteps

        @GET
        @Path("{taskid}/block/{blockPath}/step")
        StepBlockState getSteps​(@PathParam("taskid")
                                java.lang.String taskId,
                                @PathParam("blockPath")
                                java.lang.String blockPath)
        Returns a block with steps by ID.
        Parameters:
        taskId - the ID of the task
        blockPath - the ID of the block
        Returns:
        the block with steps.
        Permission:
        Available only to admin and owner of the task
      • getStep

        @GET
        @Path("{taskid}/step/{stepPath}")
        StepState getStep​(@PathParam("taskid")
                          java.lang.String taskId,
                          @PathParam("stepPath")
                          java.lang.String stepPath,
                          @HeaderParam("If-Modified-Since")
                          org.joda.time.DateTime ifModifiedSince)
        Retrieves information about a step.
        Parameters:
        taskId - the ID of the task
        stepPath - the path of the step in the block tree.
        ifModifiedSince - the if-modified-since date in RFC 1123 (RFC 822 with 4-digit years) date format.
        Returns:
        XML containing a StepState if the step has not been modified since ifModifiedSince
        RestDetails:
        The call returns a response with status code of 304 (Not Modified) if the step has not been modified since ifModifiedSince, otherwise returns a status code of 200 (OK) and the XML containing a StepState.
        Permission:
        Available only to admin and owner of the task
        ApiDetails:
        The method throws a RuntimeException if the step has not been modified since ifModifiedSince, otherwise returns a StepState
      • start

        @POST
        @Path("{taskid}/start")
        void start​(@PathParam("taskid")
                   java.lang.String taskId)
        Starts a task.
        Parameters:
        taskId - the ID of the task
        Permission:
        Available only to admin and owner of the task
      • schedule

        @POST
        @Path("{taskid}/schedule")
        void schedule​(@PathParam("taskid")
                      java.lang.String taskId,
                      @QueryParam("time")
                      org.joda.time.DateTime time)
        Schedules a task.
        Parameters:
        taskId - the ID of the task
        time - the local time (including the local timezone) when the task should be started by the server.
        Permission:
        Available only to admin and owner of the task
      • stop

        @POST
        @Path("{taskid}/stop")
        void stop​(@PathParam("taskid")
                  java.lang.String taskId)
        Gracefully stops an active task.
        Parameters:
        taskId - the ID of the task
        Permission:
        Available only to admin and owner of the task
      • abort

        @POST
        @Path("{taskid}/abort")
        void abort​(@PathParam("taskid")
                   java.lang.String taskId)
        Aborts an active task.
        Parameters:
        taskId - the ID of the task
        Permission:
        Available only to admin and owner of the task
      • cancel

        @DELETE
        @Path("{taskid}")
        void cancel​(@PathParam("taskid")
                    java.lang.String taskId)
        Cancels a stopped task.
        Parameters:
        taskId - the ID of the task
        Permission:
        Available only to admin and owner of the task
      • forceCancel

        @DELETE
        @Path("{taskid}/force")
        void forceCancel​(@PathParam("taskid")
                         java.lang.String taskId)
        Force-cancels a stopped task - do a best-effort cleanup, continuing on when steps of an always-run phase fail
        Parameters:
        taskId - the ID of the task
        Permission:
        Available only to admin
      • forceCancelTasks

        @POST
        @Path("/force-cancel")
        void forceCancelTasks​(java.util.List<java.lang.String> taskIds)
        Force-cancels stopped tasks - do a best-effort cleanup, continuing on when steps of an always-run phase fail
        Parameters:
        taskIds - the IDs of the tasks
        Permission:
        Available only to admin
      • archive

        @POST
        @Path("{taskid}/archive")
        void archive​(@PathParam("taskid")
                     java.lang.String taskId)
        Archive an executed task.
        Parameters:
        taskId - the ID of the task
        Permission:
        Available only to admin and owner of the task
      • skip

        @POST
        @Path("{taskid}/skip")
        TaskWithBlock skip​(@PathParam("taskid")
                           java.lang.String taskId,
                           java.util.List<java.lang.String> stepIds)
        Indicates that one or more steps should be skipped.
        Parameters:
        taskId - the ID of the task
        stepIds - the paths of the steps to skip
        Returns:
        a task
        Permission:
        task#skip_step
      • unskip

        @POST
        @Path("{taskid}/unskip")
        TaskWithBlock unskip​(@PathParam("taskid")
                             java.lang.String taskId,
                             java.util.List<java.lang.String> stepIds)
        Indicates that one or more steps should no longer be skipped, but executed.
        Parameters:
        taskId - the ID of the task
        stepIds - the paths of the steps to unskip
        Returns:
        a task
        Permission:
        task#skip_step
      • addPause

        @POST
        @Path("{taskid}/add-pause/{stepPath}")
        StepBlockState addPause​(@PathParam("taskid")
                                java.lang.String taskId,
                                @PathParam("stepPath")
                                java.lang.String stepPath)
        Add a pause step at the specified position.
        Parameters:
        taskId - the ID of the task
        stepPath - the path of the step
        Returns:
        a task with full step information.
        Permission:
        Available only to admin and owner of the task
      • assign

        @POST
        @Path("{taskid}/assign/{owner}")
        TaskWithBlock assign​(@PathParam("taskid")
                             java.lang.String taskId,
                             @PathParam("owner")
                             java.lang.String owner)
        Assigns a task to a different user.
        Parameters:
        taskId - the ID of the task
        owner - the name of the user that will be the new owner of the task.
        Returns:
        the task.
        Permission:
        task#assign
      • takeover

        @POST
        @Path("{taskid}/takeover/{owner}")
        TaskWithBlock takeover​(@PathParam("taskid")
                               java.lang.String taskId,
                               @PathParam("owner")
                               java.lang.String owner)
        Takeover a task from the owner. This will re-assign the task to your logged in user. This is the reverse of the assign(String, String) method, which allows you to re-assign a task.
        Parameters:
        taskId - the ID of the task to take over
        owner - the current owner of the task
        Returns:
        the task you took over.
        Permission:
        task#takeover
      • query

        @GET
        @Path("query")
        java.util.stream.Stream<TaskWithBlock> query​(@QueryParam("begindate")
                                                     org.joda.time.LocalDate begin,
                                                     @QueryParam("enddate")
                                                     org.joda.time.LocalDate end,
                                                     @BeanParam
                                                     com.xebialabs.deployit.engine.api.dto.Paging paging)
        Searches for archived tasks without step information.
        Parameters:
        begin - The first day we want to see tasks from, or null for no such limit.
        end - The last day we want to see tasks from, or null for no such limit.
        paging - Paging paging parameters to fetch tasks page by page.
        Returns:
        a list of tasks limited to maximum of value of deploy.server.rest.api.maxPageSize per page. response header X-Total-Count determines the total number of tasks.
        Permission:
        report#view
      • export

        @GET
        @Path("export")
        java.util.stream.Stream<TaskWithBlock> export​(@QueryParam("begindate")
                                                      org.joda.time.LocalDate begin,
                                                      @QueryParam("enddate")
                                                      org.joda.time.LocalDate end,
                                                      @BeanParam
                                                      com.xebialabs.deployit.engine.api.dto.Paging paging)
        Searches for tasks with detailed step information.
        Parameters:
        begin - The first day we want to see tasks from, or null for no such limit.
        end - The last day we want to see tasks from, or null for no such limit.
        paging - Paging paging parameters to fetch tasks page by page.
        Returns:
        a list of tasks limited to maximum of value of deploy.server.rest.api.maxPageSize per page. response header X-Total-Count determines the total number of tasks.
        Permission:
        report#view
      • getStatus

        @GET
        @Path("{taskid}/status/{path}")
        com.xebialabs.deployit.engine.api.dto.TaskPathStatus getStatus​(@PathParam("taskid")
                                                                       java.lang.String taskId,
                                                                       @PathParam("path")
                                                                       java.lang.String path)
        Returns task status by path.
        Parameters:
        taskId - the ID of the task
        path - path
        Returns:
        the block.
      • getStepLog

        @GET
        @Path("{taskId}/step-log/{stepPath}")
        com.xebialabs.deployit.engine.api.dto.TaskStepLog getStepLog​(@PathParam("taskId")
                                                                     java.lang.String taskId,
                                                                     @PathParam("stepPath")
                                                                     java.lang.String stepPath)
        Returns task status by path.
        Parameters:
        taskId - the ID of the task
        stepPath - the path of the step
        Returns:
        the block.