Skip to content

Instantly share code, notes, and snippets.

@jreypo
Created April 20, 2014 13:58
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 jreypo/11114778 to your computer and use it in GitHub Desktop.
Save jreypo/11114778 to your computer and use it in GitHub Desktop.
//API request payload in XML format
var payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<Request xmlns=\"http://www.vmware.com/vcenter/chargeback/" + cbmVersion + "\">" +
" <Users>" +
" <User>" +
" <LdapServerId></LdapServerId>" +
" <Type>local</Type>" +
" <Name>" + cbmUser + "</Name>" +
" <Password>" + cbmPassword + "</Password>" +
" </User>" +
" </Users>" +
"</Request>";
var inParamtersValues = [];
var apiRequest = cbmLogin.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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment