Created
December 7, 2018 13:02
-
-
Save flaf/e538b18ea6544739ee48aaa0330282a8 to your computer and use it in GitHub Desktop.
Get all jobs in Rundeck
This file contains 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/sh | |
URL='http://localhost:4440' | |
login='admin' | |
password='password...' | |
curl --cookie-jar ~/mycookie --data "j_username=$login" --data "j_password=$password" "$URL/j_security_check" | |
projects=$(curl --silent --cookie ~/mycookie "$URL/api/1/projects" | sed -nr 's|<name>(.*)</name>|\1|p') | |
for project in $projects | |
do | |
printf '#### In project [%s] ####\n' "$project" | |
curl --silent --cookie ~/mycookie --data 'format=yaml' "$URL/api/14/project/$project/jobs/export" | |
done | |
rm ~/mycookie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment