Get All Cost Templates

This API enables you to get a list of cost templates for which you have Read privilege.

Syntax

The syntax for calling this method is:

GET <Base_Url>/costTemplates

A sample API call is as follows:

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

User Privilege

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

URL Parameters

Name

Data Type

Required/Optional

Description

Sample Value

currencyId

int

Optional

ID of the currency

1

Request Parameters

This API does not need any request parameters.

API Response

The API returns a response XML that provides the following information.

XPath

Type

Min Occurs

Max Occurs

Description

CostTemplates/CostTemplate

1

unbounded

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

1

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 set for this cost template. 

CostTemplates/CostTemplate /Currency/Name

xs:string

1

1

Name of the currency set for this cost template.

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

URL parameter specifies an invalid currency ID.