Missed Team ’24? Catch up on announcements here.

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

List all bamboo agent capabilities via rest

Paul Moors March 31, 2023

How can I list the capabilities for a bamboo agent using the rest api?

I was thinking that rest/api/latest/agent/<agent-id>/capability should work but there is no result.

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 31, 2023

Hey @Paul Moors

That endpoint should work. Here's an example:

$ curl -s -H "Accept: application/json" -uuser:pass -X GET 'https://bamboo.mydomain.net/rest/api/latest/agent/56066049/capability' | jq
[
  {
    "key": "system.docker.executable",
    "value": "/bin/docker",
    "source": "AUTO_DETECTION"
  },
  {
    "key": "system.git.executable",
    "value": "/bin/git",
    "source": "AUTO_DETECTION"
  },
  {
    "key": "system.jdk.JDK 1.8",
    "value": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-2.el9_1.x86_64",
    "source": "AUTO_DETECTION"
  },
  {
    "key": "system.jdk.JDK 1.8.0_362",
    "value": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-2.el9_1.x86_64",
    "source": "AUTO_DETECTION"
  },
  {
    "key": "system.jdk.JDK",
    "value": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-2.el9_1.x86_64",
    "source": "AUTO_DETECTION"
  }
]

Check this other Community question for a KB article that shows how to export it in a consumable format:

Best regards,

Eduardo Alvarenga
Atlassian Support APAC

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

Paul Moors April 3, 2023

The information is indeed very helpful, except that I get a 404 error when using that endpoint as described

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2023

Hi @Paul Moors 

Bamboo REST API will return 404 if it can't find the Agent id. Check the URL you are using and replace it with your Agent id.

Best regards,

Eduardo Alvarenga
Atlassian Support APAC

Paul Moors April 3, 2023

I use one of the agent-id's that are being returned when using endpoint rest/api/latest/agent. See below.

For example:

2023-04-03 14_11_29-Window.png

Is that the correct id which I'm using?

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2023

That's correct if you want to get information from the Local Agent.

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events