VMware Cloud Community
Savita
Contributor
Contributor

vCenter Chargeback java API : QueuedTaskImpl.generateReport

Hello,

I am trying to generate some sample reports throgh  QueuedTaskImpl.generateReport method but no sure how to pass resourceIds, entityCostModelMap etc.

Example given is using XMLReader calss to get these values but its expecting xml files to be at right place. I am not sure how I need to provide these xmls (may be suing REST API call !)

If some one can share an example thast would be a great help.

Thanks in advacnce.

-Savita

0 Kudos
1 Reply
divyag
Contributor
Contributor

Hi,

The xmls which XMLReader class is expecting should be present at the location com.vmware.resource package.

So, what you can do is :

Go to the samples folder in your CB-SDK zip file.

Create a folder named ‘resource’ (if not present) at the location samples\src\com\vmware which contains those xmls named resource.xml and EntityCostModel.xml.

Attached are the xmls for your reference.

Resource.xml contains ids of all the computing resources. Ex:

<?xml version="1.0" encoding="UTF-8"?>

<Resources>

<Resource id="1"/>

<Resource id="2"/>

<Resource id="5"/>

<Resource id="6"/>

<Resource id="8"/>

<Resource id="9"/>

<Resource id="10"/>

</Resources>

EntityCostModel.xml contains entity id for which report to be generated and the costModel Id to be used.

<?xml version="1.0" encoding="UTF-8"?>

<Entities>

<Entity id="980" costModelId="603"/>

<Entity id="604" costModelId="603"/>

</Entities>

Please  try this and let me know how it goes.

Regards,

Divya