Class RequirementResource
java.lang.Object
com.atlassian.bamboo.plugins.rest.plan.stage.job.requirement.RequirementResource
@Path("config/job/{jobKey}/requirement")
@Consumes("application/json")
@Produces("application/json")
@Internal
public class RequirementResource
extends Object
Provides RESTful operations on build requirements.
- Since:
- 5.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RestAgentSummarystatic final RestRequirementUsed for REST documentation generation.static final List<RestRequirement> -
Constructor Summary
ConstructorsConstructorDescriptionRequirementResource(RequirementService requirementService, BambooPermissionManager bambooPermissionManager, FeatureManager featureManager, InputParser inputParser, LinkService linkService, PlanRestService planRestService) -
Method Summary
Modifier and TypeMethodDescriptionaddRequirementForJob(String jobKeyString, RestRequirement requirement, jakarta.ws.rs.core.UriInfo uriInfo) Adds a requirement for a given job.getAgentMatchesForJob(String jobKeyString, jakarta.ws.rs.core.UriInfo uriInfo) Gets a summary of the agents that are capable of running a job, based off its requirements.getDetailedAgentMatchesForJob(String jobKeyString, jakarta.ws.rs.core.UriInfo uriInfo) getRequirementForJob(String jobKeyString, long requirementId, jakarta.ws.rs.core.UriInfo uriInfo) Gets the details of a requirement for a given job.getRequirementsForJob(String jobKeyString) Gets all the requirements of a job.jakarta.ws.rs.core.ResponseremoveRequirementFromJob(String jobKeyString, long requirementId) Removes a requirement for a job.updateRequirementForJob(String jobKeyString, long requirementId, RestRequirement requirement, jakarta.ws.rs.core.UriInfo uriInfo) Updates a requirement for a given job.
-
Field Details
-
REQUIREMENT
Used for REST documentation generation. -
REQUIREMENTS
-
AGENT_SUMMARY
-
-
Constructor Details
-
RequirementResource
@Inject public RequirementResource(RequirementService requirementService, BambooPermissionManager bambooPermissionManager, FeatureManager featureManager, InputParser inputParser, LinkService linkService, PlanRestService planRestService)
-
-
Method Details
-
getAgentMatchesForJob
@GET @Path("summary") public RestAgentSummary getAgentMatchesForJob(@PathParam("jobKey") String jobKeyString, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Gets a summary of the agents that are capable of running a job, based off its requirements.- Parameters:
jobKeyString- job key of the job- Returns:
RestAgentSummary- Throws:
WebValidationException
-
getDetailedAgentMatchesForJob
@GET @Path("detailedSummary") public RestAgentSummary getDetailedAgentMatchesForJob(@PathParam("jobKey") String jobKeyString, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException - Throws:
WebValidationException
-
getRequirementsForJob
@GET public List<RestRequirement> getRequirementsForJob(@PathParam("jobKey") String jobKeyString) throws WebValidationException Gets all the requirements of a job.- Parameters:
jobKeyString- job key of the job- Returns:
- a list of
RestRequirement - Throws:
WebValidationException
-
getRequirementForJob
@GET @Path("{id}") public RestRequirement getRequirementForJob(@PathParam("jobKey") String jobKeyString, @PathParam("id") long requirementId, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Gets the details of a requirement for a given job.- Parameters:
jobKeyString- job key of the jobrequirementId- unique identifier of the requirement to get details of- Returns:
RestRequirement- Throws:
WebValidationException
-
addRequirementForJob
@POST public RestRequirement addRequirementForJob(@PathParam("jobKey") String jobKeyString, RestRequirement requirement, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Adds a requirement for a given job.- Parameters:
jobKeyString- job key of the jobrequirement- a representation of the requirement- Returns:
RestRequirement- Throws:
WebValidationException
-
updateRequirementForJob
@PUT @Path("{id}") public RestRequirement updateRequirementForJob(@PathParam("jobKey") String jobKeyString, @PathParam("id") long requirementId, RestRequirement requirement, @Context jakarta.ws.rs.core.UriInfo uriInfo) throws WebValidationException Updates a requirement for a given job.- Parameters:
jobKeyString- job key of the jobrequirementId- requirement id of the requirement to updaterequirement- an updated representation of the requirement- Returns:
RestRequirement- Throws:
WebValidationException
-
removeRequirementFromJob
@DELETE @Path("{id}") public jakarta.ws.rs.core.Response removeRequirementFromJob(@PathParam("jobKey") String jobKeyString, @PathParam("id") long requirementId) throws WebValidationException Removes a requirement for a job.- Parameters:
jobKeyString- key of the jobrequirementId- requirement id of the requirement to delete- Returns:
Responsean empty response- Throws:
WebValidationException
-