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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,559,974
Community Members
 
Community Events
185
Community Groups

can i create an elastic agent via an api call

so i have a script that 

creates and ec2 instance

configures it as an elastic agent

creates the AMI

 

now i want create an elastic agent via that AMI with a API call is this doable via API call? or is there another automated way

 

 

Thanks

 

Bill

1 answer

1 accepted

0 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 28, 2023

Hello @William Flow

Bamboo relies on premade AMIs to launch its Elastic Agents. An EC2 instance that is supposed to be used as an Elastic Agent needs to be launched by Bamboo and cannot be running before that.

Considering your AMI contains all the required applications to launch an Elastic Agent, you just have to add your AMI as a Custom image in Bamboo and launch an Elastic Agent.

Here are some links for you:

Best regards,

Eduardo Alvarenga
Atlassian Support APAC

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

Hi Eduardo

  Yes I understand that my question is can I fire up an elastic agent via an api call to bamboo? i will know the image id etc

 

Thanks

 

Bill

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 28, 2023 • edited Mar 29, 2023

Hey @William Flow

There is no REST API endpoint that would allow you to control Elastic Agents up/down specifically. Elastic Agents are expected to be started automatically by the Automatic Elastic Instance Management feature.

But you can always call the UI through curl, for example, below I'm starting one Elastic Agent from imageId=688129:

$ curl -u user:pass 'https://bamboo.mydomain.net/admin/elastic/createElasticInstances.action' -H 'content-type: application/x-www-form-urlencoded' -H 'x-atlassian-token: no-check' -X POST --data-raw 'numAgentsToCreate=1&elasticImageConfigurationId=688129&selectFields=elasticImageConfigurationId&save=Submit'

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

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

Hi Eduardo

   I do have one more question on this in your example you have 

elasticImageConfigurationId=688129&selectFields=elasticImageConfigurationId&save=Submit'

my question is in my instance of Bamboo i dont have the  elasticImageConfigurationId I only have elasticImageConfigurationId how do i get the elasticImageConfigurationId ? or do i just use the elasticImageConfigurationId

ed.png

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 29, 2023 • edited

Hey @William Flow

You can find the list of elastigImageConfigurationId by going to the Bamboo UI:

  • Bamboo Administration >> Elastic Bambo (Image configuration) >> Hover the mouse over each instance and take notes of their configurationId

For that, you can use the REST API to get a list of the images:

For example, the curl below will return all Images Ids and their Names configured on my AWS "ap-se2" region:

$ curl -s -H "Accept: application/json" -uuser:pass -X GET 'https://bamboo.mydomain.net/rest/api/latest/elasticConfiguration' | jq -j '.[] | select(.region == "ap-se2") | .configurationId, " ", .configurationName, "\n"'
491526 Ubuntu stock image
491534 Windows stock image
688129 ealvarenga-bamboo-agent-linux
9633793 ealvarenga-bamboo-agent-windows
35192833 ealvarenga-bamboo-agent-linux-custom

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

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

Like William Flow likes this

Thank you so much! that worked!!~

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events