Action to obtain the complete path of a VM Folder within the hierarchy tree in Aria Automation Orchestrator 8.x
search cancel

Action to obtain the complete path of a VM Folder within the hierarchy tree in Aria Automation Orchestrator 8.x

book

Article ID: 367197

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Action to obtain the complete path of a VM Folder within the hierarchy tree in Aria Automation Orchestrator 8.x

Resolution

In order to get the full path of a VM folder in the hierarchy tree using Aria Orchestrator, the following script can be used in an action element :

  1. Log in to the "Aria Automation Orchestrator" client.
  2. Navigate to Library > Actions.
  3. Click on "New Action".
  4. Execute the below script.

 

// Deepest level folder, eg. VmSubFolder-1-1
var path = "";

while (System.getObjectClassName(targetFolder) == "VcVmFolder") {
    System.log("Folder name: " + targetFolder.name);
    path = "/" + targetFolder.name + path;
    targetFolder = targetFolder.parent;
}

System.log("Path: " + path);
return path;

 

 

And the final path will be - /vm/Folder2/Folder 3/Folder 4/Folder 5