Skip to content

Instantly share code, notes, and snippets.

@trisharia
Created May 12, 2018 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trisharia/11e95d965f1e94fc692bf450c10f6ebc to your computer and use it in GitHub Desktop.
Save trisharia/11e95d965f1e94fc692bf450c10f6ebc to your computer and use it in GitHub Desktop.
Get a vRA reservation object given its name
// 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment