Class StashResource
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 Summary
ConstructorDescriptionStashResource
(com.atlassian.stash.rest.client.applinks.ApplinkStashClientFactory stashClientFactory, com.atlassian.sal.api.message.I18nResolver i18nResolver, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, BitbucketSeverMirrorHelper bitbucketSeverMirrorHelper, StashClientProvider stashClientProvider) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
canMerge
(long repositoryId, long pullRequestId) javax.ws.rs.core.Response
getAvailableProjects
(String serverKey, long start, long limit) Returns list of available Bitbucket Server projects.javax.ws.rs.core.Response
javax.ws.rs.core.Response
javax.ws.rs.core.Response
getBranches
(String serverKey, String projectKey, String repositorySlug, String query, long start, long limit) javax.ws.rs.core.Response
getDefaultBranch
(String serverKey, String projectKey, String repositorySlug) javax.ws.rs.core.Response
getPullRequests
(long repositoryId, String branchName, long start, long limit, long avatarSize) Returns list of pull requests for given repository and optionally branch.javax.ws.rs.core.Response
getRepositories
(String serverKey, String projectName, String query, long start, long limit) javax.ws.rs.core.Response
getRepository
(String serverKey, String projectKey, String repositorySlug) javax.ws.rs.core.Response
getRepositoryMirrors
(String serverKey, String projectKey, String repositorySlug) javax.ws.rs.core.Response
getRepositoryPermission
(String serverKey, String projectKey, String repositorySlug) javax.ws.rs.core.Response
getRepositorySSHKeys
(String serverKey, String projectKey, String repositorySlug, long start, long limit) javax.ws.rs.core.Response
merge
(long repositoryId, long pullRequestId, long version)
-
Constructor Details
-
StashResource
@Inject public StashResource(com.atlassian.stash.rest.client.applinks.ApplinkStashClientFactory stashClientFactory, com.atlassian.sal.api.message.I18nResolver i18nResolver, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, BitbucketSeverMirrorHelper bitbucketSeverMirrorHelper, StashClientProvider stashClientProvider)
-
-
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 Serverstart
- 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
-
getRepository
-
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
-
getBranch
-
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 idbranchName
- branch namestart
- 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)
-