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 |
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>" + |
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>"; |
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"; |
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>" + |
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); |
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); |
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); | |
} |
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> |
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> |