DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Learning the Nexus REST API: Read the Docs or Fire Up a Browser

Learning the Nexus REST API: Read the Docs or Fire Up a Browser

Tim O'brien user avatar by
Tim O'brien
·
Jul. 26, 12 · Interview
Like (0)
Save
Tweet
Share
6.43K Views

Join the DZone community and get the full member experience.

Join For Free
When you use Nexus, it is more than a UI. It is a collection of services available for you to automate. With these services you can integrate Nexus in whatever workflow makes sense for you. As a developer, this is what I look for in a product: something beyond the UI, something I can automate, and, most importantly, something that is documented. In Nexus, we’ve made it easy to start integrating Nexus REST services into your workflow by providing extensive documentation.

Yesterday’s post was all about automating Nexus with REST services, and today’s post is focused on giving you the tools you need to access the hundreds of REST endpoints you have access to with Nexus. If you are trying to automate anything in Nexus, you should know that there are two ways to “read” the Nexus REST API. You can access plugin documentation via the Nexus UI, or you can use a tool like Firebug in Firefox or Chrome’s Developer Tools and inspect the requests generated by the Nexus UI.

Reading the Nexus REST Documentation

While Nexus has a rich set of hundreds of REST endpoints for everything from core actions like storing artifacts in a repository to professional features like procurement and staging, the documentation is little tough to find. Here are the steps you need to take to access this documentation:

  1. Login as an Administrator
  2. In the Administration section of the left-hand menu, click on Plugin Console to open the Plugin Console.
  3. Once in the Plugin Console you will see a list of Nexus Plugins. Click on a plugin to view the APIs it provides.
  4. Once you select a plugin, you should see a list of APIs. For example, the video below shows the Core API, click on the link in the Plugin Console to view the REST API documentation.

Here’s a video walkthrough that shows you how to get to the Nexus REST documentation:

 

 

The REST API documentation is extensive and detailed, but there are often times when the best documentation for the Nexus REST API is Nexus itself. In these cases, fire up one of several modern browsers and just watch the network traffic…

Learning the Nexus API by Example

Nexus is a lightweight Javascript UI that connects to REST endpoints on the server-side. Unlike other repositories, the bulk of our application’s UI logic happens in your browser. We don’t do a round-trip to the server and ask for HTML, Nexus uses ExtJS and is communicating to these REST endpoints and exchanging JSON.

For us the REST API isn’t just an extra feature that is “nice” to have, the Nexus UI is based on this REST API. Consider it solid and tested, we rely on it as much as you will come to rely on it. Everything you do in the Nexus UI is calling back to this API. This is why the best way to figure out how to interact with the Nexus REST API is often just fire up a tool like Chrome and watch what the UI is sending across the wire back to Nexus.

Here’s a video that demonstrates how to use Chrome to spy on Nexus. This is often the fastest way to figure what your automation scripts need to do to automate common Nexus tasks:

 

 

REST Web Protocols API Nexus (standard)

Published at DZone with permission of Tim O'brien, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Quest for REST
  • How Do the Docker Client and Docker Servers Work?
  • How To Use Terraform to Provision an AWS EC2 Instance
  • Debugging Threads and Asynchronous Code

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: