2.5

VMware, Inc. 35
Chapter 3 Using vCenter Chargeback Manager with a Billing System
System.out.println(post.getResponseBodyAsString());
} finally {
if (post != null) {
post.releaseConnection();
}
}
}
Reschedule a Report
YoucanupdateareportscheduleusingtheRescheduleReportAPI.TheRescheduleReportAPIupdatesthe
scheduleinformation.Ifyouwanttoupdatetheentitytopricingmodelmapping,youmustdeletethe
scheduleandcreateanewschedule.
To reschedule a report
1 CalltheRescheduleReportAPIbyusingthefollowingURLin
yourprogram.
PUT <API base URL>/reportSchedule/{scheduleId}
Forexample,
PUT https://123.123.123.123/vCenter-CB/api/reportSchedule/5
ThefollowingisanexamplerequestXML.
<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="http://www.vmware.com/vcenter/chargeback/2.0">
<ReportSchedules>
<ReportSchedule>
<MetaData>
<ReportPeriodType>DAILY</ReportPeriodType>
<ReportPeriod>
<Daily>
<DaysBefore>1</DaysBefore>
</Daily></ReportPeriod>
</MetaData>
<ScheduleDetail>
<FireTime>
<Hour>13</Hour>
<Minute>59</Minute>
</FireTime>
<Recurrence type="DAILY">
<RepeatInterval>1</RepeatInterval>
</Recurrence>
<Range>
<StartDate>1321295400000</StartDate>
<Count>-1</Count>
</Range>
</ScheduleDetail>
</ReportSchedule>
</ReportSchedules>
</Request>
ThefollowingisanexampleprogramthatcallstheAPI.ThisprogramassumesthattherequestXMLis
populatedwiththerequiredinformation.
/**
* This method Re-schedule report in vCenter-ChargeBack
*
* @param requestFilePath
* @param baseURL
* @param scheduleId
* @throws IOException
* @throws HttpException
* @throws NoSuchAlgorithmException
* @throws KeyManagementException
* @throws JDOMException
*/