</ReportSchedule>
</ReportSchedules>
</Request>
If the operation is successful, the response XML provides details of the report schedule.
The following is an example program that calls the API. This program assumes that the request XML is
populated with the required information.
/**
* This method schedules report in vCenter-ChargeBack
*
* @param requestFilePath
* @param baseURL
* @throws IOException
* @throws HttpException
* @throws NoSuchAlgorithmException
* @throws KeyManagementException
* @throws JDOMException
*/
public static void sampleScheduleReport(String requestFilePath, String baseURL) throws
PostMethod post = null;
Document requestDocument = CommonUtil.getXMLDocument(requestFilePath);
String bodyString = CommonUtil.xmlAsString(requestDocument);
HttpClient client = new HttpClient();
Protocol.registerProtocol("https", new Protocol("https", (ProtocolSocketFactory) new
String uri = "https://" + baseURL + "/vCenter-CB/api/reportSchedule";
try {
} finally {
}
}
Get Report Schedule by Hierarchy Name
Depending on how you charge each customer, you might have mapped entities in the hierarchy to appropriate
cost models. You can call the Search API to get the report schedule for the hierarchy and verify the entity to
cost model mappings.
To get schedule by hierarchy name
1
Call the Search API by using the following URL in your program.
POST <API base URL>/search
2
In the request XML, specify the following parameters to search schedules. You can use any of these
parameters alone or in combination with the others.
name
desc
hierarchyName
costModelName
3
You can use search operators such as EQUAL, NOT_EQUAL, BETWEEN, GT, LT, GT_EQUAL, LT_EQUAL,
NULL, NOT_NULL, LIKE, NOT_LIKE to filter your search.
VMware, Inc.
</Email>
HttpException, IOException, KeyManagementException,
NoSuchAlgorithmException, JDOMException {
FakeSSLCertificateSocketFactory(), 443));
post = new PostMethod(uri);
post.setRequestBody(bodyString);
client.executeMethod(post);
System.out.println(post.getResponseBodyAsString());
if (post != null) {
post.releaseConnection();
}
Chapter 3 Using vCenter Chargeback with a Billing System
33