Last active
January 14, 2019 15:09
-
-
Save trisharia/7663173413c224dbf62aa9d0dac6a02a to your computer and use it in GitHub Desktop.
Get the Catalog Resource of a vRA VM
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 the Catalog Resource of a vRA IaaS VM | |
// | |
// For vRO/VRA 7.0+ | |
// | |
// Action Inputs: | |
// cafeHost - vCACCAFE:VCACHost - vRA CAFE Host | |
// virtualMachine - vCAC:VirtualMachine - vRA IaaS VM | |
// | |
// Return type: vCACCAFE:CatalogResource - the vRA Catalog Resource | |
var name = virtualMachine.virtualMachineName; | |
var id = virtualMachine.virtualMachineID; | |
var catalogResources = vCACCAFEEntitiesFinder.findCatalogResources(cafeHost, name); | |
for each (var resource in catalogResources) { | |
if (resource.providerBinding.getBindingId() === id) { | |
return resource; | |
} | |
} | |
System.warn("Catalog Resource not found for the given Virtual Machine."); | |
return null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment