Retrieve List Of Hierarchies - VMware VCENTER CHARGEBACK 1.5 - API Manual

Vcenter chargeback api programming guide
Hide thumbs Also See for VCENTER CHARGEBACK 1.5 - API:
Table of Contents

Advertisement

vCenter Chargeback API Programming Guide
Protocol.registerProtocol("https", new Protocol("https", (ProtocolSocketFactory) new
String uri = "https://" + baseURL + "/vCenter-CB/api/billingPolicy";
try {
} finally {
}
}

Retrieve List of Hierarchies

Typically, you create new hierarchies in vCenter Chargeback whenever new customer accounts are created 
and schedule reports to track resource usage for these accounts. To retrieve a list of hierarchies based on their 
names or on the time of their creation, you can use the Search API.
To retrieve a list of hierarchies
1
Call the Search API by using the following URL in your program.
POST <API base URL>/search
2
In the request XML, use the following search criteria to get the hierarchy by name. 
<Criteria type="AND">
<Filter name="hierarchyName" type="EQUAL" value="TestHierarchy" />
</Criteria>
For more information on all the available search filters, refer vCenter Chargeback API Reference Guide. 
The following is an example request XML.
<?xml version="1.0" encoding="UTF-8"?>
<Request>
<SearchQueries>
<SearchQuery id="hierarchy">
</SearchQuery>
</SearchQueries>
</Request>
If the operation is successful, the response XML provides details of the retrieved hierarchies.
28
FakeSSLCertificateSocketFactory(), 443));
post = new PostMethod(uri);
post.setRequestBody(bodyString);
client.executeMethod(post);
System.out.println(post.getResponseBodyAsString());
if (post != null) {
post.releaseConnection();
}
<Criteria type="AND">
<Filter name="name" type="LIKE" value="%hierarchy1%" />
<Filter name="desc" type="LIKE" value="%hierarchyDesc1%" />
<Filter name="createdOn" type="BETWEEN" from="1230748200000"
to="1295548200000"/>
</Criteria>
<SortBy>
<Params>
<Param index="1" order="DESC">createdOn</Param>
</Params>
</SortBy>
<Pagination>
<FirstResultCount>0</FirstResultCount>
<MaxResultCount>100</MaxResultCount>
</Pagination>
VMware, Inc.

Advertisement

Table of Contents
loading

Table of Contents