// VMware vRealize Orchestrator action sample // // Get the ID of the Catalog Request for a vRA IaaS VM // // For vRO/VRA 7.0+ // // Action Inputs: // host - vCAC:VCACHost - vRA IaaS Host // virtualMachine - vCAC:VirtualMachine - vRA IaaS VM // // Return type: string - the ID of the Catalog Request of a VM var vmEntity = System.getModule("com.vmware.library.vcac").getVirtualMachineEntity(host,virtualMachine); var requestId = getVmEntityPropertyValue(host, vmEntity, "__Cafe.Root.Request.Id"); return requestId; function getVmEntityPropertyValue(host, vmEntity, propertyName) { var virtualMachinePropertiesEntities = vmEntity.getLink(host, "VirtualMachineProperties"); for each (var virtualMachinePropertiesEntity in virtualMachinePropertiesEntities) { if (virtualMachinePropertiesEntity.getProperty("PropertyName") == propertyName) { return virtualMachinePropertiesEntity.getProperty("PropertyValue"); } } return null; }