Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins remote API - is it possible to retrieve the complete job tree using the Jenkins tree query api without knowing the depth?

Tags:

tree

jenkins

When using the folders plugin on Jenkins, jobs are ordered in a tree. I need to retrieve all jobs using the tree query remote api, without know the trees depth.

Eg

api/json?tree=jobs[name,jobs[name,jobs[name]]]&pretty=true

will return all job names from the root of the tree, and the two next levels. Ideally I would like a query that just gives me all job names.

Is this possible? The tree query api is pretty much undocumented... (I experimented with * but that just returns all properties)

like image 665
Nicolas Mommaerts Avatar asked Oct 07 '14 12:10

Nicolas Mommaerts


1 Answers

I have meanwhile asked this to Cloudbees themselves. You either ask all info with the depth parameter, or you manually concatenate the parameters. Either way you need to know the depth.

api/json?depth=3&pretty

or

api/json?tree=jobs[name,buildable,jobs[name,buildable,jobs[name,buildable]]]&pretty
like image 153
Nicolas Mommaerts Avatar answered Oct 26 '22 00:10

Nicolas Mommaerts