Created
May 12, 2018 00:50
-
-
Save trisharia/532e065baa3b3103277ed2b043c6aec6 to your computer and use it in GitHub Desktop.
Get a vRA reservation object given its ID
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 a vRA reservation object given its ID | |
// | |
// For vRO/VRA 7.0+ | |
// | |
// Action Inputs: | |
// cafeHost - vCACCAFE:VCACHost - vRA host | |
// reservationId - string - ID of a Reservation | |
// | |
// Return type: vCACCAFE:Reservation - vRA reservation | |
var client = cafeHost.createReservationClient(); | |
var service = client.getReservationReservationService(); | |
var reservations = service.getAllReservations().getContent(); //Array, vCACCAFE:vCACCAFEReservation | |
for each (var reservation in reservations) { | |
if (reservation.getId() === reservationId) { | |
System.log("Reservation found in vCACCAFE inventory with ID '" + reservationId + "'"); | |
return reservation; | |
} | |
} | |
System.warn("No Reservation found in vCACCAFE inventory with ID '" + reservationId + "'"); | |
return null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment