Create a Post
Showing results for 
Search instead for 
Did you mean: 

vRO REST call to SMS failing

I am attempting to add a host to an SMS using REST calls from VMware vRO. All REST calls work correctly using Postman, but fail with vRO. I created a workflow in vRO that will login into the SMS using REST which responds with the "SID" along with other output. I then "JSON.parse" the output and create a JSON object using the SID. A system.log clearly displays the SID.

The workflow continues to the next workflow which should add a host to an existing object-group on SMS. The REST call is the standard vRO script however, I added the following to "add a host":

var addHost = "/add-host";
var requestUrl = baseUrl + addHost;
var HostContent = { "name" : "jawa", "ip-address" : "", "groups" : "Shun List" }
System.log("Request full URL: " + requestUrl);
System.log("sid: " + sid);
var request = transientHost.createRequest(httpMethod, addHost, HostContent);
request.contentType = contentType;
request.setHeader("X-chkp-sid: ", sid);

When the workflow runs, I get the SID just fine, parse it to JSON, and attach it to the "X-chkp-sid" header however, it fails:

2019-01-24 12:51:49.359] [I] Request full URL:
[2019-01-24 12:51:49.360] [I] sid: kbTPfF3mzURhaYWGCs7FGgr5jjQy0PtWA7kMvfMxUlw
[2019-01-24 12:51:49.364] [I] Executing REST request with dynamic credentials: vROadmin
[2019-01-24 12:51:49.365] [I] Query string: /add-host
[2019-01-24 12:51:49.367] [I] Base URL:
[2019-01-24 12:51:49.487] [I] Content as string: {
"code" : "generic_err_wrong_session_id",
"message" : "Wrong session id [\"kbTPfF3mzURhaYWGCs7FGgr5jjQy0PtWA7kMvfMxUlw\"]. Session may be expired. Please check session id and resend the request."

The SID is not wrong though. It matches what the /login workflow returned just milliseconds prior. Also, the session on the SMS is still open...vRO did not close it.

Any ideas?

0 Kudos
2 Replies

From what the error message says, it looks like whatever is creating the X-chkp-sid header is adding quotes around the sid value.

When I manually do that (e.g. using curl), I get a similar error message.


Thanks to everyone. I was able to abstract a log on the Checkpoint that detailed the headers and I could see that my script was inserting both a colon and a space which were invalid to the Checkpoint device. 


Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events