Created
May 12, 2018 00:51
-
-
Save trisharia/7035db2c7e326a293bdbddff77bbdf83 to your computer and use it in GitHub Desktop.
Get the ID of a vRA reservation given its name
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 ID of a vRA reservation given its name | |
// | |
// For vRO/VRA 7.0+ | |
// | |
// Action Inputs: | |
// cafeHost - vCACCAFE:VCACHost - vRA host | |
// name - string - Name of a Reservation | |
// | |
// Return type: string - vRA reservation unique ID | |
var client = cafeHost.createReservationClient(); | |
var rsvService = client.getReservationReservationService(); | |
var reservations = rsvService.getAllReservations().getContent(); | |
for each (var reservation in reservations) { | |
if (reservation.getName() === name) return reservation.getId(); | |
} | |
return null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment