Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the network names of a vRA reservation
// VMware vRealize Orchestrator action sample
//
// Get the network names of a vRA reservation
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// reservation - vCACCAFE:Reservation - vRA Reservation
//
// Return type: Array/strings - Network names
var networkNames = [];
var networkData = reservation.extensionData.get("reservationNetworks").getValue();
var networkPath;
//System.debug("Reservation network data: " + networks);
try {
for each (var n in networkData) {
//System.debug(n);
networkPath = n.getValue().get("networkPath");
//System.debug("Network path: " + networkPath);
//System.debug("Network id: " + networkPath.getId());
//System.debug("Network value: " + networkPath.getValue());
//System.debug("Network label: " + networkPath.getLabel());
//System.debug("Network classId: " + networkPath.getClassId());
networkNames.push(networkPath.getLabel());
}
} catch (e) {
System.error("Error parsing reservation extension data for its networks: " + e);
//do nothing
}
return networkNames;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment