Last active
May 12, 2018 00:57
-
-
Save trisharia/61b1e20dc8ae95eefb27849562a45c10 to your computer and use it in GitHub Desktop.
Get the network names of a vRA reservation
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 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