Last active
May 12, 2018 00:48
-
-
Save trisharia/735cfd0790dc7bd9acd8ff99a5a8eea9 to your computer and use it in GitHub Desktop.
Get all the managed VMs in a vRA IaaS instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VMware vRealize Orchestrator action sample | |
// | |
// Get all the managed VMs in a vRA IaaS instance | |
// | |
// For vRO/VRA 7.0+ | |
// | |
// Action Inputs: | |
// host - vCAC:VCACHost - vRA IaaS Host | |
// | |
// Return type: Array/vCAC:VirtualMachine - all managed VMs in a vRA instance | |
var result = []; | |
if (host == null) return result; | |
var properties = new Properties(); | |
properties.put("IsManaged", true); | |
var entities = vCACEntityManager.readModelEntitiesByCustomFilter(host.id, "ManagementModelEntities.svc", "VirtualMachines", properties, null); | |
for each( var entity in entities) { | |
result.push(entity.getInventoryObject()); | |
} | |
return result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment