I am attempting to execute the follow code within an action, and receiving the error below. The error suggests that VumVIInventory.id doesn't exist, but the API documentation says differently. Does anybody have any suggestions?
Code:
****Note**** This action takes the input of a VcHostSystem(variable named inputHostSystem) // create the new VUM Inventory object and assign values. // first define a new instance of the object, pointing to the vCenter Server of the host var vumItem = new VumVIInventory(inputHostSystem.sdkConnection.name); System.log(inputHostSystem.sdkConnection.name); System.log(inputHostSystem.reference.value); System.log(inputHostSystem.vimType); System.log(inputHostSystem.name); // get the Managed Object Reference vumItem.id = inputHostSystem.reference.value; // get the Managed Object Type vumItem.type = inputHostSystem.vimType; // get the ESXi Host name vumItem.name = inputHostSystem.name; // the VUMVIInventory object must be an array, so create a dummy one and push the host value in var vumHosts = []; vumHosts.push(vumItem); // return the array of VUM objects (even if it is just one) return vumHosts;
Error Message:
[2017-02-07 07:47:35.352] [E] (<REMOVED>/findVUMobjectfromvCenter) Property or method 'id' not found on object VumVIInventory [2017-02-07 07:47:35.362] [E] Workflow execution stack: *** item: 'Patch host with vUM/item3', state: 'failed', business state: 'null', exception: 'Property or method 'id' not found on object VumVIInventory' workflow: 'Patch host with vUM' (fb97061b-cdb9-487f-b915-bbe897105ca4) | 'attribute': name=serverURI type=string value= | 'attribute': name=entities type=Array/VUM:VIInventory value=null | 'attribute': name=baselines type=Array/VUM:Baseline value=__NULL__ | 'attribute': name=excludedPatches type=Array/VUM:PatchInfo value=null | 'attribute': name=autoAcceptEULA type=boolean value=true | 'input': name=inputHostSystem type=VC:HostSystem value=<REMOVED>' | 'no outputs' *** End of execution stack.