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 Details

    • STAGE_WARNINGS

      public static final RestWarnings STAGE_WARNINGS
      Used for REST documentation generation.
    • ADD_STAGE

      public static final RestStage ADD_STAGE
      Used for REST documentation generation.
    • STAGE

      public static final RestStage STAGE
    • ALL_STAGES

      public static final RestPageModel<RestStage> ALL_STAGES
  • Constructor Details

  • 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 plan
      expansion - represents an expansion tree of additional information we want to retrieve
      pageRequest - represents the params that define which page the request is after
      Returns:
      RestStage a 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 plan
      uriInfo - provides access to application and request URI information
      restStage - represents the stage to add to the build plan
      Returns:
      Response a 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 plan
      stageId - unique identifier of the stage which details are going to be retrieved
      expansion - 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 to
      stageId - the stage id of the stage to be moved
      expansion - represents an expansion tree of additional information we want to retrieve
      Returns:
      RestWarnings containing 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 to
      stageId - the stage id of the stage to be updated
      confirmationToken - 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 see getMoveWarnings(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 retrieve
      restStage - representation of the stage to update
      Returns:
      RestStage updated 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 plan
      stageId - the stage id
      expansion - represents an expansion tree of additional information we want to retrieve
      Returns:
      RestWarnings containing 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 plan
      stageId - unique identifier of the stage to the deleted
      confirmationToken - 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 see getDeletionWarnings(String, long, ExpansionParam, UriInfo). This token in optional, if not specified it won't be checked and the operation will be forced.
      Returns:
      Response an empty response
      Throws:
      WebValidationException