Skip to content

Commit c81c648

Browse files
committed
scripts to delete CCDB objects from the test instance
1 parent dd5dca1 commit c81c648

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

UTILS/delete_CCDBObject.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
OBJECT=${1}
2+
# object is of the form PATH/VALIDITY/ID
3+
# Users/s/swenzel/MCProdInfo/LHC24d1c_minus50/529663/55ceab78-485e-11f0-8e6c-c0a80209250c
4+
5+
curl -X DELETE --cert /tmp/tokencert_$(id -u).pem \
6+
--key /tmp/tokenkey_$(id -u).pem \
7+
-v -k \
8+
"http://ccdb-test.cern.ch:8080/${OBJECT}"
9+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Step 1 we browse the complete MCProd (or whatever) subfolder
2+
3+
P=$1
4+
5+
BROWSE_RESULT=$(curl --cert /tmp/tokencert_$(id -u).pem \
6+
--key /tmp/tokenkey_$(id -u).pem \
7+
-v -k \
8+
"http://ccdb-test.cern.ch:8080/browse/${P}/*" | awk -F': ' '
9+
/^ID:/ {id=$2}
10+
/^Path:/ {path=$2}
11+
/^Validity:/ {split($2, a, " -"); validity=a[1]; print path "/" validity "/" id}
12+
')
13+
14+
for path in ${BROWSE_RESULT}; do
15+
echo "Will,Would delete ${path}"
16+
./delete_CCDBObject.sh ${path}
17+
done

0 commit comments

Comments
 (0)