Class StageConfigResource
java.lang.Object
com.atlassian.bamboo.plugins.rest.plan.stage.StageConfigResource
@Path("config/plan/{planKey}/stage")
@Consumes("application/json")
@Produces("application/json")
@Internal
public class StageConfigResource
extends Object
Provides RESTful operations on stages for the configuration of build plans.
- Since:
- 5.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RestStageUsed for REST documentation generation.static final RestPageModel<RestStage> static final RestStagestatic final RestWarningsUsed for REST documentation generation. -
Constructor Summary
ConstructorsConstructorDescriptionStageConfigResource(BambooPermissionManager bambooPermissionManager, RestStageService restStageService, StageService stageService, StageConversionFunction stageConversionFunction, InputParser inputParser, PaginationService paginationService, PlanRestService planRestService) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseaddStageToPlan(String planKeyString, jakarta.ws.rs.core.UriInfo uriInfo, RestStage restStage) Adds a stage to a build plan.getAllStagesForPlan(String planKeyString, ExpansionParam expansion, PageRequest pageRequest, jakarta.ws.rs.core.UriInfo uriInfo) Retrieves all the stages that make up a build plan.getDeletionWarnings(String planKeyString, long stageId, ExpansionParam expansion, jakarta.ws.rs.core.UriInfo uriInfo) Retrieves the warnings in relation to deleting a stage.getMoveWarnings(String planKeyString, long stageId, int index, ExpansionParam expansion, jakarta.ws.rs.core.UriInfo uriInfo) Retrieves the warnings associated to trying to move a stage.getStage(String planKeyString, long stageId, ExpansionParam expansion, jakarta.ws.rs.core.UriInfo uriInfo) Retrieves the details of a specific stage of a build plan.jakarta.ws.rs.core.ResponseremoveStage(String planKeyString, long stageId, @Nullable ConfirmationToken confirmationToken, jakarta.ws.rs.core.UriInfo uriInfo) Deletes a specific stage of a build plan.updateStage(String planKeyString, long stageId, @Nullable ConfirmationToken confirmationToken, ExpansionParam expansion, jakarta.ws.rs.core.UriInfo uriInfo, RestStage restStage) Updates a stage partially, not overriding any field that it's not specified.
-
Field Details
-
STAGE_WARNINGS
Used for REST documentation generation. -
ADD_STAGE
Used for REST documentation generation. -
STAGE
-
ALL_STAGES
-
-
Constructor Details
-
StageConfigResource
@Inject public StageConfigResource(BambooPermissionManager bambooPermissionManager, RestStageService restStageService, StageService stageService, StageConversionFunction stageConversionFunction, InputParser inputParser, PaginationService paginationService, PlanRestService planRestService)
-
-
Method Details
-
getAllStagesForPlan
@GET public RestPageModel<RestStage> getAllStagesForPlan(@PathParam("planKey") String planKeyString, @BeanParam ExpansionParam expansion, @BeanParam PageRequest pageRequest, @Context jakarta.ws.rs.core.UriInfo uriInfo) Retrieves all the stages that make up a build plan.- Parameters:
planKeyString- the key of the build planexpansion- represents an expansion tree of additional information we want to retrievepageRequest- represents the params that define which page the request is after- Returns:
RestStagea paginated representation of the stages of a build plan
-
addStageToPlan
@POST public jakarta.ws.rs.core.Response addStageToPlan(@PathParam("planKey") String planKeyString, @Context jakarta.ws.rs.core.UriInfo uriInfo, RestStage restStage) throws WebValidationException Adds a stage to a build plan.- Parameters:
planKeyString- the key of the build planuriInfo- provides access to application and request URI informationrestStage- represents the stage to add to the build plan- Returns:
Responsea response pointing to the location of the added stage- Throws:
WebValidationException- if there's validation errors, which maps into a 400 Bad Request
-
getStage
@GET @Path("{stageId}") public RestStage getStage(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @BeanParam ExpansionParam expansion, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Retrieves the details of a specific stage of a build plan.- Parameters:
planKeyString- the key of the planstageId- unique identifier of the stage which details are going to be retrievedexpansion- represents an expansion tree of additional information we want to retrieve- Returns:
RestStage- Throws:
WebValidationException
-
getMoveWarnings
@GET @Path("{stageId}/moveWarnings") public RestWarnings getMoveWarnings(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @QueryParam("newIndex") int index, @BeanParam ExpansionParam expansion, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Retrieves the warnings associated to trying to move a stage. Warnings for a stage will be generated if artifact subscriptions are broken. No warnings if the plan is running.- Parameters:
planKeyString- the key for the plan the stage belongs tostageId- the stage id of the stage to be movedexpansion- represents an expansion tree of additional information we want to retrieve- Returns:
RestWarningscontaining warnings if stage cannot be moved- Throws:
WebValidationException
-
updateStage
@PUT @Path("{stageId}") public RestStage updateStage(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @BeanParam @Nullable @Nullable ConfirmationToken confirmationToken, @BeanParam ExpansionParam expansion, @Context jakarta.ws.rs.core.UriInfo uriInfo, RestStage restStage) throws WebValidationException Updates a stage partially, not overriding any field that it's not specified.- Parameters:
planKeyString- the key of the plan the stage belongs tostageId- the stage id of the stage to be updatedconfirmationToken- token to validate that the stage being updated has not been modified in the meantime, in which case the operation would be rejected. To get this validation token seegetMoveWarnings(String, long, int, ExpansionParam, UriInfo). This token in optional, if not specified it won't be checked and the operation will be forced.expansion- represents an expansion tree of additional information we want to retrieverestStage- representation of the stage to update- Returns:
RestStageupdated stage- Throws:
WebValidationException- if there's validation errors, which maps into a 400 Bad Request
-
getDeletionWarnings
@GET @Path("{stageId}/deletionWarnings") public RestWarnings getDeletionWarnings(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @BeanParam ExpansionParam expansion, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Retrieves the warnings in relation to deleting a stage. The resulting object contains all the details, including a list of jobs effected by the change.- Parameters:
planKeyString- the key for the planstageId- the stage idexpansion- represents an expansion tree of additional information we want to retrieve- Returns:
RestWarningscontaining warnings if stage cannot be removed- Throws:
WebValidationException
-
removeStage
@DELETE @Path("{stageId}") public jakarta.ws.rs.core.Response removeStage(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @BeanParam @Nullable @Nullable ConfirmationToken confirmationToken, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Deletes a specific stage of a build plan.- Parameters:
planKeyString- the key for the planstageId- unique identifier of the stage to the deletedconfirmationToken- token to validate that the stage being deleted has not been modified in the meantime, in which case the operation would be rejected. To get this validation token seegetDeletionWarnings(String, long, ExpansionParam, UriInfo). This token in optional, if not specified it won't be checked and the operation will be forced.- Returns:
Responsean empty response- Throws:
WebValidationException
-