Nexus 3 Repository Management Automation

641 views
Skip to first unread message

Vishal Arora

unread,
Jul 7, 2016, 1:11:38 AM7/7/16
to Nexus Users
Hello,

We are using Nexus Repo Manager OSS 3.0.0-03 in our organization and wants to do automation around repository management i.e listing, creating, updating and deleting of artifacts. But I am not able to get the endpoint URL for the Rest API's to do it.

I had read threads which say REST API's are not part of Nexus 3 is it true and if so what all options I have to do repository automation.

Please any  help / suggestions around this topic is much appreciated.

Thanks,
Vishal Arora
 

sidd rc

unread,
Jul 7, 2016, 3:42:08 AM7/7/16
to Nexus Users
Hi Vishal,
It seems nexus is going to use the groovy scripts approach instead of the REST API calls, so they have exposed 4 objects and you will have to write groovy scripts , which will use these objects and will be published to your respective nexus after which you can call ..../your-groovy-script/run to execute your script on Nexus and that will then fetch you the output
It seems in release 3.0 they are totally focusing on the migrating from 2.x to 3.x and they have removed the REST-API completely from 3.x 
:(
and the objects that they have exposed have no documentation at all and have very limited methods, so basically their groovy approach is in its infancy,
but no REST-API in 3.x that's for sure.


Thanks
Siddharth 

Fraser Goffin

unread,
Jul 7, 2016, 4:00:17 AM7/7/16
to sidd rc, Nexus Users
As I understand it, Sonatype accept the need for the REST API and it
*is* coming, but it appears that it will not be delivered until
release 3.1. No indication as yet when that will be though and
inclusion is not guaranteed.

In the mean time you can use the groovy approach that Siddarth outlined.

For my part I'm going to wait (stay on v2) since I already have a
significant amount of auto-provisioning code that uses the existing
REST API and whilst it will undoubtedly need to be re-factored to
whatever resources the new API exposes, I only want (can afford) to do
that once. But YMMV.

Good luck

Fraser.
> --
> 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/f52a3e63-42c6-42c1-ac16-fd2aa71ed65d%40glists.sonatype.com.
> For more options, visit
> https://groups.google.com/a/glists.sonatype.com/d/optout.
>

Vishal Arora

unread,
Jul 7, 2016, 5:16:12 AM7/7/16
to Nexus Users
Thanks guys for the feedback, very strange that they have decommissioned Rest API support. As suggested I tried going through the examples listed on Git.

But every time I run a curl command with the URL of the API it gives me a 404.

My Nexus installation URL is http://10.131.11.11:8081 and when I give http://10.131.11.11:8081/service/siesta/rest/v1/script in my groovy script it gives me a 404.

How can I verify whether my Nexus installation has the all the components and they are up and running.

Thanks,
Vishal 

Brian Fox

unread,
Jul 7, 2016, 8:03:53 AM7/7/16
to Vishal Arora, Nexus Users
Hi Vishal, it's not a case of decommissioning, it just hasn't been fully replicated/rebuilt on the new codebase.

For what you seem to want, you should be able to do get/put/delete against the repository URL itself, no extra special endpoints are required for the components.

--
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.

Vishal Arora

unread,
Jul 7, 2016, 3:23:00 PM7/7/16
to Brian Fox, Nexus Users

Hi Brian,

Thanks for you input.  As I am fairly new to Nexus integration.  Can you please guide me where I can find the definition of these get/put/delete URLs,

1. What is the URLs for my Nexus installation.
2. What parameters it takes and what will the response.

Thanks,
Vishal

Manfred Moser

unread,
Jul 7, 2016, 6:05:27 PM7/7/16
to bri...@sonatype.com, varor...@gmail.com, nexus...@glists.sonatype.com

Check out the demos I recorded 

http://www.sonatype.org/nexus/2016/06/08/integrating-nexus-repository-3/

and the examples used there

https://github.com/sonatype/nexus-book-examples/tree/nexus-3.0.x/scripting

That should allow you to get started.. then ping us with more questions. 

But simple upload of a file can be done with a simple HTTP put. E.g. see

http://books.sonatype.com/nexus-book/3.0/reference/raw.html#_uploading_files_to_hosted_raw_repositories

hth

Manfred

Vishal Arora

unread,
Jul 7, 2016, 7:12:08 PM7/7/16
to Nexus Users, bri...@sonatype.com, varor...@gmail.com
Thanks a lot I will try it out post results soon :)
Reply all
Reply to author
Forward
0 new messages