Bamboo - Get deploy project JSON using REST API
by
Jeremy Canfield |
Updated: January 06 2023
| 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/deploy/project 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/deploy/project
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/deploy/project?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/158204054 | python -m json.tool
Something like this should be returned.
{
"description": "",
"environments": [
{
"configurationState": "TASKED",
"deploymentProjectId": 158204054,
"description": "",
"id": 158302943,
"key": {
"key": "158204054-158302943"
},
"name": "development",
"operations": {
"allowedToCreateVersion": false,
"allowedToExecute": false,
"allowedToSetVersionStatus": false,
"canDelete": false,
"canEdit": false,
"canExecute": false,
"canView": true,
"canViewConfiguration": false
},
"position": 0
},
{
"configurationState": "TASKED",
"deploymentProjectId": 158204054,
"description": "",
"id": 158302944,
"key": {
"key": "158204054-158302944"
},
"name": "staging",
"operations": {
"allowedToCreateVersion": false,
"allowedToExecute": false,
"allowedToSetVersionStatus": false,
"canDelete": false,
"canEdit": false,
"canExecute": false,
"canView": true,
"canViewConfiguration": false
},
"position": 1
},
{
"configurationState": "TASKED",
"deploymentProjectId": 158204054,
"description": "",
"id": 158302945,
"key": {
"key": "158204054-158302945"
},
"name": "production",
"operations": {
"allowedToCreateVersion": false,
"allowedToExecute": false,
"allowedToSetVersionStatus": false,
"canDelete": false,
"canEdit": false,
"canExecute": false,
"canView": true,
"canViewConfiguration": false
},
"position": 2
}
],
"id": 158204054,
"key": {
"key": "158204054"
},
"name": "myProject Develop Deployment",
"oid": "1d7ovrexcgn12",
"operations": {
"allowedToCreateVersion": false,
"allowedToExecute": false,
"allowedToSetVersionStatus": false,
"canDelete": false,
"canEdit": false,
"canExecute": false,
"canView": true,
"canViewConfiguration": false
},
"planKey": {
"key": "PROJECT001"
},
"repositorySpecsManaged": false
}
Did you find this article helpful?
If so, consider buying me a coffee over at