Last active
May 7, 2018 21:19
-
-
Save kclinden/c870dcd394395fe68816a6b6916843b6 to your computer and use it in GitHub Desktop.
Get Applicable Networks for Reservation Policy with Custom Form Dropdown
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
| //Description: This action is used with vRA to get applicable reservations policies using a custom form dropdown. | |
| //Inputs: | |
| //[STRING] resPolicyId -> bind to ReservationPolicyId | |
| //[STRING] tenant -> bind to tenant reference | |
| //Return Type: Properties | |
| var result = new Properties(); | |
| if(!resPolicyId) { | |
| return result; | |
| } | |
| var host = vCACCAFEHostManager.getDefaultHostForTenant(tenant , true); | |
| var reservations = vCACCAFEEntitiesFinder.getReservations(host); | |
| for each(var resloop in reservations) { | |
| if (resloop.reservationPolicyId == resPolicyId) { | |
| var reservation = resloop; | |
| } | |
| } | |
| var extensionData = reservation.getExtensionData(); | |
| var networks = extensionData.get("reservationNetworks").getValue(); | |
| for each (var network in networks) { | |
| var networkId = network.getValue().get("networkPath").getValue().getId(); | |
| var networkName = network.getValue().get("networkPath").getValue().getLabel(); | |
| result.put(networkName, networkName); | |
| } | |
| return result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment