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

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

@Singleton
public class ResultResource
extends java.lang.Object

Provide build results information. Available for anonymous and authenticated users, however proper permissions are enforced


Constructor Summary
ResultResource(ResultService resultService)
           
 
Method Summary
 void addBuildComment(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, RestComment comment, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, javax.ws.rs.core.UriInfo uriInfo)
          Adds new comment to build result specified by projectKey-buildKey-buildNumber.
 void addBuildLabel(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, RestBuildLabel label, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, javax.ws.rs.core.UriInfo uriInfo)
          Adds new label to build result specified by projectKey-buildKey-buildNumber.
 RestResults getBranchHistory(java.lang.String projectKey, java.lang.String buildKey, java.lang.String branchName, java.lang.String expandParam, boolean favouriteParam, java.lang.String labelParam, java.lang.String issueKeyParam, boolean allStatesParam, boolean continuableParam, boolean buildStateParam, int startIndexParam, int maxResultsParam, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide list of build results for specified plan.
 Result getBuild(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, java.lang.String expandParam, boolean favouriteParam, int startIndexParam, int maxResultsParam, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide build result specified by projectKey-buildKey-buildNumber.
 Result getBuildAlias(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, java.lang.String expandParam, boolean favouriteParam, int startIndexParam, int maxResultsParam, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide build result specified by projectKey-buildKey-buildNumber.
 RestComments getBuildComments(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, javax.ws.rs.core.UriInfo uriInfo)
          Provide list of comments for build result specified by projectKey-buildKey-buildNumber.
 RestResults getBuildHistory(java.lang.String projectKey, java.lang.String buildKey, java.lang.String expandParam, boolean favouriteParam, java.lang.String labelParam, java.lang.String issueKeyParam, boolean allStatesParam, boolean continuableParam, boolean buildStateParam, int startIndexParam, int maxResultsParam, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide list of build results for specified plan.
 RestBuildLabels getBuildLabels(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, javax.ws.rs.core.UriInfo uriInfo)
          Provide list of labels for build result specified by projectKey-buildKey-buildNumber.
 RestResults getBuildResultsForChangeset(java.lang.String changesetId, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide list of build results related to changeset id passed as parameter.
 RestResults getLatestBuildResults(java.lang.String expandParam, boolean favouriteParam, java.lang.String labelParam, java.lang.String issueKeyParam, boolean allStatesParam, boolean continuableParam, boolean buildStateParam, int startIndexParam, int maxResultsParam, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide list of latest build results for top level plans visible for users.
 RestResults getLatestBuildResultsForProject(java.lang.String projectKey, java.lang.String expandParam, boolean favouriteParam, java.lang.String labelParam, java.lang.String issueKeyParam, boolean allStatesParam, boolean continuableParam, boolean buildStateParam, int startIndexParam, int maxResultsParam, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide list of latest build results for top level plans for specified project.
 RestResultStatus getResultStatus(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Provide runtime information for currently executing build result.
 void removeBuildLabel(java.lang.String projectKey, java.lang.String buildKey, java.lang.String buildNumber, java.lang.String labelName, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, javax.ws.rs.core.UriInfo uriInfo)
          Removes label from build result specified by projectKey-buildKey-buildNumber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultResource

public ResultResource(ResultService resultService)
Method Detail

getLatestBuildResults

public RestResults getLatestBuildResults(java.lang.String expandParam,
                                         boolean favouriteParam,
                                         java.lang.String labelParam,
                                         java.lang.String issueKeyParam,
                                         boolean allStatesParam,
                                         boolean continuableParam,
                                         boolean buildStateParam,
                                         int startIndexParam,
                                         int maxResultsParam,
                                         @Context
                                         javax.ws.rs.core.UriInfo uriInfo,
                                         @Context
                                         com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide list of latest build results for top level plans visible for users.

Parameters:
expandParam - expands build result details on request. Possible values are: artifacts, comments, labels, jiraIssues, stages. stages expand is available only for top level plans. It allows to drill down to job results using stages.stage.results.result. All expand parameters should contain results.result prefix.
favouriteParam - filters build results list to show only results for favourite plans. Works only for authenticated user
labelParam - filter by comma separated list of labels
issueKeyParam - filter by comma separated list of Jira issue key related to result
allStatesParam - return all build results including Unknown states
continuableParam - filter only results that may be continued (stopped on Manual Stage)
buildStateParam - filter results by state, valid values are Unknown, Successful, Failed
startIndexParam - start index for results list (zero based)
maxResultsParam - maximum size for returned list
uriInfo -
authenticationContext -
Returns:
RestResults

getLatestBuildResultsForProject

public RestResults getLatestBuildResultsForProject(java.lang.String projectKey,
                                                   java.lang.String expandParam,
                                                   boolean favouriteParam,
                                                   java.lang.String labelParam,
                                                   java.lang.String issueKeyParam,
                                                   boolean allStatesParam,
                                                   boolean continuableParam,
                                                   boolean buildStateParam,
                                                   int startIndexParam,
                                                   int maxResultsParam,
                                                   @Context
                                                   javax.ws.rs.core.UriInfo uriInfo,
                                                   @Context
                                                   com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide list of latest build results for top level plans for specified project. List of results is limited to plans visible for user.

Parameters:
projectKey - project key to filter plan result list
expandParam - expands build result details on request. Possible values are: artifacts, comments, labels, jiraIssues, stages. stages expand is available only for top level plans. It allows to drill down to job results using stages.stage.results.result. All expand parameters should contain results.result prefix.
favouriteParam - filters build results list to show only results for favourite plans. Works only for authenticated user
labelParam - filter by comma separated list of labels
issueKeyParam - filter by comma separated list of Jira issue key related to result
allStatesParam - return all build results including Unknown states
continuableParam - filter only results that may be continued (stopped on Manual Stage)
buildStateParam - filter results by state, valid values are Unknown, Successful, Failed
startIndexParam - start index for results list (zero based)
maxResultsParam - maximum size for returned list
uriInfo -
authenticationContext -
Returns:
RestResults

getBuildResultsForChangeset

public RestResults getBuildResultsForChangeset(java.lang.String changesetId,
                                               @Context
                                               javax.ws.rs.core.UriInfo uriInfo,
                                               @Context
                                               com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide list of build results related to changeset id passed as parameter. List of results contains results from all plans related to this changeset.

Parameters:
changesetId - changeset id related to build result
uriInfo -
authenticationContext -
Returns:
List of RestResults related to specified changeset id

getBuildHistory

public RestResults getBuildHistory(java.lang.String projectKey,
                                   java.lang.String buildKey,
                                   java.lang.String expandParam,
                                   boolean favouriteParam,
                                   java.lang.String labelParam,
                                   java.lang.String issueKeyParam,
                                   boolean allStatesParam,
                                   boolean continuableParam,
                                   boolean buildStateParam,
                                   int startIndexParam,
                                   int maxResultsParam,
                                   @Context
                                   javax.ws.rs.core.UriInfo uriInfo,
                                   @Context
                                   com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide list of build results for specified plan. Plan might be top level plan (projectKey-planKey) or job plan (projectKey-planKey-jobKey).

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
expandParam - expands build result details on request. Possible values are: artifacts, comments, labels, jiraIssues, stages. stages expand is available only for top level plans. It allows to drill down to job results using stages.stage.results.result. All expand parameters should contain results.result prefix.
favouriteParam - filters build results list to show only results for favourite plans. Works only for authenticated user
labelParam - filter by comma separated list of labels
issueKeyParam - filter by comma separated list of Jira issue key related to result
allStatesParam - return all build results including Unknown states
continuableParam - filter only results that may be continued (stopped on Manual Stage)
buildStateParam - filter results by state, valid values are Unknown, Successful, Failed
startIndexParam - start index for results list (zero based)
maxResultsParam - maximum size for returned list
uriInfo -
authenticationContext -
Returns:
RestResults

getBranchHistory

public RestResults getBranchHistory(java.lang.String projectKey,
                                    java.lang.String buildKey,
                                    java.lang.String branchName,
                                    java.lang.String expandParam,
                                    boolean favouriteParam,
                                    java.lang.String labelParam,
                                    java.lang.String issueKeyParam,
                                    boolean allStatesParam,
                                    boolean continuableParam,
                                    boolean buildStateParam,
                                    int startIndexParam,
                                    int maxResultsParam,
                                    @Context
                                    javax.ws.rs.core.UriInfo uriInfo,
                                    @Context
                                    com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide list of build results for specified plan. Plan might be top level plan (projectKey-planKey) or job plan (projectKey-planKey-jobKey).

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
expandParam - expands build result details on request. Possible values are: artifacts, comments, labels, jiraIssues, stages. stages expand is available only for top level plans. It allows to drill down to job results using stages.stage.results.result. All expand parameters should contain results.result prefix.
favouriteParam - filters build results list to show only results for favourite plans. Works only for authenticated user
labelParam - filter by comma separated list of labels
issueKeyParam - filter by comma separated list of Jira issue key related to result
allStatesParam - return all build results including Unknown states
continuableParam - filter only results that may be continued (stopped on Manual Stage)
buildStateParam - filter results by state, valid values are Unknown, Successful, Failed
startIndexParam - start index for results list (zero based)
maxResultsParam - maximum size for returned list
uriInfo -
authenticationContext -
Returns:
RestResults

getBuild

public Result getBuild(java.lang.String projectKey,
                       java.lang.String buildKey,
                       java.lang.String buildNumber,
                       java.lang.String expandParam,
                       boolean favouriteParam,
                       int startIndexParam,
                       int maxResultsParam,
                       @Context
                       javax.ws.rs.core.UriInfo uriInfo,
                       @Context
                       com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide build result specified by projectKey-buildKey-buildNumber. Build number may be specified also as "latest" for latest result.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value or 'latest')
expandParam - expands build result details on request. Possible values are: changes, metadata, artifacts, comments, labels, jiraIssues, stages, logEntries. stages expand is available only for top level plans. It allows to drill down to job results using stages.stage.results.result. logEntries and testResults are available only for job results
favouriteParam - filters build results list to show only results for favourite plans. Works only for authenticated user
startIndexParam - start index for results list (zero based)
maxResultsParam - maximum size for returned list
uriInfo - uriInfo
authenticationContext - authenticationContext
Returns:
Result ResultDetails

getBuildAlias

public Result getBuildAlias(java.lang.String projectKey,
                            java.lang.String buildKey,
                            java.lang.String buildNumber,
                            java.lang.String expandParam,
                            boolean favouriteParam,
                            int startIndexParam,
                            int maxResultsParam,
                            @Context
                            javax.ws.rs.core.UriInfo uriInfo,
                            @Context
                            com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide build result specified by projectKey-buildKey-buildNumber. Build number may be specified also as "latest" for latest result.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value or 'latest')
expandParam - expands build result details on request. Possible values are: changes, metadata, artifacts, comments, labels, jiraIssues, stages, logEntries. stages expand is available only for top level plans. It allows to drill down to job results using stages.stage.results.result. logEntries and testResults are available only for job results
favouriteParam - filters build results list to show only results for favourite plans. Works only for authenticated user
startIndexParam - start index for results list (zero based)
maxResultsParam - maximum size for returned list
uriInfo - uriInfo
authenticationContext - authenticationContext
Returns:
Result ResultDetails

getBuildComments

public RestComments getBuildComments(java.lang.String projectKey,
                                     java.lang.String buildKey,
                                     java.lang.String buildNumber,
                                     @Context
                                     javax.ws.rs.core.UriInfo uriInfo)
Provide list of comments for build result specified by projectKey-buildKey-buildNumber. Build number may be specified also as "latest" for latest result.

Parameters:
projectKey - projectKey
buildKey - planKey (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value or 'latest')
uriInfo -
Returns:
RestComments

addBuildComment

public void addBuildComment(java.lang.String projectKey,
                            java.lang.String buildKey,
                            java.lang.String buildNumber,
                            RestComment comment,
                            @Context
                            com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext,
                            @Context
                            javax.ws.rs.core.UriInfo uriInfo)
Adds new comment to build result specified by projectKey-buildKey-buildNumber.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - build number
comment - new comment content
authenticationContext -
uriInfo -

getBuildLabels

public RestBuildLabels getBuildLabels(java.lang.String projectKey,
                                      java.lang.String buildKey,
                                      java.lang.String buildNumber,
                                      @Context
                                      javax.ws.rs.core.UriInfo uriInfo)
Provide list of labels for build result specified by projectKey-buildKey-buildNumber. Build number may be specified also as "latest" for latest result.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value or 'latest')
uriInfo -
Returns:
RestBuildLabels

addBuildLabel

public void addBuildLabel(java.lang.String projectKey,
                          java.lang.String buildKey,
                          java.lang.String buildNumber,
                          RestBuildLabel label,
                          @Context
                          com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext,
                          @Context
                          javax.ws.rs.core.UriInfo uriInfo)
Adds new label to build result specified by projectKey-buildKey-buildNumber.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value or 'latest')
label - label content to add to build result
authenticationContext -
uriInfo -

removeBuildLabel

public void removeBuildLabel(java.lang.String projectKey,
                             java.lang.String buildKey,
                             java.lang.String buildNumber,
                             java.lang.String labelName,
                             @Context
                             com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext,
                             @Context
                             javax.ws.rs.core.UriInfo uriInfo)
                      throws java.lang.Exception
Removes label from build result specified by projectKey-buildKey-buildNumber.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value or 'latest')
labelName - label name to remove from build result
authenticationContext -
uriInfo -
Throws:
java.lang.Exception

getResultStatus

public RestResultStatus getResultStatus(java.lang.String projectKey,
                                        java.lang.String buildKey,
                                        java.lang.String buildNumber,
                                        @Context
                                        javax.ws.rs.core.UriInfo uriInfo,
                                        @Context
                                        com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide runtime information for currently executing build result. The key difference to other methods is that method is optimized to provide information available in memory only, so no database calls are made. The information provided is not as wide as for finished results, but the call is optimized for speed.

Parameters:
projectKey - project key
buildKey - plan key (might be simply planKey or composite planKey-jobKey)
buildNumber - buildNumber (numeric value only, 'latest' keyword is not supported for this method)
uriInfo -
authenticationContext -
Returns:
RestResultStatus


Copyright © 2012 Atlassian. All Rights Reserved.