com.atlassian.bamboo.plugins.rest.resource
Class QueueResource

java.lang.Object
  extended by com.atlassian.bamboo.plugins.rest.resource.QueueResource

@Singleton
public class QueueResource
extends java.lang.Object

Lists all the builds waiting in the build queue, adds or removes a build from the build queue. May be used also to resume build on manual stage or rerun failed jobs.


Constructor Summary
QueueResource(PlanManager planManager, BambooUserManager bambooUserManager, BuildQueueManager buildQueueManager, PlanExecutionManager planExecutionManager, ResultsSummaryManager resultsSummaryManager)
           
 
Method Summary
 RestQueuedBuild continueBuild(java.lang.String projectKey, java.lang.String buildKey, java.lang.Integer buildNumber, java.lang.String stageName, boolean executeAllStages, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Continue partially done build.
 RestQueuedBuilds getBuildQueue(javax.ws.rs.core.UriInfo uriInfo)
          Provide list of build scheduled for execution and waiting in build queue.
 RestQueuedBuild startBuild(java.lang.String projectKey, java.lang.String buildKey, java.lang.String stageName, boolean executeAllStages, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, java.lang.String fakeParam, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> formParams)
          Fire build execution for specified plan.
 javax.ws.rs.core.Response stopBuild(java.lang.String projectKey, java.lang.String buildKey, int buildNumber)
          Stop build execution, however only if build has not been started yet - so if is waiting in the build queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueResource

public QueueResource(PlanManager planManager,
                     BambooUserManager bambooUserManager,
                     BuildQueueManager buildQueueManager,
                     PlanExecutionManager planExecutionManager,
                     ResultsSummaryManager resultsSummaryManager)
Method Detail

getBuildQueue

public RestQueuedBuilds getBuildQueue(@Context
                                      javax.ws.rs.core.UriInfo uriInfo)
Provide list of build scheduled for execution and waiting in build queue.

Parameters:
uriInfo -
Returns:

startBuild

public RestQueuedBuild startBuild(java.lang.String projectKey,
                                  java.lang.String buildKey,
                                  java.lang.String stageName,
                                  boolean executeAllStages,
                                  @Context
                                  javax.ws.rs.core.UriInfo uriInfo,
                                  @Context
                                  com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext,
                                  java.lang.String fakeParam,
                                  javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> formParams)
Fire build execution for specified plan. Effectively, this method adds build to the build queue, so is not guarantied that build would be executed immediately. Depending on currently executed builds and length of build queue, build may be executed when queue would be drained. Additional variables could be passed to this method either as form encoded POST payload or query parameters. PLEASE note: Query parameters are more important - override those stored in form payload. Variables defined in Bamboo as global variables or plan variables MUST be prefixed with bamboo.variable ie. bamboo.variable.myVariable=valueForMyVariable. When global or plan variables would be passed to this method, will override default values for variables.

Parameters:
projectKey - project key
buildKey - plan key (only top level plan key, can not be job key)
stageName - name of the stage that should be executed even if defined as manual stage. Execution will follow to the next manual stage after this or end of plan if no subsequent manual stage
executeAllStages - enforce executing all stages in a plan, even if defined as manual stages. Execution will follow and include latest stage, unless some stage will fail.
fakeParam - unused form parameter
uriInfo -
authenticationContext -
formParams - payload of additional variables passed to build start (application/x-www-form-urlencoded). Variables may be passed as HTTP POST form or optionally as URL query parameter=value collection. Variables defined in Bamboo as global variables or plan variables MUST be prefixed with bamboo.variable ie. bamboo.variable.myVariable=valueForMyVariable
Returns:
RestQueuedBuild

continueBuild

public RestQueuedBuild continueBuild(java.lang.String projectKey,
                                     java.lang.String buildKey,
                                     java.lang.Integer buildNumber,
                                     java.lang.String stageName,
                                     boolean executeAllStages,
                                     @Context
                                     javax.ws.rs.core.UriInfo uriInfo,
                                     @Context
                                     com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Continue partially done build. Effectively, this method adds build to the build queue, so is not guarantied that build would be executed immediately. Depending on currently executed builds and length of build queue, build may be executed when queue would be drained. Additional variables could be passed to this method only query parameters (variableName=variableValue). Variables defined in Bamboo as global variables or plan variables MUST be prefixed with bamboo.variable ie. bamboo.variable.myVariable=valueForMyVariable. When global or plan variables would be passed to this method, will override values valid for previous build execution (override).

Parameters:
projectKey - project key
buildKey - plan key (only top level plan key, can not be job key)
buildNumber - build number to resume/rerun
stageName - name of the stage that should be executed even if manual stage. Execution will follow to the next manual stage after this or end of plan if no subsequent manual stage
executeAllStages - enforce executing all stages in a plan, even if defined as manual stages. Execution will follow and include latest stage, unless some stage will fail.
uriInfo -
authenticationContext -
Returns:
RestQueuedBuild

stopBuild

public javax.ws.rs.core.Response stopBuild(java.lang.String projectKey,
                                           java.lang.String buildKey,
                                           int buildNumber)
Stop build execution, however only if build has not been started yet - so if is waiting in the build queue. If build does not exist in the queue anymore, method has no effect.

Parameters:
projectKey - project key
buildKey - plan key - IMPORTANT: as build queue contains only jobs not top level plans, plan key here MUST be a job key as opposite to other methods in this resource.
buildNumber - build number
Returns:


Copyright © 2012 Atlassian. All Rights Reserved.