Class AgentsControl
- java.lang.Object
-
- com.atlassian.bamboo.testutils.backdoor.BackdoorControl<AgentsControl>
-
- com.atlassian.bamboo.testutils.backdoor.AgentsControl
-
public class AgentsControl extends BackdoorControl<AgentsControl>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
BackdoorControl.AddXsrfNoCheckTokenFilter, BackdoorControl.JsonMediaTypeFilter
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
ADMIN_REST_PATH, API_REST_PATH, DEFAULT_REST_PATH, rootPath
-
-
Constructor Summary
Constructors Constructor Description AgentsControl(@NotNull BambooEnvironmentData environmentData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
approveAllAgents()
RestEphemeralAgentTemplate
createEphemeralAgentTemplate(String name, String yamlTemplate)
RestAgent
createLocalAgent()
Creates a new local agent with a random name and default configuration.RestAgent
createLocalAgent(boolean removeAfter)
protected com.sun.jersey.api.client.WebResource
createResource()
Creates the resource that corresponds to the root of the TestKit REST API, using the values returned byBackdoorControl.getRestModulePath()
.void
dedicateAgentToDeploymentProject(long agentId, long deploymentProjectId)
void
dedicateAgentToEnvironment(long agentId, long environmentId)
void
dedicateAgentToPlan(long agentId, long planId)
void
dedicateEphemeralTemplateToEntity(long agentId, long entityId, AgentAssignment.ExecutableType entityType)
void
deleteAgent(long agentId)
Deletes a Bamboo agent.void
deleteAllLocalAgents()
void
deleteEphemeralAgentTemplate(Long templateId)
void
disableAllAgents()
void
disableEphemeralAgents()
void
enableAllAgents()
void
enableEphemeralAgents(String label, String pathToConfig)
void
enableEphemeralAgents(String label, String pathToConfig, boolean cleanupEnabled, int cleanupInterval)
void
enableRemoteAgents(boolean enabled)
List<RestDedicatedAgent>
getAgentAssignments(long agentId)
String
getAgentsDedicatedToken(String resultKey)
String
getAgentsToken()
Set<Long>
getEnabledAgentsIds()
void
removeAlreadyDeletedEphemeralAgentTemplate(Long templateId)
void
tearDown()
Cleanup resourcesvoid
undedicateAllAgents()
void
waitForOfflineAgent(long remoteAgentId)
-
Methods inherited from class com.atlassian.bamboo.testutils.backdoor.BackdoorControl
client, createResourceForPath, get, getEnvironmentData, getRestModulePath, percentEncode, ping, post, resourceRoot
-
-
-
-
Constructor Detail
-
AgentsControl
public AgentsControl(@NotNull @NotNull BambooEnvironmentData environmentData)
-
-
Method Detail
-
createResource
protected com.sun.jersey.api.client.WebResource createResource()
Description copied from class:BackdoorControl
Creates the resource that corresponds to the root of the TestKit REST API, using the values returned byBackdoorControl.getRestModulePath()
. Note that the createdWebResource
has the following properties:- it logs all GET/POST/etc requests made through it
- it sets the
Content-Type: application/json
by default (override withWebResource.type(javax.ws.rs.core.MediaType)
)
BackdoorControl.createResourceForPath(java.lang.String)
- Overrides:
createResource
in classBackdoorControl<AgentsControl>
- Returns:
- a WebResource for the TestKit REST API root
- See Also:
BackdoorControl.createResource()
,BackdoorControl.getRestModulePath()
-
waitForOfflineAgent
public void waitForOfflineAgent(long remoteAgentId)
-
createLocalAgent
public RestAgent createLocalAgent()
Creates a new local agent with a random name and default configuration.
-
createLocalAgent
public RestAgent createLocalAgent(boolean removeAfter)
-
tearDown
public void tearDown()
Description copied from class:BackdoorControl
Cleanup resources- Overrides:
tearDown
in classBackdoorControl<AgentsControl>
-
deleteAgent
public void deleteAgent(long agentId)
Deletes a Bamboo agent.
-
deleteAllLocalAgents
public void deleteAllLocalAgents()
-
enableAllAgents
public void enableAllAgents()
-
approveAllAgents
public void approveAllAgents()
-
getAgentsToken
public String getAgentsToken()
-
enableRemoteAgents
public void enableRemoteAgents(boolean enabled)
-
disableAllAgents
public void disableAllAgents()
-
undedicateAllAgents
public void undedicateAllAgents()
-
dedicateAgentToDeploymentProject
public void dedicateAgentToDeploymentProject(long agentId, long deploymentProjectId)
-
dedicateAgentToEnvironment
public void dedicateAgentToEnvironment(long agentId, long environmentId)
-
dedicateAgentToPlan
public void dedicateAgentToPlan(long agentId, long planId)
-
dedicateEphemeralTemplateToEntity
public void dedicateEphemeralTemplateToEntity(long agentId, long entityId, AgentAssignment.ExecutableType entityType)
-
getAgentAssignments
public List<RestDedicatedAgent> getAgentAssignments(long agentId)
-
disableEphemeralAgents
public void disableEphemeralAgents()
-
enableEphemeralAgents
public void enableEphemeralAgents(String label, String pathToConfig, boolean cleanupEnabled, int cleanupInterval)
-
createEphemeralAgentTemplate
public RestEphemeralAgentTemplate createEphemeralAgentTemplate(String name, String yamlTemplate)
-
removeAlreadyDeletedEphemeralAgentTemplate
public void removeAlreadyDeletedEphemeralAgentTemplate(Long templateId)
-
deleteEphemeralAgentTemplate
public void deleteEphemeralAgentTemplate(Long templateId)
-
-