I was asked the other day on how to get network information that has been put in a reservation.
Here is a script that I wrote:
// Create custom query filter var props = {"GroupID " : bg.groupID}; var model = "ManagementModelEntities.svc" var entity = vCACEntityManager.readModelEntitiesByCustomFilter(vcacHost.id, model, "ProvisioningGroups", props, null); var hostReservations = entity[0].getLink(vcacHost, "HostReservations"); for each (v in hostReservations){ var nicReservations = v.getLink(vcacHost, "HostNicToReservations"); for each (nicReservation in nicReservations){ var hostNics = nicReservation.getLink(vcacHost, "HostNic"); for each (hostNic in hostNics){ System.log("Network profile in BG is: " + hostNic.getProperty("NetworkName")); } } }
These are the input parameters you need to provide, or you could determine these dynamically.
We are using the readModelEntitiesByCustomFilter method which is known as a CRUD operation. There are other methods available on the vCACEntityManager. Here is a screen shot showing them: