vCenter Chargeback API Programming Guide
If you want to use vCenter Chargeback 1.0.1 APIs, you need to do the following tasks:
In the API URL, specify version=1.0.1.
For example, <HTTP_request_method> <Base_Url>/<API_signature>?version=1.0.1
In the request XML, update the request element with the following tag:
<Request xmlns="http://www.vmware.com/vcenter/chargeback/1.5.0">
API Versioning
Every vCenter Chargeback 1.5.0 API request and response includes target namespace to denote the API
version. For example, the following request XML sends the version with which it is working.
<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="http://www.vmware.com/vcenter/chargeback/1.5.0">
<Hierarchies>
<Hierarchy>
<Name>Test_Hierarchy</Name>
<Description>Test Hierarchy</Description>
</Hierarchy>
</Hierarchies>
</Request>
The request states that vCenter Chargeback API version 1.5.0 is being called. If the request is for vCenter
Chargeback server version 1.0.1, the call fails. If the request is for vCenter Chargeback server 1.5.0, the call
succeeds and gets a response similar to the following.
<?xml version="1.0" encoding="UTF-8"?>
<Response
xmlns="http://www.vmware.com/vcenter/chargeback/1.5.0"
<Hierarchies>
<Hierarchy id="1174">
<Name>Test_Hierarchy</Name>
<Description>Test Hierarchy</Description>
<CreatedOn>1275033342320</CreatedOn>
<InSync>true</InSync>
<LastUpdatedTime>1275033342350</LastUpdatedTime>
<LastUpdatedUser>local\superuser</LastUpdatedUser>
<Entities>
</Entities>
</Hierarchy>
</Hierarchies>
</Response>
If you specify the API version, be sure to specify it with both the request XML (wherever applicable) and the
URL. If it is specified only in the request XML or the URL and not both, then the API results in an error. If the
API version is absent in both the URL and the request XML (wherever applicable), then the API returns the
output corresponding to the latest version.
10
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" status="success"
isValidLicense="true">
<Entity id="1175">
<Name>Test_Hierarchy</Name>
<Description>Root</Description>
<Type>100</Type>
<Shares>
<Share>
<Percentage>100</Percentage>
<Parent id="-1" />
<StartTime>0</StartTime>
</Share>
</Shares>
</Entity>
VMware, Inc.