Skip to content

Instantly share code, notes, and snippets.

@trisharia
Created May 12, 2018 00:53
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/e1d9695b5d7fed5a57c4fa20bd58070b to your computer and use it in GitHub Desktop.
Save trisharia/e1d9695b5d7fed5a57c4fa20bd58070b to your computer and use it in GitHub Desktop.
Get a vRA reservation policy given its name
// VMware vRealize Orchestrator action sample
//
// Get a vRA reservation policy given its name
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// cafeHost - vCACCAFE:VCACHost - vRA host
// name - string - Reservation policy name
//
// Return type: Any - A single vCACCAFE:vCACCAFEReservationPolicy
var client = cafeHost.createReservationClient();
var rsvpService = client.getReservationReservationPolicyService();
var reservationPolicies = rsvpService.getAllReservationPolicies().getContent();
for each (var reservationPolicy in reservationPolicies) {
if (reservationPolicy.getName() === name) {
return reservationPolicy;
}
}
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment