Interface EnvironmentRequirementService
- All Known Implementing Classes:
EnvironmentRequirementServiceImpl
@ExperimentalApi
public interface EnvironmentRequirementService
Service to provide actions on Environment Requirements
- Since:
- v5.13
-
Method Summary
Modifier and TypeMethodDescription@NotNull ImmutableRequirement
addRequirement
(long environmentId, @NotNull String key, ImmutableRequirement.MatchType matchType, @Nullable String matchValue) Add new requirement to an environment.@NotNull ExecutableAgentsMatrix
getExecutableAgentMatrixForEnvironment
(long environmentId) Retrieve all executable agents for a particular environment.@NotNull ExecutableAgentsMatrix
getExecutableAgentMatrixForEnvironment
(@NotNull InternalEnvironment environment) Retrieve all executable agents for a particular environment.@NotNull ImmutableRequirement
getRequirementForEnvironment
(long environmentId, long requirementId) Get a single requirement for a environment.@NotNull List<? extends ImmutableRequirement>
getRequirementsForEnvironment
(long environmentId) Get all requirements for environment.void
removeRequirement
(long environmentId, long requirementId) Remove a specific requirementvoid
renameRequirement
(CapabilityType capabilityType, String oldCapabilityKey, String newCapabilityLabel, boolean override) Updates capability key across all environments.@NotNull ImmutableRequirement
updateRequirement
(long environmentId, long requirementId, @NotNull String key, ImmutableRequirement.MatchType matchType, @Nullable String matchValue) Update an existing requirement.
-
Method Details
-
getRequirementsForEnvironment
@NotNull @NotNull List<? extends ImmutableRequirement> getRequirementsForEnvironment(long environmentId) throws WebValidationException Get all requirements for environment.- Parameters:
environmentId
- of environment- Returns:
- RequirementSet for environment
- Throws:
WebValidationException
- if environmentId invalid
-
getRequirementForEnvironment
@NotNull @NotNull ImmutableRequirement getRequirementForEnvironment(long environmentId, long requirementId) Get a single requirement for a environment.- Parameters:
environmentId
- of environmentrequirementId
- of requirement- Returns:
- requirement
- Throws:
NotFoundException
- if environmentId is invalid or requirement doesn't exist
-
addRequirement
@NotNull @NotNull ImmutableRequirement addRequirement(long environmentId, @NotNull @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable @Nullable String matchValue) throws WebValidationException Add new requirement to an environment.- Parameters:
environmentId
- of environmentkey
- of requirement to match with the capabilitymatchType
- e.g. exists, regex match, equalsmatchValue
- for regex and equals the value the requirement should match- Returns:
- created requirement
- Throws:
WebValidationException
- for any data related error.
-
updateRequirement
@NotNull @NotNull ImmutableRequirement updateRequirement(long environmentId, long requirementId, @NotNull @NotNull String key, @NotNull ImmutableRequirement.MatchType matchType, @Nullable @Nullable String matchValue) throws WebValidationException Update an existing requirement.- Parameters:
environmentId
- of environmentrequirementId
- if of the requirement being updatedkey
- of requirement to match with the capabilitymatchType
- e.g. exists, regex match, equalsmatchValue
- for regex and equals the value the requirement should match- Returns:
- updated requirement
- Throws:
WebValidationException
- for any data related error.
-
removeRequirement
Remove a specific requirement- Parameters:
environmentId
- of environmentrequirementId
- of requirement to remove- Throws:
WebValidationException
- if requirement is not allowed to be removed
-
getExecutableAgentMatrixForEnvironment
Retrieve all executable agents for a particular environment. Includes all disabled and offline agents/images.- Parameters:
environmentId
- of environment- Returns:
- executableAgentMatrix (requirements to matching agents and images)
- Throws:
WebValidationException
-
getExecutableAgentMatrixForEnvironment
@NotNull @NotNull ExecutableAgentsMatrix getExecutableAgentMatrixForEnvironment(@NotNull @NotNull InternalEnvironment environment) Retrieve all executable agents for a particular environment. Includes all disabled and offline agents/images.- Parameters:
environment
- environment- Returns:
- executableAgentMatrix (requirements to matching agents and images)
-
renameRequirement
void renameRequirement(CapabilityType capabilityType, String oldCapabilityKey, String newCapabilityLabel, boolean override) Updates capability key across all environments.- Parameters:
capabilityType
- capability typeoldCapabilityKey
- previous capability key, for example system.builder.mvn.Maven 3newCapabilityLabel
- new capability label, for example Maven 3 updatedoverride
- existing values in case of conflict. If there is a conflict when entity already has capability with new label this flag indicates if it should be overridden or not.
-