Last active
December 7, 2020 09:14
-
-
Save chelnak/03eebad726f5e3ade12d to your computer and use it in GitHub Desktop.
List the properties for a vCAC entity object link http://www.helloitscraig.co.uk/2016/03/list-available-vcacvirtualmachine-entity-links.html
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
/* | |
Name: getLinkProperties | |
Input: vCACHost - vCAC:VCACHost | |
Input: vCACVirtualMachine - vCAC:VirtualMachine | |
Description: List the properties for a vCAC entity object link | |
*/ | |
//Set the name of the link here: | |
var linkName = "VMDiskHardware"; | |
var properties = new Properties(); | |
properties.put("VirtualMachineID", vCACVirtualMachine.virtualMachineID); | |
var vmEntity = vCACEntityManager.readModelEntity(vCACHost.id, "ManagementModelEntities.svc", "VirtualMachines", properties, null); | |
var linkEntity = vmEntity.getLink(vCACHost, linkName); | |
//Log snapshot properties to the console | |
for (var i = 0; i < linkEntity.length; i++) { | |
var linkProperties = linkEntity[i].getProperties(); | |
for (var j = 0; j < linkProperties.keys.length; j++) { | |
System.log(linkProperties.keys[j] + " : " + linkProperties.get(linkProperties.keys[j])); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment