Bootstrap FreeKB - Bamboo - Get plan JSON using REST API
Bamboo - Get plan JSON using REST API

Updated:   |  Bamboo articles

This assumes you have an access token that can be used with the Bamboo REST API. If not, check out my article on Getting Started with the Bamboo REST API.

The /api/version/plan endpoint can be used to return the project deploy JSON for every project.

~]$ curl --insecure --silent --header "Authorization: Bearer MzYwMDgxMzg1NzI2OskFoaK0TJ8O8dKkd9GiHBUzDuy7" --request GET --url https://bamboo.example.com/rest/api/latest/plan

 

By default, 25 results will be returned. max-results can be used to specify how many results you want to return.

~]$ curl --insecure --silent --header "Authorization: Bearer MzYwMDgxMzg1NzI2OskFoaK0TJ8O8dKkd9GiHBUzDuy7" --request GET --url https://bamboo.example.com/rest/api/latest/plan?max-results=1000

 

Or you can specify a certain project using the deploymentProjectId.

~]$ curl --insecure --silent --header "Authorization: Bearer MzYwMDgxMzg1NzI2OskFoaK0TJ8O8dKkd9GiHBUzDuy7" --request GET --url https://bamboo.example.com/rest/api/latest/deploy/project/foo | python -m json.tool

 

Something like this should be returned.

<plan key="foo" name="my Plan" shortName="my Plan" type="chain" enabled="true">
  <planKey>
    <key>bar</key>
  </planKey>
  <link href="https://bamboo.example.com/rest/api/latest/plan/bar" rel="self"/>
</plan>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 4dccc4 in the box below so that we can be sure you are a human.