Class JobConfigResource

java.lang.Object
com.atlassian.bamboo.plugins.rest.plan.stage.job.JobConfigResource

@Path("config/plan/{planKey}/stage/{stageId}/job") @Consumes("application/json") @Produces("application/json") @Internal public class JobConfigResource extends Object
Provides RESTful operations on jobs for the configuration of build plans. For operations on a specific job, we'd need to identify the build and stage it belongs to. For using just the job key, use JobConfigShortcutResource.
Since:
5.9
  • Field Details

    • ADD_JOB

      public static final RestJob ADD_JOB
      Used for REST documentation generation.
    • JOB

      public static final RestJob JOB
    • ALL_JOBS

      public static final RestPageModel<RestJob> ALL_JOBS
    • JOB_WARNINGS

      public static final RestWarnings JOB_WARNINGS
      Used for REST documentation generation.
  • Constructor Details

  • Method Details

    • getAllJobsForStage

      @GET public RestPageModel<RestJob> getAllJobsForStage(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @BeanParam PageRequest pageRequest, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
      Return all jobs for the given stage.
      Parameters:
      planKeyString - plan to retrieve jobs for
      stageId - stage to retrieve jobs for
      pageRequest - represents the params that define which page the request is after
      expansion - represents an expansion tree of additional information we want to retrieve
      Returns:
      a paginated representation of a RestJob
      Throws:
      WebValidationException
    • getDeletionWarnings

      @GET @Path("{jobKey}/deletionWarnings") public RestWarnings getDeletionWarnings(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @PathParam("jobKey") String jobKeyString, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
      Retrieves the warnings in relation to deleting a job. 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
      jobKeyString - the job key to retrieve warnings when moving
      expansion - represents an expansion tree of additional information we want to retrieve
      Returns:
      RestWarnings containing warnings if job cannot be removed
      Throws:
      WebValidationException
    • getMoveWarnings

      @GET @Path("{jobKey}/moveWarnings") public RestWarnings getMoveWarnings(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @PathParam("jobKey") String jobKeyString, @QueryParam("targetStageId") long targetStageId, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
      Retrieves the warnings in relation to moving a job. 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
      jobKeyString - the job key to retrieve warnings when moving
      targetStageId - stage id the job is going to be moved to
      expansion - represents an expansion tree of additional information we want to retrieve
      Returns:
      RestWarnings containing warnings if job cannot be moved
      Throws:
      WebValidationException
    • addJob

      @POST public javax.ws.rs.core.Response addJob(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo, RestJob restJob) throws WebValidationException
      Adds a job to the given stage.
      Parameters:
      planKeyString - key for the plan
      stageId - stage to add the job to
      expansion - represents an expansion tree of additional information we want to retrieve
      uriInfo - provides access to application and request URI information
      restJob - representation of the job to be added
      Returns:
      Response a response pointing to the location of the added job
      Throws:
      WebValidationException - if there's validation errors, which maps into a 400 Bad Request
    • getJob

      @GET @Path("{jobKey}") public RestJob getJob(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @PathParam("jobKey") String jobKeyString, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
      Retrieves the details of a specific job of a stage of a build plan.
      Parameters:
      planKeyString - the key of the plan
      stageId - unique identifier of the stage the job belongs to
      jobKeyString - identifier of the job to retrieve details for
      expansion - represents an expansion tree of additional information we want to retrieve
      Returns:
      RestJob
      Throws:
      WebValidationException
    • updateJob

      @PUT @Path("{jobKey}") public RestJob updateJob(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @PathParam("jobKey") String jobKeyString, @BeanParam @Nullable @Nullable ConfirmationToken confirmationToken, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo, RestJob restJob) throws WebValidationException
      Updates a job 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 the job belongs to
      jobKeyString - identifier of the job to retrieve details for
      confirmationToken - token to validate that the job 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, String, long, 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
      restJob - representation of the job to update
      Returns:
      RestJob
      Throws:
      WebValidationException - if there's validation errors, which maps into a 400 Bad Request
    • removeJob

      @DELETE @Path("{jobKey}") public javax.ws.rs.core.Response removeJob(@PathParam("planKey") String planKeyString, @PathParam("stageId") long stageId, @PathParam("jobKey") String jobKeyString, @BeanParam @Nullable @Nullable ConfirmationToken confirmationToken, @Context javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
      Deletes a specific job of a build plan.
      Parameters:
      planKeyString - the key for the plan
      stageId - unique identifier of the stage the job belongs to
      jobKeyString - identifier of the job to delete
      confirmationToken - token to validate that the job 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, String, ExpansionParam, UriInfo). This token in optional, if not specified it won't be checked and the operation will be forced.
      uriInfo - provides access to application and request URI information
      Returns:
      Response an empty response
      Throws:
      WebValidationException