Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get agent information of a build from bamboo rest api?

Kaushik Veluru June 5, 2018

Is it possible to know on which agent a build was run from bamboo REST API?

1 answer

0 votes
Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

HI @Kaushik Veluru

Here is the Bamboo server rest API documentation please have a look at it, Maybe it will help you to get the Agent details.

Kaushik Veluru June 5, 2018

Hi @Yogesh Mude

I did look at the documentation. When I query for a particular build result key, the response JSON doesn't have any information about the agent it ran on. 

So was wondering if there is any other to get the agent context from build result.

Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

HI @Kaushik Veluru

Tyr to use the Agent assignment, It will provide you the list of agent for that particular Environment. 

Kaushik Veluru June 5, 2018

Thanks for your reply. 

https://docs.atlassian.com/atlassian-bamboo/REST/6.5.0/?_ga=2.242641030.542479807.1528216545-169502281.1503517115#d2e2088

I have looked into the agent assignment. What is the 'executorId' here? How do I get that information?

 

Thanks.

Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2018

In Bamboo, the build will run through the Executables nothing but the Agent.

So please check the Executable ID and pass it, and see the result.

Ex: for java project build using Maven we need to add the Task like Maven build in this case we need to add/provide the maven path ie nothing but the Executable.

Kaushik Veluru June 5, 2018

https://bamboo.air.com/rest/api/latest/agent/assignment?executorType=AGENT&executorId=280920167

Providing agent ID as executorId returns an empty list  '[]'. What does that mean? 

Does this API work only if the agent is dedicated to a plan?

Nico Schuurmans March 20, 2020

I have a similar question. Suppose I have a plan with multiple stages and jobs, and for each job I want to know the agent that was used. When I use the API I seem to get all information, except the agent. I need to know in order to analyze queue wait time and agent resource utilization. 

Like # people like this
Valerii July 27, 2022

Hi @Nico Schuurmans ,

Could you please clarify, whether you found a solution of your question?

Nico Schuurmans July 27, 2022

HI @Valerii unfortunately this information is still not provided by the API doing a "rest/api/latest/build#" - get all information except the agent it runs on. Dont understand as bamboo provides this info via the gui. (using bamboo 8.2.4)

Like # people like this
Nicolas Mertens
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2022

does not show up in bamboo  8.1.6 build 80114 either

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events