Nexus 3 OSS API show limited results for repository endpoint

2,874 views
Skip to first unread message

E.C. Raymond

unread,
May 2, 2018, 4:56:40 PM5/2/18
to Nexus Users
I have read through the API documentation and searched online and lists, etc.  When using curl or the browser for api calls, it limits the results to 50.  The documentation for api repository calls also states that it doesnt use continuation tokens/pagination.  I see no way to change the limit or results to return.  Can someone help point me to how to resolve this?



Peter Lynch

unread,
May 3, 2018, 9:14:32 AM5/3/18
to E.C. Raymond, Nexus Users
The documentation states the API returns all repositories that your user making the request has permission to browse. If the user has permission to browse all, then the API returns all repos - there is no need to implement paging since the API returns as many as you are allowed to access.

It sounds like you either have only 50 repos, the user making the request has restrictive permissions, or how you are counting the results is wrong.



--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/acf7d05b-214b-4537-8565-ff50a89b165e%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

E.C. Raymond

unread,
May 3, 2018, 7:00:02 PM5/3/18
to Nexus Users, low...@gmail.com
I am not listing ALL repositories, but a specific repo with Releases.  The repo was returning no more than 49-50, even though viewing the list of artifacts was showing the number to be more accurate ( 72 ).

It seems like its a specific limitation of the API.

For example:


This is returning >50 results. I am running Nexus OSS 3.10. I had to delete enough artifacts to show the results properly as our build scripts were failing to see new releases.


On Thursday, May 3, 2018 at 6:14:32 AM UTC-7, Peter Lynch wrote:
The documentation states the API returns all repositories that your user making the request has permission to browse. If the user has permission to browse all, then the API returns all repos - there is no need to implement paging since the API returns as many as you are allowed to access.

It sounds like you either have only 50 repos, the user making the request has restrictive permissions, or how you are counting the results is wrong.


On Wed, May 2, 2018 at 5:56 PM, E.C. Raymond <low...@gmail.com> wrote:
I have read through the API documentation and searched online and lists, etc.  When using curl or the browser for api calls, it limits the results to 50.  The documentation for api repository calls also states that it doesnt use continuation tokens/pagination.  I see no way to change the limit or results to return.  Can someone help point me to how to resolve this?



--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.

Peter Lynch

unread,
May 3, 2018, 11:15:18 PM5/3/18
to E.C. Raymond, Nexus Users
Hi,

On Thu, May 3, 2018 at 8:00 PM, E.C. Raymond <low...@gmail.com> wrote:
I am not listing ALL repositories, but a specific repo with Releases.  The repo was returning no more than 49-50, even though viewing the list of artifacts was showing the number to be more accurate ( 72 ).


I was answering your concern based on you providing a link to our help documentation for listing repositories ( not their contents) and describing listing repositories:


When you say "even though viewing the list of artifacts was showing the number to be more accurate" I do wonder what list you are comparing with.

It seems like its a specific limitation of the API.

For example:



This is known as the search components API. The documentation for this endpoint is:


The API does support Pagination. Here is an excerpt from that document with a link to the pagination documentation:

In this case we've found one component which has three assets associated with it. Each component and asset has an id that can be used with the component and asset specific endpoints. Since only one item was found, there is no need for pagination so the continuationToken has a value of null to signify that this is the last page of items. The downloadUrl can be used to directly download the asset from the repository manager.

This endpoint uses a pagination strategy that can be used to iterate through all the search results if desired.



This is returning >50 results. I am running Nexus OSS 3.10. I had to delete enough artifacts to show the results properly as our build scripts were failing to see new releases.


Not documented that I noticed is the page size, which I can confirm is hard coded to 50 results per page - however that should not prevent you from paging through all the components using the documented paging strategy.

It may be that sorting the search results would help your use case. I expect this is a feature we will eventually add. In the meantime try to be as specific as possible with your search criteria and try to use the paging feature when the continuation token is not null.
 
On Thursday, May 3, 2018 at 6:14:32 AM UTC-7, Peter Lynch wrote:
The documentation states the API returns all repositories that your user making the request has permission to browse. If the user has permission to browse all, then the API returns all repos - there is no need to implement paging since the API returns as many as you are allowed to access.

It sounds like you either have only 50 repos, the user making the request has restrictive permissions, or how you are counting the results is wrong.



On Wed, May 2, 2018 at 5:56 PM, E.C. Raymond <low...@gmail.com> wrote:
I have read through the API documentation and searched online and lists, etc.  When using curl or the browser for api calls, it limits the results to 50.  The documentation for api repository calls also states that it doesnt use continuation tokens/pagination.  I see no way to change the limit or results to return.  Can someone help point me to how to resolve this?



--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/acf7d05b-214b-4537-8565-ff50a89b165e%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.

E.C. Raymond

unread,
May 5, 2018, 11:20:34 AM5/5/18
to Nexus Users, low...@gmail.com
Thanks for the help Peter, I was confused by the documentation and what to expect.
Hi,

Reply all
Reply to author
Forward
0 new messages