Get Rate Factors

This API enables you to retrieve the rate factors that are set on a specific entity in the cost model for a given period of time.

Syntax

The syntax for calling this method is:

GET <Base_Url>/costModel/{costModelId}/rateFactors

A sample API call is as follows:

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

User Privilege

You must have a role with read privilege on the hierarchy and the cost model.

URL Parameters

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 rate factors 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 rate factors are to be retrieved.  If this is not specified, the rate factors will be effective without an end time. If specified, this parameter must be specified after the start-time. 1232649000000

hierarchyId

Integer

Required

Chargeback hierarchy for whose entity these rate factors are to be retrieved. 1

entityId

Integer

Required

Chargeback entity for which rate factors are to be retrieved. 11

API Response

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

XPath

Type

Min Occurs

Max Occurs

Description

RateFactors/RateFactor

0

unbounded

Represents the rate factors set on a specific entity in the cost model for a given period of time.

RateFactors/RateFactor/ComputingResource

1

1

Represents the computing resource on which the rate factor is set.

RateFactors/RateFactor/ComputingResource/@Id

xs:int

1

1

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

RateFactors/RateFactor/ComputingResource/Name

xs:string

1

1

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

RateFactors/RateFactor/Value

xs:double

1

n

The value of the rate factor set for the computing resource.

RateFactors/RateFactor/StartTime

xs:long

1

1

The start time of the duration for which the rate factor is set.

RateFactors/RateFactor/EndTime

xs:long

1

1

The end time of the duration for which the rate factor is set.

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_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.