VMware Cloud Community
Czernobog
Expert
Expert

Correct way to add vRLI as REST host to Orchestrator?

I want to add vRLI as a REST host to my Orchestrator instance. I'm using the url https://vrli.local:9543/ with basic authentication, where I input the admin credentails. Adding the host works fine, however no API reqest are successful. I've tested it with the following path: /api/v1/events, the response comes back as "undefined".

I've tried it with curl from the vRO appliance, but the result is empty:

vro.local:~ # curl -k -X GET https://vrli.local:9543/api/v1/events

vro.local:~ # curl -k -X GET http://vrli.local:9000/api/v1/events

Thank you for any suggestions.

Tags (2)
Reply
0 Kudos
5 Replies
iiliev
VMware Employee
VMware Employee

According to vRLI REST API documentation, first you need to obtain a session ID (by calling the API to login with your user/password), and then pass the acquired session ID to the subsequent API calls.

https://vmw-loginsight.github.io/#Getting-started-with-the-Log-Insight-REST-API

Reply
0 Kudos
Czernobog
Expert
Expert

Thanks, I thought the request could be executed without authentication. I have managed to create and invoke a REST operation to get the token bearer.

However in the next step, where I want to invoke a GET request, I have to provide an additional token to authorization. Here I have stumbled across the same problem as described here:  HTTP-REST Invoke a REST Operation Workflow Issues/Questions - there is no way for me to provide the additional header to the request. I'm running vRO 7.3 b5481809 embedded in vRA 7.3 with REST Plugin version 2.2.2. Is there an updated version of the plugin, or should I build the request myself?

Reply
0 Kudos
sbeaver
Leadership
Leadership

This is how I am doing this with my workflows that work with tokens.  First workflow gets the token and then I add it to the next request with this command added to a rest call workflow that takes the token as an input and adds

request.setHeader("Authorization", token);

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
iiliev
VMware Employee
VMware Employee

The latest version of REST plug-in is still 2.2.2, but there are newer plug-in builds having the same version and updated build number (for example, the plug-in bundled with recently released vRO 7.4)

Czernobog
Expert
Expert

Thank you, here is what I did - I have cloned the "Invoke a REST operation" workflow and added a line to include the header, in case of vRLI it would be:

// Add authorization header

request.setHeader("Authorization: Bearer ", token);

Reply
0 Kudos