public class RepositoryControl extends BackdoorControl<RepositoryControl>
BackdoorControl.AddXsrfNoCheckTokenFilter, BackdoorControl.JsonMediaTypeFilter
ADMIN_REST_PATH, API_REST_PATH, DEFAULT_REST_PATH, rootPath
Constructor and Description |
---|
RepositoryControl(@NotNull 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.
|
void |
changeRSSAccessToAllRepositories(String repositoryId,
boolean canAccessAllRepositories)
Changes repository 'all repositories access' rss permission.
|
void |
changeRSSPermissionToCreateProjects(String repositoryId,
boolean canCreateProjects)
Changes repository 'project creation allowed' rss permission.
|
long |
clearSpecsStates()
Remove orphaned Spec states
|
@NotNull RestRepositoryDefinition |
createLinkedRepository(@NotNull Repository repository,
@NotNull String displayName)
Deprecated.
Prefer using
createRepository(VcsRepository) |
@NotNull RestRepositoryDefinition |
createLinkedRepository(@NotNull RestRepositoryConfig restRepositoryConfig)
Deprecated.
Prefer using
createRepository(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)
Deprecated.
Prefer ussing
createRepository(VcsRepository) |
<T extends com.atlassian.bamboo.specs.api.builders.repository.VcsRepository<T,E>,E extends com.atlassian.bamboo.specs.api.model.repository.VcsRepositoryProperties> |
createRepository(T vcsRepository)
Creates a linked/project repository as the default auth user.
|
void |
deleteAllLinkedRepositories()
Deletes all linked repositories.
|
void |
deleteBuildWarnings(@NotNull 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.
|
void |
enableRss(String repositoryName,
String projectKey)
Enables RSS for given project repository
|
List<RestRepository> |
getLinkedRepositories() |
List<RestRepository> |
getProjectRepositories(String projectKey) |
List<Long> |
getRssRepositoriesAllowedToAccessRepository(String targetRepositoryId) |
RestVcsLocationSpecsStatus |
getSpecsDetectionStatus(long repositoryId,
@NotNull String branch)
Get specs status for repository and branch
|
boolean |
isPullRequestClosed(String repositoryName,
String pullRequestKey)
Check if pull request is marked as closed in Bamboo DB
|
boolean |
isRssEnabled(String sharedRepositoryName) |
boolean |
sendBuildWarnings(@NotNull PlanResultKey resultKey,
long repositoryId,
@NotNull RestBuildWarnings warnings)
Manually send build warnings to a repository for a build result.
|
void |
tearDown()
Cleanup resources
|
void |
triggerBranchDetection(long repositoryId)
Triggers (polling) branch detection for given repository.
|
void |
triggerRssDetection(long repositoryId,
@NotNull String branch)
Trigger RSS detection for repository and branch
|
void |
triggerRssDetection(@NotNull String repositoryName)
Trigger RSS detection
|
client, createResource, createResourceForPath, get, getEnvironmentData, getRestModulePath, percentEncode, ping, post, resourceRoot
public RepositoryControl(@NotNull @NotNull BambooEnvironmentData environmentData)
public void tearDown()
BackdoorControl
tearDown
in class BackdoorControl<RepositoryControl>
@NotNull @Deprecated public @NotNull RestRepositoryDefinition createLinkedRepository(@NotNull @NotNull RestRepositoryConfig restRepositoryConfig)
createRepository(VcsRepository)
tearDown()
.
This method has a lot of limitations - see the relevant backdoor resource for more details.
restRepositoryConfig
- repository configuration@Deprecated public <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)
createRepository(VcsRepository)
vcsRepository
- 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> createRepository(T vcsRepository)
tearDown()
.vcsRepository
- repository configuration@NotNull @Deprecated public @NotNull RestRepositoryDefinition createLinkedRepository(@NotNull @NotNull Repository repository, @NotNull @NotNull String displayName)
createRepository(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 void enableRss(String repositoryName, String projectKey)
repositoryName
- nameprojectKey
- public 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 void changeRSSAccessToAllRepositories(String repositoryId, boolean canAccessAllRepositories) throws com.opensymphony.webwork.dispatcher.json.JSONException
repositoryId
- linked repository idcanAccessAllRepositories
- true if repository should have all repositories access, false otherwisecom.opensymphony.webwork.dispatcher.json.JSONException
public void changeRSSPermissionToCreateProjects(String repositoryId, boolean canCreateProjects) throws com.opensymphony.webwork.dispatcher.json.JSONException
repositoryId
- linked repository idcanCreateProjects
- true if repository should be allowed to create new projects, 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 @NotNull String repositoryName)
repositoryName
- namepublic void triggerRssDetection(long repositoryId, @NotNull @NotNull String branch)
public RestVcsLocationSpecsStatus getSpecsDetectionStatus(long repositoryId, @NotNull @NotNull String branch)
public long clearSpecsStates()
public boolean sendBuildWarnings(@NotNull @NotNull PlanResultKey resultKey, long repositoryId, @NotNull @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 @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 buildpublic void triggerBranchDetection(long repositoryId)
public List<RestRepository> getProjectRepositories(String projectKey)
public List<RestRepository> getLinkedRepositories()
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.