0

I'm trying to get some information of my current jenkins instance running jobs in a bash script. What I want to do is getting a list of all the current jobs running given a parameter.

Something like (this doesn't work): https://jenkins.{company}.com/computer/api/xml?tree=computer[executors[currentExecutable[*]],oneOffExecutors[currentExecutable[*]]]&xpath=/hudson/job[build/action/parameter[name="TAG"][value="web-2773"]]&wrapper=builds

XorX
  • 238
  • 2
  • 5
  • 19

1 Answers1

0

Ok! After so many answers to the question, I decided to do a combination between two api request. It's not exactly what I asked but solved my problem.

First of all, I decided to get all currently running jobs with this:

https://jenkins.{company}.com/computer/api/xml?tree=computer[executors[currentExecutable[url]],oneOffExecutors[currentExecutable[url]]]&xpath=//url&wrapper=builds

Then I parse the results and I do a request to the next URL for each job curretnly running:

https://jenkins.{company}.com/job/{job}/5363/api/xml

And here I can find the parameters. I need to use a bash script to do all but I didn't find any better way. And thats all.

XorX
  • 238
  • 2
  • 5
  • 19