java.lang.Object
com.atlassian.bamboo.plugins.stash.rest.resource.StashResource

@Path("/") @Consumes("application/json") @Produces("application/json") @Singleton public class StashResource extends Object
  • Constructor Details

  • Method Details

    • getAvailableServers

      @GET @Path("servers") public javax.ws.rs.core.Response getAvailableServers()
    • getAvailableProjects

      @GET @Path("projects") public javax.ws.rs.core.Response getAvailableProjects(@QueryParam("serverKey") String serverKey, @QueryParam("start") long start, @QueryParam("limit") long limit)
      Returns list of available Bitbucket Server projects. Project's URL is based on the 'Display URL' configured in the application link.
      Parameters:
      serverKey - name of the application link to Bitbucket Server
      start - index of the first result to retrieve (for paging)
      limit - total number of results to retrieve after start (for paging)
      Returns:
      Response - list of projects
    • getRepositories

      @GET @Path("projects/repositories") public javax.ws.rs.core.Response getRepositories(@QueryParam("serverKey") String serverKey, @QueryParam("project") String projectName, @QueryParam("query") String query, @QueryParam("start") long start, @QueryParam("limit") long limit)
    • getRepository

      @GET @Path("projects/repository") public javax.ws.rs.core.Response getRepository(@QueryParam("serverKey") String serverKey, @QueryParam("projectKey") String projectKey, @QueryParam("repositorySlug") String repositorySlug)
    • getRepositoryMirrors

      @GET @Path("projects/repository/mirrors") public javax.ws.rs.core.Response getRepositoryMirrors(@QueryParam("serverKey") String serverKey, @QueryParam("projectKey") String projectKey, @QueryParam("repositorySlug") String repositorySlug) throws WebValidationException
      Throws:
      WebValidationException
    • getBranches

      @GET @Path("projects/repositories/branches") public javax.ws.rs.core.Response getBranches(@QueryParam("serverKey") String serverKey, @QueryParam("projectKey") String projectKey, @QueryParam("repositorySlug") String repositorySlug, @QueryParam("query") String query, @QueryParam("start") long start, @QueryParam("limit") long limit)
    • getDefaultBranch

      @GET @Path("projects/repositories/branches/default") public javax.ws.rs.core.Response getDefaultBranch(@QueryParam("serverKey") String serverKey, @QueryParam("projectKey") String projectKey, @QueryParam("repositorySlug") String repositorySlug)
    • getBranch

      @GET @Path("projects/repositories/branch") public javax.ws.rs.core.Response getBranch(@QueryParam("serverKey") String serverKey, @QueryParam("projectKey") String projectKey, @QueryParam("repositorySlug") String repositorySlug, @QueryParam("branch") String branchId)
    • getRepositoryPermission

      @GET @Path("projects/repositories/permission") public javax.ws.rs.core.Response getRepositoryPermission(@QueryParam("serverKey") String serverKey, @QueryParam("projectKey") String projectKey, @QueryParam("repositorySlug") String repositorySlug) throws WebValidationException
      Throws:
      WebValidationException
    • getRepositorySSHKeys

      @GET @Path("{serverKey}/projects/{projectKey}/repositories/{repositorySlug}/ssh-keys") public javax.ws.rs.core.Response getRepositorySSHKeys(@PathParam("serverKey") String serverKey, @PathParam("projectKey") String projectKey, @PathParam("repositorySlug") String repositorySlug, @QueryParam("start") long start, @QueryParam("limit") long limit) throws CredentialsRequiredContextException, com.opensymphony.webwork.dispatcher.json.JSONException
      Throws:
      CredentialsRequiredContextException
      com.opensymphony.webwork.dispatcher.json.JSONException
    • getPullRequests

      @GET @Path("pullRequest") public javax.ws.rs.core.Response getPullRequests(@QueryParam("repositoryId") long repositoryId, @QueryParam("branch") String branchName, @QueryParam("start") long start, @QueryParam("limit") long limit, @QueryParam("avatarSize") long avatarSize)
      Returns list of pull requests for given repository and optionally branch. Pull request URL is based on application link 'Display URL'.
      Parameters:
      repositoryId - repository id
      branchName - branch name
      start - index of the first result to retrieve (for paging)
      limit - total number of results to retrieve after start (for paging)
      avatarSize - size of avatar images returned
      Returns:
      Response - list of pull requests
    • merge

      @POST @Path("pullRequest/{repositoryId}/{pullRequestId}/merge") public javax.ws.rs.core.Response merge(@PathParam("repositoryId") long repositoryId, @PathParam("pullRequestId") long pullRequestId, @QueryParam("version") long version)
    • canMerge

      @GET @Path("pullRequest/{repositoryId}/{pullRequestId}/canMerge") public javax.ws.rs.core.Response canMerge(@PathParam("repositoryId") long repositoryId, @PathParam("pullRequestId") long pullRequestId)