REST API in Jenkins not giving more than 100 results...

1,861 views
Skip to first unread message

khmarbaise

unread,
Sep 1, 2015, 4:54:27 PM9/1/15
to Jenkins Users
I have tried to get information about jobs of my jenkins via REST API simply like this:


but there is a limitation in number of results...

I would understand if there is default to give max. number of 100 results back..but the question is: I would like to have all results or a limited number? Does exist a parameter for this?

After diving into this a little bit more i tried one of the following:


 so this prints out 10 entries...ok so i tried to get 100 which seemed to be working


but if i try to get more than 100 entries like this:


it gave me the same number of results...which looks like a problem which i don't understand or it is a bug...?


Kind regards
Karl Heinz Marbaise

khmarbaise

unread,
Sep 1, 2015, 5:33:04 PM9/1/15
to Jenkins Users
Using ?tree=allBuilds[number]  is the answer...

Christopher Orr

unread,
Sep 1, 2015, 5:37:55 PM9/1/15
to jenkins...@googlegroups.com
The `builds` information is limited to returning only the most recent
100 results.

You can replace that with `allBuilds`, and use the `{m,n}` paging
mechanism you mentioned. Though note that it starts at 0, not 1..

So you can use {0,100} to get the first 100, then {100,200} to get the
next hundred, and so on.

Regards,
Chris
Reply all
Reply to author
Forward
0 new messages