Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,028
Community Members
 
Community Events
168
Community Groups

Can I make an API call to bamboo to rename my Agent

Hi All

   So I have written an Ansible Playbook that creates a EC2 instance then makes that a Bamboo Agent, in my playbook I make an API call to my bamboo server that authorizes the new agent and enables it, but the name of the agent is the hostname it gets from aws so I wanted to know since i can't change the host name in my playbook for aws, is there a bamboo api call that i could do that with?

1 answer

1 accepted

0 votes
Answer accepted

Hello @William Flow

Assuming you are running Remote Agents on an EC2 instance and not Elastic Agents which are Ephemeral by nature, you can use the following API call to modify the Agent's name:

curl --request PUT \ 
--url 'http://{baseurl}/rest/admin/latest/config/agents/{agentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"id": 131073,
"type": "local",
"name": "Default Agent",
"description": "This is a description",
"enabled": true,
"link": "https://baseurl/rest/admin/latest/agent/131073"
}'

The agentId can be obtained from <bamboo-agent-home>/bamboo.cfg.xml

Regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events