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 Details

    • getMyCurrentTasks

      @GET @Path("current") 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") 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") List<TaskWithBlock> getMySatelliteTasks(@QueryParam("satelliteId") 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") List<TaskWithBlock> getCurrentSatelliteTasks(@QueryParam("satelliteId") 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") 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") 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") 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") String taskId, @PathParam("blockPath") 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") String taskId, @PathParam("blockPath") 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") String taskId, @PathParam("stepPath") 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") 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") 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") 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") 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") 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") 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(List<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") 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") String taskId, List<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") String taskId, List<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") String taskId, @PathParam("stepPath") 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") String taskId, @PathParam("owner") 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") String taskId, @PathParam("owner") 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") 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") 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") String taskId, @PathParam("path") 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") String taskId, @PathParam("stepPath") String stepPath)
      Returns task status by path.
      Parameters:
      taskId - the ID of the task
      stepPath - the path of the step
      Returns:
      the block.