Quantcast
Channel: VMware Communities : All Content - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 10285

HTTP-REST download zip file

$
0
0

Hello,

 

Trying to automate Nessus with VRO so that when we build machines once everything is done, we can run a first scan and retrieve the report. Nessus seems to be able to generate a .csv that is stored in a zip file. I'm trying to download that ZIP file into a Ressource Element. But from what I see, the RESTOperation object seems to store the reply in a string in the variable response.contentAsString.

 

I've used the Generate workflow for the REST Operation, and added a few lines if I remember.

 

It looks like this:

 

//prepare request
//Do not edit 
System.log("==== Execution du WF POST ======");


restOperation.urlTemplate = restOperation.urlTemplate + uri;


var inParamtersValues = [];
var request = restOperation.createRequest(inParamtersValues, content);
var noToken = new Number(token);
//set the request content type


request.contentType = "application/zip";
request.setHeader("X-SecurityCenter", noToken);


System.log("Request: " + request);
System.error("Request URL: " + request.fullUrl);


//Customize the request here
//request.setHeader("headerName", "headerValue");


//execute request
//Do not edit 
var response = request.execute();
System.log("request:"+request.contentType);
System.log("response:"+response.contentType);
//prepare output parameters
System.log("Response: " + response);
statusCode = response.statusCode;
statusCodeAttribute = statusCode;
System.log("Status code: " + statusCode);
contentLength = response.contentLength;
headers = response.getAllHeaders();
contentAsString = response.contentAsString;


System.log("Content a
s string: " + contentAsString);












 

But I don't want to retrieve the content as a String, is there another way to receive a binary file via VRO. ? My next step would be to run this on another machine with curl maybe.

 

Thanks,


Viewing all articles
Browse latest Browse all 10285

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>