Created
January 22, 2018 16:08
-
-
Save Duologic/7d2660f4513b1788301a20b42ea4670f to your computer and use it in GitHub Desktop.
Delete Rundeck jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ./delete_rundeck_jobs.sh <token> <project> | |
set -euo pipefail | |
IFS=$'\n\t' | |
JOBS=$(curl -s -X GET \ | |
-H"X-Rundeck-Auth-Token: $1" \ | |
-H"Accept: application/json" \ | |
"http://rundeck.example:4440/api/19/project/$2/jobs" | jq .[].id | tr -d '"') | |
for j in $JOBS; do | |
curl -s -X DELETE \ | |
-H"X-Rundeck-Auth-Token: $1" \ | |
"http://rundeck.example:4440/api/19/job/$j" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment