Any way to get the UUID of the Bamboo remote agents

Hi guys,
Is there is any way to get the UUID of the remote agent
I am trying to get the UUID bu using com.atlassian.bamboo.buildqueue.manager.AgentManager
But there is no method available to get the UUID
Please give some Advice
Thanks in advance

https://docs.atlassian.com/atlassian-bamboo/6.9.2/com/atlassian/bamboo/v2/build/agent/HasUuid.html

HasUuid is implemented by BuildAgentImpl and LocalBuildAgentImpl.

1 Like

Hi @sfbehnke ,
Thank you for your reply.
I need to take the UUID of all the agents available in my bamboo instance.
i will give it a try using “HasUuid”.

From Bamboo 7.0 and above, it’s recommended to use getUuid() on RemoteAgentDefinition (otherwise you might find some agents are missing a UUID):
https://docs.atlassian.com/atlassian-bamboo/7.0.1/com/atlassian/bamboo/buildqueue/RemoteAgentDefinition.html

E.g.

    UUID uuid = UUID.fromString(searchUUID);
    List<BuildAgent> agents = agentManager.getAllRemoteAgents(onlineOnly);

    for (BuildAgent a : agents) {
        PipelineDefinition pd = a.getDefinition();
        if (pd instanceof RemoteAgentDefinition) {
            RemoteAgentDefinition rad = (RemoteAgentDefinition) pd;
            if (uuid.equals(rad.getUuid())) {
                return a.getId(); 
            }
        }
    }
3 Likes

I have a related question. I just cloned a VM hosting a bamboo agent.
Is it possible to generate a new UUID/Id for the agent on the cloned machine, i.e. without going through the uninstall/reinstall?