Get All Cost Models

This API enables you to retrieve the cost models on which you have Read privilege.


Syntax

The syntax for calling this API is:

GET <Base_Url>/costModels

A sample API call is as follows:

GET https://123.123.123.123/vCenter-CB/api/costModels

User Privilege

You must be authenticated with vCenter Chargeback Manager but do not need any special privileges.

URL Parameters

You can provide the following optional parameters with the API call.

Name

Data Type

Required/Optional

Description

Sample Value

currencyId

integer

Optional

ID of the currency

1

Request Body Parameters

This API does not need any request body parameters.

API Response

The API, on successful execution, returns the following details for each cost model.

XPath

Type

Min Occurs

Max occurs

Description

CostModels/CostModel

0

unbounded

Represents the cost model retrieved

CostModels/CostModel/@Id

xs:int

1

1

ID of the cost model retrieved.

CostModels/CostModel/Name

xs:string

1

1

Name of the cost model retrieved.

CostModels/CostModel/Description

xs:string

0

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 is provided here.

Error Response

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

Error Code

Description

VCB_ERR_INVALID_CURRENCY

Currency ID specified in the request XML is not supported.