Get a vRA reservation object by name

Get a reservation object given its name of a vRA instance (using the CAFE plug-in).


// VMware vRealize Orchestrator action sample
// Get a vRA reservation object given its name
// For vRO/VRA 7.0+
// Action Inputs:
// cafeHost – vCACCAFE:VCACHost – vRA host
// name – string – Name of a Reservation
// Return type: vCACCAFE:Reservation – vRA reservation

var client = cafeHost.createReservationClient();
var rsvService = client.getReservationReservationService();
var reservations = rsvService.getAllReservations().getContent(); //Array, vCACCAFE:vCACCAFEReservation

for each (var reservation in reservations) {
if (reservation.getName() === name) return reservation;

return null;

Example Output:


Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also