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.