Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Rename a File in Guest

$
0
0

I am trying to create a workflow that would rename my file in a guest by appending the date in milliseconds to it.  To start out with this I had used the "Move file in guest" workflow that already exists in orchestrator and removed the dstFilePath and overwrite variables from the input parameters.  I also modified the javascript code to look like this:

 

var host = vm.sdkConnection;

var guestOperationsManager = host.guestOperationsManager;
var guestAuth = new VcNamePasswordAuthentication();
guestAuth.username = vmUsername;
guestAuth.password = vmPassword;

var fileManager = guestOperationsManager.fileManager;
result = false;
var currentTime = new Date();
var seconds = currentTime.getTime();
seconds = seconds.toString();
var newPath = seconds.concat(srcFilePath);
fileManager.moveFileInGuest(vm , guestAuth , srcFilePath, newPath, false);
result = true;

 

Ultimately I want to be able to rename my file so that my application can just spit out another log file of the same name but still retain old records.

 

Attached is my workflow just in case it is needed.

 

Thank you.


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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