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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

assign dedicated external bamboo agent to project

Hello,

 

I am trying to do a dedicated assigment between a external agent and a plan/job or whatever, using the bamboo rest api.

I found in the Documentation this.

/agent/assignment?executorType&executorId&assignmentType&entityId

 

executorType

string

should be AGENT or IMAGE

executorId

long

executor id. Id of agent or elastic image.

assignmentType

string

should be PROJECT, PLAN, JOB, ENVIRONMENT, DEPLOYMENT_PROJECT

entityId

long

entity id. Identifier of project, plan, job, deployment project or environment.

 

 

I am wondering what entityId really is and where i can find it from eacht Plan, job ..

Its waiting for a long so, jobkey or plankey will not work.

 

Also on the get 

/agent/assignment/search?executorType&executorId&entityType&searchTerm

What the heck should entityType be?

The rest api seems to be not very good documented :-(

 

Any help would be much appriciated.

1 answer

0 votes

Hi @phlo_z,

 

entityID

The entityID is the ID used to identify the project/plan/job in the Bamboo database. That is a design issue that blocks this API to be used only through a sequence of rest APIs.

There are some improvement requests related to this issue already reported:


There are also internal discussions to change the agent assignment REST endpoint to make it use only project/plan/job keys which would make things a lot easier.

The API will work completely through APIs if you need to assign deployments/environments.

To get the de IDs you need to call:

  • /rest/api/latest/deploy/project/all

 

executorID

Regarding the executorID, you can get it from:

  • /rest/api/latest/agent
    The field is id (agent id).

 

Steps to do the agent assignment

  1. Get the executorID which is the agent id using the following call:
    curl -X GET -u <USER>:<PASSWORD> "<BAMBOO_URL>/rest/api/latest/agent"
  2. Get the entityID from either the DB (project/plan/job) as shared above or use the deployment call below:
    curl -X GET -u <USER>:<PASSWORD> "<BAMBOO_URL>/rest/api/latest/deploy/project/all"
  3. Assign the agent with the following call:
    curl -X POST -u <USER>:<PASSWORD> "<BAMBOO_URL>/rest/api/latest/agent/assignment?executorType=AGENT&executorId=<EXECUTOR_ID>&assignmentType=<ASSIGNMENT_TYPE>&entityId=<ENTITY_ID>" 

I hope that helps.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

588 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you