Created
June 20, 2017 00:39
-
-
Save dlinsley/e960a1b36170efdffe7ea8054f131722 to your computer and use it in GitHub Desktop.
Get Software Component Property IDs
This file contains hidden or 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 (vRO) action sample | |
// | |
// Get IDs of Properties of a Software Component | |
// | |
// For vRO/vRA 7.0+ | |
// | |
// Action Inputs: | |
// host - vCACCAFE:VCACHost | |
// componentId - string | |
// | |
// Return type: Array/string | |
var restClient = host.createRestClient("com.vmware.csp.component.software.service.api"); | |
System.debug(restClient.getUrl()); | |
var response = restClient.get("/softwarecomponenttypes/"+componentId); | |
var containerFieldId = response.getProperty("containerFieldId"); | |
var fields = response.getProperty("schema").getProperty("fields"); | |
var propertyIds = []; | |
for (var i in fields) { | |
if (fields[i].getProperty("id") != containerFieldId) { | |
propertyIds.push(fields[i].getProperty("id")); | |
} | |
} | |
return propertyIds; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment