This API enables you to retrieve the global fixed costs for a specific entity in a cost model for a given time period.
The syntax for calling this method is:
GET <Base_Url>/costModel/{costModelId}/fixedCosts
A sample API call is as follows:
GET https://123.123.123.123/vCenter-CB/api/costModel/9/fixedCosts
You must have Read privilege on cost model, hierarchy and entity.
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 the fixed costs are to be retrieved. |
1232562600000 |
endTime |
Long |
Optional |
End time (in milliseconds; from January 1, 1970 GMT 00:00) of the time period for which the fixed costs are to be retrieved. If this is not specified, the API returns all fixed costs from the specified start time. This parameter must be specified as later than the start time. |
1232649000000 |
hierarchyId |
Integer | Required | ID of the Chargeback hierarchy for whose entity you want to retrieve the fixed costs. |
10 |
entityId |
Integer | Required | Chargeback entity for which you want to retrieve the fixed costs . |
1 |
This API does not require any request parameters.
The API returns the following details of the fixed costs for the entity.
XPath |
Type |
Min Occurs |
Max Occurs |
Description |
---|---|---|---|---|
Fixed Costs/FixedCost |
|
0 |
unbounded |
Represents the fixed cost. |
Fixed Costs/FixedCost/@id |
xs:int |
1 |
1 |
ID of the fixed cost. |
Fixed Costs/FixedCost/Name |
xs:string |
1 |
1 |
Name of the fixed cost. |
Fixed Costs/FixedCost/Description |
xs:string |
1 |
1 |
A brief description of the fixed cost. |
Fixed Costs/FixedCost/Type |
|
1 |
1 |
Represents the fixed cost type. |
Fixed Costs/FixedCost/Type/@id |
xs:int |
1 |
1 |
ID of the fixed cost type. |
Fixed Costs/FixedCost/Type/Name |
xs:string |
1 |
1 |
Name of the fixed cost type. |
Fixed Costs/FixedCost/Currency |
|
1 |
1 |
Represents the currency set for this fixed cost. |
Fixed Costs/FixedCost/Currency/@id |
xs:int |
1 |
1 |
ID of the currency set for this fixed cost. |
Fixed Costs/FixedCost/Currency/Name |
xs:string |
1 |
1 |
Name of the currency set for this fixed cost. |
Fixed Costs/FixedCost/Values/Value/Cost |
xs:double |
1 |
1 |
Value of the fixed cost. |
Fixed Costs/FixedCost/Values/Value/Duration/@id |
xs:int |
1 |
1 |
ID of the duration for which this fixed cost value will be effective. See Appendix for a list of all supported Durations. |
Fixed Costs/FixedCost/Values/Value/Duration/Name |
xs:string |
1 |
1 |
Name of the duration for which this fixed cost is effective. |
Fixed Costs/FixedCost/Values/Value/StartTime |
xs:long |
1 |
1 |
The start time of a duration for which a specific fixed cost value was effective. |
Fixed Costs/FixedCost/Values/Value/EndTime |
xs:long |
1 |
1 |
The end time of a duration for which a specific fixed cost value was effective. If not specified, the value will be effective without an end time. |
Fixed Costs/FixedCost/StartTime |
xs:long |
1 |
1 |
Start time of a duration for which a fixed cost will be applied on an entity. |
Fixed Costs/FixedCost/EndTime |
xs:long |
1 |
1 |
End time of a duration for which a fixed cost will be applied on an entity. |
Fixed Costs/FixedCost/Propagate |
xs:boolean |
1 |
1 |
Indicates if the fixed cost is propagated to the child entities. If the value is false, the fixed cost is applied only to the entity. If the value is true, the fixed cost is applied on the descendents of the entity. |
FixedCosts/FixedCost/Depth |
xs:int |
0 |
1 |
Indicates how deep in the tree the fixed cost is propagated. For example, if depth is set to 2, then the fixed cost is applied to the children and grand children of the entity. 0 indicates any depth. |
FixedCosts/FixedCost/EntityTypeIdFilter |
xs:int |
0 |
1 |
Specifies the filter on entity type for which propagated fixed cost should be applied. Default value is -1. For example, if you apply a propagated fixed cost at a hierarchy level and choose entity type id as 0, then the fixed cost will be applied only on the virtual machines in the hierarchy. -1 signifies any entity type.. |
A sample response is provided here.
The following table explains the error codes displayed by the API.
Error Code |
Description |
VCB_ERR_INVALID_COST_MODEL_ID |
Cost model ID is invalid. |
VCB_ERR_INVALID_HIERARCHY_ID |
Hierarchy ID is invalid. |
VCB_ERR_INVALID_ENTITY_ID |
Entity ID is invalid. |
VCB_ERR_INVALID_TIME_PERIOD |
Start date is not specified or is specified as later than the end date. |