- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can refer the Folder Managed Object fromt the reference guide:
Basically, there is a root folder and it can have descendant folders.A data center's host folder and its descendant foldersA data center's vm folder and its descendant folders
Now, to get a managed object referernce to these folders, you can specify the inventory path to these and use FindByInventoryPath api to retrieve the mor to Folder Managed Entity.
The correct order of specifying the inventory path is:
ManagedObjectReference folderRef =
cb.getConnection().getService().findByInventoryPath(content.getSearchIndex(),
pathToFolder);
"myfolder" is a folder - I am assuming myfolder is a folder underneath the root folder.
"myDC" is a data center
"vm" is a folder holding the vm
Inventory Path for pathToFolder could be: myfolder/myDC/vm