Skip to content

Instantly share code, notes, and snippets.

@trisharia
Created March 18, 2019 19:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save trisharia/dcdf494ba97f5ab68f7d719658c19061 to your computer and use it in GitHub Desktop.
Get vRA Network Profiles
// VMware vRealize Orchestrator action sample
//
// Returns the names of all network profiles defined in a vRA instance
//
// For vRA 7.0+/vRO 7.0+
//
// Action Inputs:
// vcacHost - vCAC:VCACHost - vRA IaaS Host
//
// Return type: Array/string - the names of the network profiles
if (vcacHost == null) return null;
var modelName = "ManagementModelEntities.svc";
var entitySetName = "StaticIPv4NetworkProfiles";
var entities = vCACEntityManager.readModelEntitiesByCustomFilter(vcacHost.id, modelName, entitySetName, null, null);
System.log("Network Profiles found: "+entities.length);
var prop = new Properties();
for each (var entity in entities) {
prop.put(entity.getProperty("StaticIPv4NetworkProfileName"));
}
return prop.keys.sort();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment