Apply Fixed Cost on vService

This API enables you to apply a fixed cost on a given vService and a cost model.  If you call the API without specifying a fixed cost, any existing fixed cost set on the vService in the cost model will be removed.

Syntax

The syntax for calling this method is:

PUT <Base_Url>/costModel/{costModelId}/vServices

A sample API call is as follows:

PUT https://123.123.123.123/vCenter-CB/api/costModel/20/vServices

User Privilege

You must have Update privilege on the cost model.

URL Parameters

Name

Data Type

Required/Optional

Description

Sample Value

costModelId

Integer

Required

ID of the cost model for which the vService cost will be applied.

1

fixedCostId

Integer

Optional

ID of the fixed cost to be applied to vService.  If this is not specified, any existing fixed cost set for the vService in the cost model will be removed.

21

Request Body Parameters

The request XML for this API includes the following parameters.

XPath

Type

Min Occurs

Max Occurs

Description

VServices/VService

1

unbounded

Represents the vService to which fixed cost has to be applied.

VServices/VService/@id

xs:int

1

1

ID of the vService to which fixed cost has to be applied.

VServices/VService/Name

xs:string

1

1

Name of the vService to which you want to apply the fixed cost.

VServices/VService/FixedCosts/FixedCost

1

1

Represents the fixed cost to be applied to the vService.

VServices/VService/FixedCosts/FixedCost/@id

xs:int

1

1

ID of the fixed cost to be applied to the vService.

A sample request is provided here.

Response Type

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

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

The specified Cost Model ID is invalid.

VCB_ERR_INVALID_FIXED_COST_ID

The specified Fixed Cost ID is invalid.