Any Script's are available to delete multiple plans in bamboo ?
we decided to delete 26000 plans, these plans are in different years so cannot delete them by using rm -rf command .
we are working out for some customization to delete these plans.
can we try using rest api ? or can any one suggest some best way to delete those plans.
Thanks
Sunadh Raj
The PROJ_KEY-PLAN_KEY.txt file is an input file which you can create in the Bamboo server.
You can create it in an path where you need to run the script. Use the path as the path to the input file for example if you put the script in /home/bamboo/. So path here would be /home/bamboo/.
PROJ_KEY-PLAN_KEY.txt should contain Projkey-plankey of multiple plans one in each line as shown in the example.
cat PROJ_KEY-PLAN_KEY.txt
PROJ1-PLAN1
PROJ2-PLAN2
PROJ3-PLAN3
PROJ4-PLAN4
Try this KB article:
Thank you,
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.
Not finding any proper REST API . to get solution to delete selected multiple plans.
this is python code :
import requests
url = "http://bamboo-dev.amd.com/rest/api/latest/plan/SPACBAM-{buildKey}"
response = requests.request(
"DELETE",
url
)
print(response.text)
can i use for loop to this code and by mentioning multiple buildkey or fullkey , and test this ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @SunadhRaj.Malaka
Please don't use "rm" to delete Bamboo contents. Bamboo data is stored in many different places, including the database and are tightly connected. Deleting data directly at the file system level is not supported and may break your instance.
Please use the REST API to automate the deletion of plans in bulk or use the "Remove Plans" function by following this path:
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.
Try running the curl command as below without the quotes
curl -u "$username:$password" -X DELETE --url http://<BAMBOO_URL>/rest/api/latest/plan/$line
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
While running
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: http://hostname:8085/rest/api/latest/plan/$line</message></status>projt1-plan1
http://hostname:8085/rest/api/latest/plan/$line
$line is showing error
can you please help out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes please run in against your test environment first . Use the Bamboo test server to run this . As input file you can include the list of PROJKEY-PLANKEY which you are looking to delete in bulk.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
input="/<PATH>/PROJ_KEY-PLAN_KEY.txt"
username="admin"
password="****"
while read -r line
do
echo "$line"
curl -u "$username:$password" -X DELETE --url 'http://<BAMBOO_URL>/rest/api/latest/plan/$line'
done < "$input"
Where can i run this , in my test sever ,? as i am new to this bamboo Development team
could you help me out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
#!/bin/bash
input="/<PATH>/PROJ_KEY-PLAN_KEY.txt"
username="admin"
password="****"
######################################
# Script to remove plans in bulk #
#####################################
while read -r line
do
echo "$line"
curl -u "$username:$password" -X DELETE --url 'http://<BAMBOO_URL>/rest/api/latest/plan/$line'
done < "$input"
1. in input which path I need to mention,
2. Proj_Key-Plan_Key.txt we need to download from data base ?
3. if we should download from database how we can delete from server with help of .txt file ?
4. what is this line about ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.