Get Allocation Details of an Entity

The API retrieves the allocation details of an entity in the hierarchy.

Syntax

The syntax for calling this method is:

GET <Base_Url>/hierarchy/{hierarchyId}/entity/{entityId}/allocations

A sample API call is as follows:

GET https://123.123.123.123/vCenter-CB/api/hierarchy/1/entity/51/allocations

User Privilege

To call this API, you should have Read privilege on the hierarchy and the entity.

URL Parameters

Name

Data Type

Required/Optional

Description

Sample Value

startTime

Long

Required

Start time (in milliseconds, from January 1, 1970 GMT 00:00) of the time period for which you want to retrieve the allocation details.

1232562600000

endTime

Long

Optional

End time (in milliseconds, from January 1, 1970 GMT 00:00) of the time period for which you want to retrieve the allocation details.  If this is not specified, the API retrieves allocation details for an infinite time period from the specified start time. If specified, this parameter must be specified as later than the start time.

1232649000000

Request Body Parameters

This API does not require a request XML.

API Response

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 to which the 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 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. As the synchronization cannot be turned off, this value is always set to true.

Hierarchies/Hierarchy/LastUpdatedTime

xs:long

1

1

Time when the Chargeback hierarchy was last updated.

Hierarchies/Hierarchy/LastUpdatedUser

xs:string

1

1

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

unbounded

Represents each element in the hierarchy.

Hierarchies/Hierarchy/Entities/Entity/@id

xs:int

1

1

ID of the entity.

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 entity types, see Chargeback EntityTypes.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share

 

1

1

Represents the share of the entity element with its parent.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share/Percentage

xs:int

1

1

Shared percentage of the entity.

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 not have a parent and hence, the value is always -1.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share/StartTime

xs:long

0

1

Time at which the entity is added to the parent.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation

 

0

n

Represents allocation details for each computing resource in the entity.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation /ComputingResource/@id

xs:int

1

1

ID of the computing resource for which the API has retrieved the allocation details. For a list of supported computing resources, see the Appendix.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation/ComputingResource/Name

xs:string

1

1

Name of the computing resource.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation/Values/Value

 

1

n

Represents each allocation value set for a computing resource.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation /Values/Value/AllocationValue

xs:double

1

1

Allocation value set for the computing resource for a duration on this entity.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation/Values/Value/StartTime

xs:long

1

1

Start time of the period for which the allocation value is set on this entity.

Hierarchies/Hierarchy/Entities/Entity/Allocations/Allocation/Values/Value/EndTime

xs:long

1

1

End time of the period for which the allocation value is set on this entity.

Will be empty if the allocation value is set for an infinite period from the start time.

A sample response is provided here.

Error Response

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

Error Code

Description

VCB_ERR_INVALID_ENTITY_ID

Specified entity is not found in the hierarchy.

VCB_ERR_INVALID_TIME_PERIOD

Start date is not specified or is specified as later than the end date.