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.
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--
The information is indeed very helpful, except that I get a 404 error when using that endpoint as described
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use one of the agent-id's that are being returned when using endpoint rest/api/latest/agent. See below.
For example:
Is that the correct id which I'm using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's correct if you want to get information from the Local Agent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.