Last active
October 6, 2015 20:07
-
-
Save chelnak/ca99bb0ef18b33d1afd1 to your computer and use it in GitHub Desktop.
vCACCAFERestClient http://www.helloitscraig.co.uk/2015/10/how-to-use-vcaccaferestclient-in-the-vrealize-orchestrator-plug-in-for-vrealize-automation.html
This file contains hidden or 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
| var endpoint = "com.vmware.vcac.core.cafe.reservation.api"; | |
| var restClient = vCACCAFEHost.createRestClient(endpoint); | |
| System.log(restClient.getUrl()); | |
| var resourceUrl = "reservations"; | |
| var response = restClient.get(resourceUrl); | |
| //return type is vCACCAFEServiceResponse | |
| var body = response.getBodyAsJson(); | |
| //Reservaiton data is stored in the content array | |
| var reservations = body['content']; | |
| //loop through each reservation and print the name | |
| for (var i = 0; i < reservations.length; i++) { | |
| System.log(reservations[i].name); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment