@Singleton @Component public class PlanResource extends Object
Constructor and Description |
---|
PlanResource(BambooPermissionManager bambooPermissionManager,
BambooUserManager bambooUserManager,
BranchCreationFacade branchCreationFacade,
CachedPlanManager cachedPlanManager,
PlanManager planManager,
LabelManager labelManager,
PlanRestService planRestService,
VariableDefinitionManager variableDefinitionManager,
JiraIssueManager jiraIssueManager,
JiraApplinksService jiraApplinksService,
com.atlassian.event.api.EventPublisher eventPublisher,
ArtifactDefinitionManager artifactDefinitionManager,
com.atlassian.sal.api.message.I18nResolver i18nResolver,
TestsManager testsManager,
AdministrationConfigurationAccessor administrationConfigurationAccessor,
TestQuarantineManager testQuarantineManager,
FeatureManager featureManager,
VcsRepositoryManager vcsRepositoryManager,
DeletionService deletionService,
RssDetectionService rssDetectionService,
ChainBranchManager chainBranchManager,
BuildDefinitionManager buildDefinitionManager,
SpecsConsumerFactory specsConsumerFactory,
SpecsExporter specsExporter) |
Modifier and Type | Method and Description |
---|---|
void |
addPlanLabel(String projectKey,
String buildKey,
RestPlanLabel label,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Adds new label to plan specified by projectKey-buildKey.
|
RestPlanBranch |
createNewBranch(String projectKey,
String buildKey,
String branchName,
String vcsBranchName,
Boolean enabled,
Boolean cleanupEnabled,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Method for creating branch for a specified plan.
|
javax.ws.rs.core.Response |
deletePlan(String projectKey,
String buildKey)
Marks plan for deletion.
|
javax.ws.rs.core.Response |
disablePlan(String projectKey,
String buildKey)
Disable plan.
|
javax.ws.rs.core.Response |
enablePlan(String projectKey,
String buildKey)
Enable plan.
|
javax.ws.rs.core.Response |
enableSpecsForBranches(String projectKey,
String buildKey)
Enable specs scanning for all branches.
|
javax.ws.rs.core.Response |
exportPlanSpec(String projectKey,
String buildKey,
String packageNameOpt,
String formatParam)
Export plan as Bamboo Specs code.
|
RestPlans |
getAllPlanList(javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Method used to list all plans on Bamboo service that user is allowed to see (READ permission).
|
RestJiraIssue |
getIssueDetails(String projectKey,
String buildKey,
String issueKey,
javax.ws.rs.core.UriInfo uriInfo) |
RestPlan |
getPlan(String projectKey,
String buildKey,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Possible expand parameters: actions, stages, branches, variableContext.
|
RestPlan |
getPlanAlias(String projectKey,
String buildKey,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Possible expand parameters: actions, stages, branches, variableContext.
|
RestArtifactDefinitions |
getPlanArtifactDefinition(String projectKey,
String buildKey,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext) |
javax.ws.rs.core.Response |
getPlanBranch(String projectKey,
String buildKey,
String branchName,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide details for specified Branch of a specified Plan.
|
RestBranches |
getPlanBranches(String projectKey,
String buildKey,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Provide list of branches for specified plan.
|
RestPlanLabels |
getPlanLabels(String projectKey,
String buildKey,
javax.ws.rs.core.UriInfo uriInfo)
Provide list of labels for plan specified by projectKey-buildKey.
|
RestVcsBranches |
getVcsBranches(String projectKey,
String buildKey,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.HttpHeaders hh)
Provide list of vcs branch names for branches that exist on the default repository of this plan
|
javax.ws.rs.core.Response |
markPlanFavourite(String projectKey,
String buildKey,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext) |
javax.ws.rs.core.Response |
quarantineTest(String projectKey,
String buildKey,
long testId,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext,
RestQuarantineExpiry restQuarantineExpiry) |
javax.ws.rs.core.Response |
removePlanLabel(String projectKey,
String buildKey,
String labelName,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Removes label from plan specified by projectKey-buildKey-buildNumber.
|
javax.ws.rs.core.Response |
unleashTest(String projectKey,
String buildKey,
long testId,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext) |
javax.ws.rs.core.Response |
unmarkPlanFavourite(String projectKey,
String buildKey,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Remove plan from favorites.
|
@Autowired public PlanResource(BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager, BranchCreationFacade branchCreationFacade, CachedPlanManager cachedPlanManager, PlanManager planManager, LabelManager labelManager, PlanRestService planRestService, VariableDefinitionManager variableDefinitionManager, JiraIssueManager jiraIssueManager, JiraApplinksService jiraApplinksService, com.atlassian.event.api.EventPublisher eventPublisher, ArtifactDefinitionManager artifactDefinitionManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TestsManager testsManager, AdministrationConfigurationAccessor administrationConfigurationAccessor, TestQuarantineManager testQuarantineManager, FeatureManager featureManager, VcsRepositoryManager vcsRepositoryManager, DeletionService deletionService, RssDetectionService rssDetectionService, ChainBranchManager chainBranchManager, BuildDefinitionManager buildDefinitionManager, SpecsConsumerFactory specsConsumerFactory, SpecsExporter specsExporter)
public RestPlans getAllPlanList(@Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Possible expand parameters: * plans - list of plans
* plans.plan - list of plans with plan details
* plans.plan.actions
public RestPlan getPlan(String projectKey, String buildKey, @Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
projectKey
- buildKey
- public RestPlan getPlanAlias(String projectKey, String buildKey, @Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
projectKey
- buildKey
- public RestBranches getPlanBranches(String projectKey, String buildKey, @Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
projectKey
- project keybuildKey
- plan key (might be simply planKey or composite planKey-jobKey)RestBranches
public RestPlanBranch createNewBranch(String projectKey, String buildKey, String branchName, String vcsBranchName, Boolean enabled, Boolean cleanupEnabled, @Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext) throws WebValidationException
Example usage: curl -X PUT --user admin:admin http://localhost:8085/rest/api/latest/plan/PROJ-PLAN/branch/BranchName?vcsBranch="/refs/heads/myBranch"
projectKey
- project keybuildKey
- plan keybranchName
- new branch namevcsBranchName
- name of the VCS branchenabled
- cleanupEnabled
- enable branch expiryRestPlanBranch
the newly created branchWebValidationException
- if there's validation errors, which maps into a 400 Bad Requestpublic javax.ws.rs.core.Response getPlanBranch(String projectKey, String buildKey, String branchName, @Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
projectKey
- project keybuildKey
- plan key (might be simply planKey or composite planKey-jobKey)branchName
- branch display nameRestBranches
public RestPlanLabels getPlanLabels(String projectKey, String buildKey, @Context javax.ws.rs.core.UriInfo uriInfo)
projectKey
- project keybuildKey
- plan key (might be simply planKey or composite planKey-jobKey)RestPlanLabels
public void addPlanLabel(String projectKey, String buildKey, RestPlanLabel label, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
projectKey
- project keybuildKey
- plan key (might be simply planKey or composite planKey-jobKey)label
- label content to add to build resultpublic javax.ws.rs.core.Response removePlanLabel(String projectKey, String buildKey, String labelName, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext) throws Exception
projectKey
- project keybuildKey
- plan key (might be simply planKey or composite planKey-jobKey)labelName
- label name to remove from planException
public RestVcsBranches getVcsBranches(String projectKey, String buildKey, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.HttpHeaders hh)
projectKey
- project keybuildKey
- plan key - only top level plans are supportedRestVcsBranchList
public RestJiraIssue getIssueDetails(String projectKey, String buildKey, String issueKey, @Context javax.ws.rs.core.UriInfo uriInfo)
public javax.ws.rs.core.Response markPlanFavourite(String projectKey, String buildKey, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
public javax.ws.rs.core.Response unmarkPlanFavourite(String projectKey, String buildKey, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
projectKey
- buildKey
- public javax.ws.rs.core.Response enablePlan(String projectKey, String buildKey)
projectKey
- buildKey
- public javax.ws.rs.core.Response disablePlan(String projectKey, String buildKey)
projectKey
- buildKey
- public javax.ws.rs.core.Response deletePlan(String projectKey, String buildKey)
projectKey
- buildKey
- public RestArtifactDefinitions getPlanArtifactDefinition(String projectKey, String buildKey, @Context javax.ws.rs.core.UriInfo uriInfo, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
public javax.ws.rs.core.Response quarantineTest(String projectKey, String buildKey, long testId, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, @NotNull RestQuarantineExpiry restQuarantineExpiry) throws WebValidationException
WebValidationException
public javax.ws.rs.core.Response unleashTest(String projectKey, String buildKey, long testId, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext) throws WebValidationException
WebValidationException
public javax.ws.rs.core.Response enableSpecsForBranches(String projectKey, String buildKey)
public javax.ws.rs.core.Response exportPlanSpec(String projectKey, String buildKey, String packageNameOpt, @Nullable String formatParam) throws WebValidationException
projectKey
- The project to export frombuildKey
- The specific build to exportpackageNameOpt
- Optionally, a package name for the exported specformatParam
- Optionally, a format of code. It's SpecsExporter.ExportFormat#JAVA
by default. Other option is SpecsExporter.ExportFormat#YAML
.WebValidationException
- If generating the spec fails.Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.