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
Modifier and TypeMethodDescriptionvoid
Aborts an active task.Add a pause step at the specified position.void
Archive an executed task.Assigns a task to a different user.void
Cancels a stopped task.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
(String taskId) Force-cancels a stopped task - do a best-effort cleanup, continuing on when steps of an always-run phase failvoid
forceCancelTasks
(List<String> taskIds) Force-cancels stopped tasks - do a best-effort cleanup, continuing on when steps of an always-run phase failgetAllCurrentTasks
(FetchMode fetchMode) Returns all active tasks for all users.Returns a block by ID.getCurrentSatelliteTasks
(String satelliteId, FetchMode fetchMode) Returns all active satellite tasks for all users.getMyCurrentTasks
(FetchMode fetchMode) Returns the active tasks of the logged in user.getMySatelliteTasks
(String satelliteId, FetchMode fetchMode) Returns all active satellite tasks the logged in user.com.xebialabs.deployit.engine.api.dto.TaskPathStatus
Returns task status by path.Retrieves information about a step.com.xebialabs.deployit.engine.api.dto.TaskStepLog
getStepLog
(String taskId, String stepPath) Returns task status by path.Returns a block with steps by ID.Returns a full task by ID.getTaskByFetchMode
(String taskId, FetchMode fetchMode) Returns a task by ID.getTaskSummary
(String taskId) Returns a task summary by ID.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
Schedules a task.Indicates that one or more steps should be skipped.void
Starts a task.void
Gracefully stops an active task.Takeover a task from the owner.Indicates that one or more steps should no longer be skipped, but executed.
-
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 executedfetchMode
- 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 executedfetchMode
- 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 taskfetchMode
- 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
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
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 taskblockPath
- 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 taskblockPath
- 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 taskstepPath
- 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 sinceifModifiedSince
, otherwise returns aStepState
-
start
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 tasktime
- 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
Gracefully stops an active task.- Parameters:
taskId
- the ID of the task- Permission:
- Available only to admin and owner of the task
-
abort
Aborts an active task.- Parameters:
taskId
- the ID of the task- Permission:
- Available only to admin and owner of the task
-
cancel
Cancels a stopped task.- Parameters:
taskId
- the ID of the task- Permission:
- Available only to admin and owner of the task
-
forceCancel
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
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
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 taskstepIds
- 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 taskstepIds
- 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 taskstepPath
- 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 taskowner
- 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 theassign(String, String)
method, which allows you to re-assign a task.- Parameters:
taskId
- the ID of the task to take overowner
- 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, ornull
for no such limit.end
- The last day we want to see tasks from, ornull
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, ornull
for no such limit.end
- The last day we want to see tasks from, ornull
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 taskpath
- 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 taskstepPath
- the path of the step- Returns:
- the block.
-