Get Cost Model

This API enables you to get the details of a specific cost model. Details include the ID, name, description, and the currency set for the cost model.

Syntax

The syntax for calling this API is:

GET <Base_Url>/costModel/{costModelId}

A sample API call is as follows:

GET https://123.123.123.123/vCenter-CB/api/costModel/999

User Privilege

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

Request Body Parameters

This API does not require any request parameters.

API Response

The API, on successful execution, returns a response XML with the following details.

XPath

Type

Min Occurs

Max occurs

Description

CostModels/CostModel

1

1

Represents the cost model that you want to retrieve.

CostModels/CostModel/@Id

xs:int

1

1

ID of the cost model.

CostModels/CostModel/Name

xs:string

1

1

Name of the cost model.

CostModels/CostModel/Description

xs:string

1

1

An optional description of the cost model.

CostModels/CostModel/Currency

1

1

Represents the currency set for this cost model.

CostModels/CostModel/Currency/@id

xs:int

1

1

ID of the currency set for this cost model. 

CostModels/CostModel/Currency/Name

xs:string

1

1

Name of the currency set for this cost model. 

A sample response XML is provided here.

Error Response

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

Error Code

Description

VCB_ERR_INVALID_COST_MODEL_ID

Cost model ID is invalid.