Modify Fixed Cost

This API enables you to modify the name and description of a fixed cost. The API modifies the existing name and description with the name and description in the new request.

Syntax

The syntax for calling this method is:

PUT <Base_Url>/fixedCost/{fixedCostId}

A sample API call is as follows:

PUT https://123.123.123.123/vCenter-CB/api/fixedCost/7

User Privilege

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

Request Body Parameters

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

XPath

Type

Min Occurs

Max Occurs

Description

FixedCosts/FixedCost

 

 

 

Represents the fixed cost.

FixedCosts/FixedCost/Name

xs:string

1

1

Name of the fixed cost. The name must be unique and not exceed 255 characters.

FixedCosts/FixedCost/Description

xs:string

1

1

An optional description of the fixed cost. The description must not exceed 512 characters.

FixedCosts/FixedCost/IsProrated

xs:boolean

0

1

Represents whether the fixed cost is prorated or not. By default fixed costs are prorated (true). Cannot be used for one-time fixed costs.

FixedCosts/FixedCost/IsPowerStateBased

xs:boolean

0

1

Represents whether power state of the virtual machine is considered while applying the fixed cost. That is, fixed cost will be applied only when the virtual machine is powered on. Default value is false. Cannot be used for one-time fixed costs.

A sample request XML is provided here.

API Response

The API returns the following details of the updated fixed cost.

XPath

Type

Min Occurs

Max Occurs

Description

FixedCosts/FixedCost

1

1

Represents the modified fixed cost.

FixedCosts/FixedCost/@id

xs:int

1

1

ID of the modified fixed cost.

FixedCosts/FixedCost/Name

xs:string

1

1

Name of the modified fixed cost.

FixedCosts/FixedCost/Description

xs:string

1

1

An optional description of the modified fixed cost.

FixedCosts/FixedCost/Currency

1

1

Represents the currency set for this fixed cost.

FixedCosts/FixedCost/Currency/@id

xs:int

1

1

ID of the currency set for this fixed cost.

FixedCosts/FixedCost/Currency/Name

xs:string

1

1

Name of the currency set for this fixed cost.

FixedCosts/FixedCost/IsProrated

xs:boolean

0

1

Represents whether the fixed cost is prorated or not.

FixedCosts/FixedCost/IsPowerStateBased

xs:boolean

0

1

Represents whether power state of the virtual machine is considered while applying the fixed cost. That is, fixed cost will be applied only when the virtual machine is powered on.

FixedCosts/FixedCost/Type

1

1

Represents the fixed cost type

FixedCosts/FixedCost/Type/@id

xs:int

1

1

ID of the fixed cost type.

FixedCosts/FixedCost/Type/Name

xs:string

1

1

Name of the fixed cost type.

FixedCosts/FixedCost/IsDeleted

xs:boolean

1

1

If true, then the fixed cost is deleted and cannot be used for further cost configurations.

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_FIXED_COST_NAME

Fixed cost name is empty, not unique, or contains more than 255 characters.

VCB_ERR_INVALID_FIXED_COST_DESCRIPTION

Fixed cost description is empty or contains more than 512 characters.