Get Cost Template

This API enables you to get details of a specified cost template.

Syntax

The syntax for calling this method is:

GET <Base_Url>/costTemplate/{costTemplateId}

A sample API call is as follows:

GET https://123.123.123.123/vCenter-CB/api/costTemplate/15

User Privilege

You must have a role with Read privilege on the cost template.

Request Body Parameters

This API does not need any request parameters.

API Response

The API returns a response XML that provides the following details of the cost template.

XPath

Type

Min Occurs

Max Occurs

Description

CostTemplates/CostTemplate

1

1

Represents the cost template.

CostTemplates/CostTemplate/@id

xs:int

1

1

ID of the cost template.

CostTemplates/CostTemplate/Name

xs:string

1

1

Name of the cost template

CostTemplates/CostTemplate/Description

xs:string

0

1

A brief description of the cost template.

CostTemplates/CostTemplate/Currency

1

1

Represents the currency set for this cost template

CostTemplates/CostTemplate/Currency/@id

xs:int

1

1

ID of the currency

CostTemplates/CostTemplate/RateFactors/RateFactor

1

unbounded

Represents the rate factor to be set.

CostTemplates/CostTemplate/RateFactors/RateFactor/ComputingResource

1

1

Represents ID of the computing resource for which the rate factor is set.

CostTemplates/CostTemplate/RateFactors/RateFactor/ComputingResource/@id

xs:int

1

1

ID of the computing resource for which the rate factor is set.

CostTemplates/CostTemplate/RateFactors/RateFactor/ComputingResource/Name

xs:string

1

1

Name of the computing resource for which the rate factor is set.

CostTemplates/CostTemplate/RateFactors/RateFactor/Value

xs:double

1

1

The rate factor applied to the computing resource.

CostTemplates/CostTemplate/FixedCosts/FixedCost

1

unbounded

Represents the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/@id

xs:int

1

1

ID of the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Name

xs:string

1

1

Name of the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Description

xs:string

1

1

Description of the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Type

1

1

Represents the fixed cost type.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Type/@id

xs:int

1

1

ID of the fixed cost type.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Type/Name

xs:string

1

1

Name of the fixed cost type.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Currency

1

1

Represents the currency set for the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Currency/@id

xs:int

1

1

ID of the currency set for the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Currency/Name

xs:string

1

1

Name of the currency set for the fixed cost.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Propagate

xs:boolean

1

1

Indicates whether the fixed cost value is propagated to the child entities. If the value is false, the fixed cost is applied only on the entity. If the value is true, the fixed cost is applied on the descendents of the entity.

CostTemplates/CostTemplate/FixedCosts/FixedCost/Depth

xs:int

0

1

Specifies how deep in the tree fixed cost is propagated. For example, if the depth is set to 2, then the fixed cost is applied on the children and grand children of the entity. 0 indicates any depth.

CostTemplates/CostTemplate/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.

Error Response

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

Error Code

Description

VCB_ERR_INVALID_COST_TEMPLATE_ID

Cost template ID is invalid.