Delete Entity

This API enables you to delete an entity and its child entities from a hierarchy.

Syntax

DELETE <Base URL>/hierarchy/{hierarchyId}/entity/{entityId}

A sample API call is as follows:

DELETE https://123.123.123.123/vCenter-CB/api/hierarchy/1/entity/11

User Privilege

To call this API, you must have a role with Read privilege on the hierarchy and Delete privilege on the entity.

API Response

If the operation is successful, the API returns an XML response with the following details.

XPath

Type

Min Occurs

Max Occurs

Description

Hierarchies/Hierarchy

 

1

1

Represents the hierarchy element to which the deleted entity belongs.

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.

Error Response

The following table explains the error codes returned by the API.

Error code

Description

VCB_ERR_INVALID_ENTITY_ID

Returned if the entity that is being removed is not found.

VCB_ERR_SHARED_ENTITY

If the entity that is being removed is shared or the entity's children are shared.

VCB_ERR_ROOT_ENTITY

If an entity is a root entity.

VCB_ERR_VC_ENTITY_CHILD

If any of the children of a vCenter entity is being removed.