public class RepositoryControl extends BackdoorControl<RepositoryControl>
BackdoorControl.AddXsrfNoCheckTokenFilter, BackdoorControl.JsonMediaTypeFilter
ADMIN_REST_PATH, API_REST_PATH, DEFAULT_REST_PATH, rootPath
Constructor and Description |
---|
RepositoryControl(BambooEnvironmentData environmentData) |
Modifier and Type | Method and Description |
---|---|
void |
allowRssRepoAccess(String repositoryId,
String targetRepositoryId)
Grant permission of repository defined by repositoryId to use repository defined by
targetRepositoryId in build plans and deployments when import RSS
|
void |
changeRSSAccessToAllProjects(String repositoryId,
boolean canAccessAllProjects)
Changes repository 'all projects access' rss permission.
|
RestRepositoryDefinition |
createLinkedRepository(Repository repository,
String displayName)
Deprecated.
Prefer using
createLinkedRepository(VcsRepository) |
RestRepositoryDefinition |
createLinkedRepository(RestRepositoryConfig restRepositoryConfig)
Deprecated.
Prefer using
createLinkedRepository(VcsRepository) |
<T extends com.atlassian.bamboo.specs.api.builders.repository.VcsRepository<T,E>,E extends com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryProperties> |
createLinkedRepository(T vcsRepository)
Creates a linked repository as the default auth user.
|
void |
deleteAllLinkedRepositories()
Deletes all linked repositories.
|
void |
deleteBuildWarnings(PlanResultKey resultKey,
long repositoryId)
Delete all build warnings from a repository for a build result.
|
boolean |
deleteLinkedRepository(long repositoryId)
Deletes a linked repository as
TestUser.ADMIN . |
boolean |
deleteLinkedRepository(String repositoryName) |
void |
enableRss(String sharedRepositoryName)
Enables RSS for given repository and grants 'all projects access' permission.
|
List<Long> |
getRssRepositoriesAllowedToAccessRepository(String targetRepositoryId) |
boolean |
isPullRequestClosed(String repositoryName,
String pullRequestKey)
Check if pull request is marked as closed in Bamboo DB
|
boolean |
isRssEnabled(String sharedRepositoryName) |
boolean |
sendBuildWarnings(PlanResultKey resultKey,
long repositoryId,
RestBuildWarnings warnings)
Manually send build warnings to a repository for a build result.
|
void |
tearDown()
Cleanup resources
|
void |
triggerRssDetection(String repositoryName)
Trigger RSS detection
|
client, createResource, createResourceForPath, get, getEnvironmentData, getRestModulePath, percentEncode, ping, post, resourceRoot
public RepositoryControl(@NotNull BambooEnvironmentData environmentData)
public void tearDown()
BackdoorControl
tearDown
in class BackdoorControl<RepositoryControl>
@NotNull @Deprecated public RestRepositoryDefinition createLinkedRepository(@NotNull RestRepositoryConfig restRepositoryConfig)
createLinkedRepository(VcsRepository)
tearDown()
.
This method has a lot of limitations - see the relevant backdoor resource for more details.restRepositoryConfig
- repository configurationpublic <T extends com.atlassian.bamboo.specs.api.builders.repository.VcsRepository<T,E>,E extends com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryProperties> io.atlassian.fugue.Pair<Long,E> createLinkedRepository(T vcsRepository)
tearDown()
.vcsRepository
- repository configuration@NotNull @Deprecated public RestRepositoryDefinition createLinkedRepository(@NotNull Repository repository, @NotNull String displayName)
createLinkedRepository(VcsRepository)
tearDown()
.
This method has a lot of limitations - see the relevant backdoor resource for more details.repository
- repository configurationdisplayName
- display name of the linked repository to createpublic boolean deleteLinkedRepository(long repositoryId)
TestUser.ADMIN
. Returns true if repository with the given ID existed and
was deleted successfully, false otherwise.repositoryId
- id of the linked repositorypublic boolean deleteLinkedRepository(String repositoryName)
public void deleteAllLinkedRepositories()
public void enableRss(String sharedRepositoryName)
sharedRepositoryName
- namepublic boolean isRssEnabled(String sharedRepositoryName)
public void changeRSSAccessToAllProjects(String repositoryId, boolean canAccessAllProjects) throws com.opensymphony.webwork.dispatcher.json.JSONException
repositoryId
- linked repository idcanAccessAllProjects
- true if repository should have all projects access, false otherwisecom.opensymphony.webwork.dispatcher.json.JSONException
public boolean isPullRequestClosed(String repositoryName, String pullRequestKey)
public void allowRssRepoAccess(String repositoryId, String targetRepositoryId)
repositoryId
- which will have USE permission grantedtargetRepositoryId
- which can be used by RSS code in repositoryId repositorypublic List<Long> getRssRepositoriesAllowedToAccessRepository(String targetRepositoryId)
targetRepositoryId
- repository idpublic void triggerRssDetection(@NotNull String repositoryName)
repositoryName
- namepublic boolean sendBuildWarnings(@NotNull PlanResultKey resultKey, long repositoryId, @NotNull RestBuildWarnings warnings)
Subsequent calls for the same resultKey
and repositoryId
will append new build warnings to
the list of existing ones.
resultKey
- build result to use, it does not need to have generated any warningsrepositoryId
- repository for which to send build warnings, must have been checked out by the buildwarnings
- definition of all warnings to sendpublic void deleteBuildWarnings(@NotNull PlanResultKey resultKey, long repositoryId)
resultKey
- build result for which the warnings have been previously generatedrepositoryId
- repository from which to delete build warnings, must have been checked out by the buildCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.