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/7035db2c7e326a293bdbddff77bbdf83 to your computer and use it in GitHub Desktop.
Save trisharia/7035db2c7e326a293bdbddff77bbdf83 to your computer and use it in GitHub Desktop.
Get the ID of a vRA reservation given its name
// 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