Last active
March 25, 2017 01:28
-
-
Save trisharia/ca27a32f025416b6c59cfb5a65028abd to your computer and use it in GitHub Desktop.
Get the ID of the Reservation Policy of a vRA Reservation
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 the ID of the Reservation Policy of a vRA Reservation | |
// | |
// For vRO/VRA 7.0+ | |
// | |
// Action Inputs: | |
// host - vCAC:VCACHost - vRA IaaS Host | |
// reservation - vCAC:Reservation - vRA IaaS Reservation | |
// | |
// Return type: string - the ID of the Reservation Policy | |
var entity = reservation.getEntity(); | |
var policies = entity.getLink(host, "HostReservationPolicy"); | |
if (policies.length == 0) { | |
System.warn("No Reservation Policy found for the Reservation"); | |
return null; | |
} | |
var policyEntity = policies[0]; | |
var policyName = policyEntity.getProperty("name"); | |
var policyId = policyEntity.getProperty("id"); | |
System.log("Found Reservation Policy '" + policyName + "' with ID '" + policyId + "'"); | |
return policyId; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment