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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @William Flow
You can find the list of elastigImageConfigurationId by going to the Bamboo UI:
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--
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.