Modify Fixed Cost Value

This API enables you to set the value of a fixed cost for a given time period.

Syntax

The syntax for calling this method is:

PUT <Base_Url>/fixedCost/{fixedCostId}/values

A sample API call is as follows:

PUT https://123.123.123.123/vCenter-CB/api/fixedCost/9/values

User Privilege

You must have a role with Update privilege on the fixed cost.

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 fixed cost value is to be modified.

1232562600000

endTime

Long

Optional

End time (in milliseconds; from January 1, 1970 GMT 00:00) of the time period for which the fixed cost value is to be modified.  If this is not specified, the API modifies the fixed cost values from the specified start time. If specified, this parameter must be specified after the start-time.

1232649000000

Request Body Parameters

This API takes an XML request that captures the following details.

XPath

Type

Min Occurs

Max Occurs

Description

FixedCosts/FixedCost

Represents the fixed cost.

FixedCosts/FixedCost/@id

xs:int

1

1

ID of the fixed cost

FixedCosts/FixedCost/Values/Value

 

 

 

Represents the value of the fixed cost.

FixedCosts/FixedCost/Values/Value/Cost

xs:double

1

1

Value of the fixed cost.

FixedCosts/FixedCost/Values/Value/Duration/@id

xs:int

1

1

Duration of the fixed cost. For a list of supported durations, see Appendix.

A sample request XML is provided here.

API Response

The API returns a response XML that indicates the status of the operation.

A sample response is provided here.

Error Response

The API displays errors if inputs are incorrect or if the operation is unsuccessful for any reason. The following table explains the error codes displayed by the API.

Error Code

Description

VCB_ERR_INVALID_FIXED_COST_ID

Fixed cost ID is invalid.

VCB_ERR_INVALID_TIME_PERIOD

Start-date is not specified or it is specified after the end-date.

VCB_ERR_INVALID_FIXED_COST_VALUE

Fixed cost value is invalid.

VCB_ERR_INVALID_DURATION_ID

Duration ID referring to daily, weekly, and so on, is invalid.