Interface AgentAssignmentService
- All Known Implementing Classes:
AgentAssignmentServiceImpl
public interface AgentAssignmentService
Service for managing the exclusive assignment (dedication) of agents to jobs/environments.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDefinition of a single Executable that can be assigned to the Executor.static classDefinition of a single dedication of an "executor" (any type of agent) to the single executable. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId) Remove agent assignment.voiddeleteExecutableAssignments(@NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments) Remove a collection of agent assignments.voiddeleteExecutorAssignments(@NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignments) Remove a collection of agent assignments.Retrieve an assignment map used to access executable and executor assignmentsbooleanbooleanisCapabilitiesMatch(ElasticImageConfiguration image, long environmentId) booleanisCapabilitiesMatch(ElasticImageConfiguration image, ImmutableJob job) booleanisCapabilitiesMatch(EphemeralAgentTemplate template, long environmentId) booleanisCapabilitiesMatch(EphemeralAgentTemplate template, ImmutableJob job) booleanisCapabilitiesMatch(BuildAgent agent, long environmentid) booleanisCapabilitiesMatch(BuildAgent agent, ImmutableJob job) Helper methods to check if executor is capable of running executable@NotNull AgentAssignmentsaveAgentAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId) Save an agent assignment
-
Method Details
-
saveAgentAssignment
@NotNull @NotNull AgentAssignment saveAgentAssignment(@NotNull AgentAssignment.ExecutorType executorType, long executorId, @NotNull AgentAssignment.ExecutableType executableType, long entityId) throws WebValidationException, AccessDeniedException Save an agent assignment- Returns:
- The saved agent assignment
- Throws:
WebValidationExceptionAccessDeniedException
-
deleteExecutableAssignments
void deleteExecutableAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutable> agentAssignments) throws AccessDeniedException Remove a collection of agent assignments.- Parameters:
agentAssignments- to delete- Throws:
AccessDeniedException
-
deleteExecutorAssignments
void deleteExecutorAssignments(@NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignments) throws AccessDeniedException Remove a collection of agent assignments.- Parameters:
agentAssignments- to delete- Throws:
AccessDeniedException
-
deleteAssignment
void deleteAssignment(AgentAssignment.ExecutorType executorType, long executorId, AgentAssignment.ExecutableType executableType, long entityId) throws AccessDeniedException Remove agent assignment.- Parameters:
executorType- executor typeexecutorId- executor idexecutableType- executable typeentityId- executable id- Throws:
AccessDeniedException- if don't have permissions to edit entity
-
getAgentAssignments
AgentAssignmentMap getAgentAssignments()Retrieve an assignment map used to access executable and executor assignments- Returns:
-
isCapabilitiesMatch
Helper methods to check if executor is capable of running executable -
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isCapabilitiesMatch
-
isAgentAssignmentAllowed
boolean isAgentAssignmentAllowed()- Returns:
- true if agent assignment is allowed at Global settings or user is instance Administrator.
-