Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-18255

Enable and disable agents over REST API

    XMLWordPrintable

Details

    • 3
    • 4
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition

      There currently is no API to enable or disable an agent 

      Suggested Solution

      Add an API endpoint to change status of the agent

      Workaround

      Hit the UI endpoints:
      Please note, these are the freemarker actions Bamboo uses internally and are subject to change between versions without any notice

      Restart
      curl -L -s -u bamboo -p -H "X-Atlassian-Token: no-check"  "<bamboo-url>/admin/agent/startAgent.action?agentId=<agent-id>" > /dev/null
      
      Request agent stop
      curl -L -s -u bamboo -p -H "X-Atlassian-Token: no-check"  "<bamboo-url>/admin/agent/stopAgentNicely.action?agentId=<agent-id>" > /dev/null
      
      Stop immediately
      curl -L -s -u bamboo -p -H "X-Atlassian-Token: no-check"  "<bamboo-url>/admin/agent/stopAgent.action?agentId=<agent-id>" > /dev/null
      
      Enable agent
      BAMBOO_ADMIN=
      AGENT_ID=
      
      curl --user $BAMBOO_ADMIN -H "X-Atlassian-Token: no-check" -H 'Content-Type: application/x-www-form-urlencoded' -X POST '<bamboo-url>/admin/agent/configureAgents!reconfigure.action' \
       --data "enableButton=Enable&selectedAgents=$AGENT_ID"
      
      Disable agent
      BAMBOO_ADMIN=
      AGENT_ID=
      
      curl --user $BAMBOO_ADMIN -H "X-Atlassian-Token: no-check" -H 'Content-Type: application/x-www-form-urlencoded' -X POST '<bamboo-url>/admin/agent/configureAgents!reconfigure.action' \
       --data "disableButton=Disable&selectedAgents=$AGENT_ID"
      

      Alternatively, this third party add-on provides a REST endpoint to enable / disable agents (amongst other things):

      Attachments

        Activity

          People

            72548a1cec6d Wioletta Dys
            ezeidan Elias Zeidan
            Votes:
            26 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: