Created
April 20, 2014 14:00
-
-
Save jreypo/11114815 to your computer and use it in GitHub Desktop.
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
//API request payload in XML format | |
var payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + | |
"<Request xmlns=\"http://www.vmware.com/vcenter/chargeback/" + cbmVersion + "\">" + | |
" <Hierarchies>" + | |
" <Hierarchy>" + | |
" <Name>" + hierarchyName + "</Name>" + | |
" <Description>" + hierarchyDescription + "</Description>" + | |
" </Hierarchy>" + | |
" </Hierarchies>" + | |
"</Request>"; | |
var inParamtersValues = []; | |
var apiRequest = restCreateHiearchy.createRequest(inParamtersValues, payload); | |
apiRequest.contentType = "xml/string"; | |
//execute request | |
var apiResponse = apiRequest.execute(); | |
// REST operation output | |
httpCode = apiResponse.statusCode; | |
System.log("HTTP Status code: " + httpCode); | |
var responseString = apiResponse.contentAsString; | |
System.log("API Response: " + responseString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment