Hi,
I have a workflow that exports BIOS settings of a ESXi host. I need to put the file into a Resource Element to import this on other hosts.
I am dumping the config using SSH commands, and am able to copy the file to my vRO server (Appliance) but I cannot find any information about how to read the file from the local file system.
I would like to get it into a text or string, so I can save it as a Resource Element. For that I am going to use the following code:
----------------
var attachment = new MimeAttachment;
attachment.content = content;
attachment.mimeType = mimeType;
resourceElement.setContentFromMimeAttachment(attachment);
----------------
Can anyone help. I cannot find any documentation on this.
Best Regards
Brian
Have a look at the Scripting Class, FileReader, either in the API Browser or in these examples:
Remember to also have a look at the File System Access Rights vRO Workflows and Javascript has:
Have a look at the Scripting Class, FileReader, either in the API Browser or in these examples:
Remember to also have a look at the File System Access Rights vRO Workflows and Javascript has:
Works perfectly!
The Code:
var fileReader = new FileReader(fileName) ;
fileReader.open() ;
var fileContentAsString = fileReader.readAll();
fileReader.close() ;
return fileContentAsString;
Do you also happen to know how to delete a local file on the vRO server appliance?
Best Regards
Brian.
I would think in your case you could do something like
var fileReader = new FileReader(fileName) ;
fileReader.open() ;
var fileContentAsString = fileReader.readAll();
fileReader.close() ;
return fileContentAsString;
var theFile = new File(fileName);
theFile.deleteFile()
Using the Scripting Class "File"
Thanks.. It works.
How to move/save orchestrator resource element to vra appliance??