View xml_auth_cbm.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Request xmlns="http://www.vmware.com/vcenter/chargeback/2.0"> | |
<Users> | |
<User> | |
<LdapServerId></LdapServerId> | |
<Type>local</Type> | |
<Name>admin</Name> | |
<Password>vmware123</Password> | |
</User> | |
</Users> |
View get_hierarchy_id.js
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
var hierarchyId = cbmHierarchy.chargebackId; | |
System.log("Hierarchy ID: " + hierarchyId); |
View cbm_ssl.bat
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
:generatePublicKeyAndCopy | |
echo "Generating a Self-Signed Certificate"... | |
openssl.exe x509 -req -days 365 -in default.csr -signkey default.key -out default.cert | |
if not %ERRORLEVEL%==0 goto :error |
View rest_api_login.js
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 + "\">" + | |
" <Users>" + | |
" <User>" + | |
" <LdapServerId></LdapServerId>" + | |
" <Type>local</Type>" + | |
" <Name>" + cbmUser + "</Name>" + | |
" <Password>" + cbmPassword + "</Password>" + | |
" </User>" + |
View rest_api_task_status.js
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
// Check operation status for success or failure | |
responseArray = (apiResponse.contentAsString).split("\n"); | |
responseElement = responseArray[1]; | |
System.log(responseElement); | |
var operationStatus = responseElement.indexOf("status\=\"success\""); | |
if (operationStatus != -1) { | |
var loginStatus = "OK"; | |
System.log("Status OK"); | |
} else { | |
var loginStatus = "NOK"; |
View cbm_rest_api_new_hierarchy.js
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>"; |
View cbm_create_hierarchy.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Request> | |
<Hierarchies> | |
<Hierarchy> | |
<Name>Test_Hierarchy</Name> | |
<Description>Test Hierarchy</Description> | |
</Hierarchy> | |
</Hierarchies> | |
</Request> |
View cbm_rest_new_fixed_cost.js
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 + "\">" + | |
" <FixedCosts>" + | |
" <FixedCost>" + | |
" <Name>" + fixedCostName + "</Name>" + | |
" <Description>" + fixedCostDescription + "</Description>" + | |
" <Currency id=\"" + fixedCostCurrency + "\"/>" + | |
" <IsProrated>" + isProrated + "</IsProrated>" + | |
" <IsPowerStateBased>" + isPowerStateBased + "</IsPowerStateBased>" + |
View list_hierarchies.js
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
var cbmHierarchyList = hierarchyList; | |
for each (var hierarchy in cbmHierarchyList){ | |
System.log("Hierarchy: " + hierarchy.name); | |
} |
View get_hierarchy_by_name.js
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
var hierarchyName = "DevOrg"; | |
var cbmHierarchy = cbmServer.getHierarchyByName(hierarchyName,cbmVersion); |
OlderNewer