The API enables you to browse a hierarchy. The API returns the root entity of the hierarchy. If you want to further browse, use the Browse Entity of a Hierarchy API.
The syntax for calling this method is:
GET <Base URL>/hierarchy/{hierarchyId}/browse
A sample API call is as follows:
GET https://123.123.123.123/vCenter-CB/api/hierarchy/1/browse
You must have a role with the Read privilege on the hierarchy you want to browse.
This API does not need a request XML.
If the operation is successful, the API gets an XML response with the following details.
XPath |
Type |
Min Occurs |
Max Occurs |
Description |
---|---|---|---|---|
Hierarchies/Hierarchy |
|
1 |
1 |
Represents the hierarchy element that is retrieved. |
Hierarchies/Hierarchy/@id |
xs:int |
1 |
1 |
ID of the hierarchy. |
Hierarchies/Hierarchy/Name |
xs:string |
1 |
1 |
Name of the hierarchy. |
Hierarchies/Hierarchy/Description |
xs:string |
1 |
1 |
Description of the hierarchy. |
Hierarchies/Hierarchy/CreatedOn |
xs:long |
1 |
1 |
Time, in milliseconds, when the hierarchy was created. |
Hierarchies/Hierarchy/InSync |
xs:boolean |
1 |
1 |
Indicates if the Chargeback hierarchy is synchronized with the vCenter Server hierarchy. Because the synchronization cannot be turned off, this value is always set to true. |
Hierarchies/Hierarchy/LastUpdatedTime |
xs:long |
1 |
1 |
Indicates the time when the Chargeback hierarchy was last updated. |
Hierarchies/Hierarchy/LastUpdatedUser |
xs:string |
1 |
1 |
Indicates the user who last updated the Chargeback hierarchy. If the hierarchy is automatically updated because of changes in the vCenter Server hierarchy, the user name is 'CBM Server'. |
Hierarchies/Hierarchy/Entities/Entity |
|
1 |
1 |
Represents each entity element that is created. |
Hierarchies/Hierarchy/Entities/Entity/@id |
xs:int |
1 |
1 |
ID of the entity in the hierarchy. |
Hierarchies/Hierarchy/Entities/Entity/Name |
xs:string |
1 |
1 |
Name of the entity. |
Hierarchies/Hierarchy/Entities/Entity/Description |
xs:string |
1 |
1 |
Description of the entity. |
Hierarchies/Hierarchy/Entities/Entity/Type |
xs:int |
1 |
1 |
Type of the entity. For more information on various entity types, see Chargeback Entity Types. |
Hierarchies/Hierarchy/Entities/Entity/ChildrenCount |
xs:int |
1 |
1 |
Indicates the number of immediate child entities. |
Hierarchies/Hierarchy/Entities/Entity/Shares/Share |
|
1 |
1 |
Represents the share of the root entity element with its parent. |
Hierarchies/Hierarchy/Entities/Entity/Shares/Share/Percentage |
xs:int |
1 |
1 |
The share percentage of the entity. The root element is never shared. Hence, the sharing percentage is always 100%. |
Hierarchies/Hierarchy/Entities/Entity/Shares/Share/Parent/@id |
xs:int |
1 |
1 |
ID of the parent entity. If this is a root entity, it will not have a parent. Hence, the value is always -1. |
Hierarchies/Hierarchy/Entities/Entity/Shares/Share/StartTime |
xs:long |
1 |
1 |
Time, in milliseconds, when the entity was added to the parent. Will always be zero for the root entity. |
A sample response is provided here.
The following table explains the error codes displayed by the API.
Error Code |
Description |
VCB_ERR_INVALID_HIERARCHY_ID |
Hierarchy with the specified ID is not found. |