This API enables you to modify the name and description of a hierarchy.
The syntax for calling this method is:
PUT <Base URL>/hierarchy/{hierarchyId}
A sample API call is as follows:
PUT https://123.123.123.123/vCenter-CB/api/hierarchy/1
You must have a role with the Update privilege on the hierarchy that you want to modify.
The API takes a request XML that captures the following body parameters.
XPath |
Type |
Min Occurs |
Max Occurs |
Description |
---|---|---|---|---|
Hierarchies/Hierarchy |
|
1 |
1 |
Represents the hierarchy element. |
Hierarchies/Hierarchy/Name |
xs:string |
0 |
1 |
Name of the hierarchy. The character limit for the hierarchy name is 255 characters. The hierarchy names are not case sensitive. |
Hierarchies/Hierarchy/Description |
xs:string |
0 |
1 |
Description for the hierarchy. The character limit for the description is 512 characters. |
A sample request XML is provided here.
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. |
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 provided for 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'. |
A sample response is provided here.
The following table explains the error codes returned by the API.
Error code |
Description |
VCB_ERR_INVALID_HIERARCHY_ID |
Returned if the specified hierarchy is not found. |
VCB_ERR_INVALID_HIERARCHY_NAME |
Returned
|
VCB_ERR_INVALID_HIERARCHY_DESCRIPTION |
Returned if the hierarchy description exceeds 512 characters. |
VCB_ERR_HIERARCHY_NAME_ALREADY_EXISTS |
Returned if a hierarchy with the given name exists. |