The mapping of the vCenter Chargeback Manager 2.0 plug-in API classes corresponds to the vCenter Chargeback Manager SDK for Java 2.0 class mapping. For reference about classes and methods, see http://communities.vmware.com/community/vmtn/developer/forums/cbmsdkjava
Unfortunately, the mapping does not seem complete. I cannot for the life of me find a sequence of API calls that would allow me to recursively browse through the entity hierarchy.
I'm able to retrieve the top level "hierarchy" entries (getAllHierarchies Action), then retrieve the entity ID of the "root" below each of those (getRootEntityIdByHierarchyId).
I'm also able to retrieve any item by name underneath a hierarchy (getEntityIdByHierarchyId) but that begs the question of how I would know the name of an entity. (I tried some wildcards, but nothing seemed to work)
Question: GIven an entity ID, how do I get the entity object so I can get its name?
Question: Given an entity, how do I get the children of that entity (either as a list of objects or ids).
Also, there are errors/inconsistencies in the API documentation/browswer (examples available upon request).
And while I'm whingeing, the Java API documentation isn't much better. It's mostly just generated from the source code with very little additional commentary. The source code itself looks like it was generated with a code generator from the REST API (full of Interfaces, Implementations, and XxxxType objects). A more "business level" wrapper around the raw REST API wrapper classes would have been nice.
There's some sample code that comes with the Java API download. One of the sample programs (HierarchyEntityTest) contains this line:
parentId = hierarchy.getHierarchyTypeObj().getEntities().getEntity().get(0).getId();
with no explanation.
Note that I've written some (Groovy) code to do this using the raw REST API myself and it works like a charm. I'm just trying to re-write it to use the VCO plugin, so it's easier to maintain.
Help! Thanks in advance.
I am not sure by Entity ID u mean the ID assign to it by ChargeBack or vCenter. ID assign to to by vCenter is set as attribute "vCloudEntityId". You can check the valuse of this attribute to figure out the name of Entity.
By "Entity ID" I mean the entity ID assigned by chargeback.
You're entirely correct that the vCloudEntityId attribute contains the VCD ID, however, that doesn't help either of my problems: