Get Guest Operating System Costs Set to a Cost Model

This API retrieves costs associated with guest operating systems for  auto-costing in the given cost model. 

The response XML includes all the operating system names found by querying vCenter server inventory as well as the operating systems specified for the cost model by the user.  If costModelId is not specified in the query, the API does not return user-defined operating systems and the fixed costs associated with any operating system. It returns only the operating system names found by querying the vCenter inventory. Note that auto-costing is enabled only on the exact match of operating system name in this list and the one found in vCenter Server inventory.

Syntax

The syntax for calling this method is:

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

A sample API call is as follows:

GET https://123.123.123.123/vCenter-CB/api/costModel/5/guestOperatingSystems

User Privilege

You must have Read privilege on the cost model.

URL Parameters

Name

Data Type

Required/Optional

Description

Sample Value

costModelId

Integer

Required

ID of the cost model.

1

startTime

Long

Required

Start-time (in milliseconds; from January 1, 1970 GMT 00:00) for the time period for which the fixed costs are to be modified.

1232562600000

endTime

Long

Optional

End-time (in milliseconds; from January 1, 1970 GMT 00:00) for the time period for which the fixed costs are to be modified.  If this is not specified, the API modifies all the fixed costs specified in the request XML. If specified, this parameter must not fall before start-time.

1232649000000

Request Body Parameters

This API does not need any request parameters.

Response Type

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

XPath

Type

Min Occurs

Max Occurs

Description

GuestOperatingSystems/GuestOperatingSystem

0

unbounded

Represents the guest operating system for which the API has retrieved the costs.

GuestOperatingSystems/GuestOperatingSystem/Name

xs:string

1

1

Name of the guest operating system

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost

1

unbounded

Represents the fixed cost applied to the guest operating system

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/@id

xs:int

1

1

ID of the fixed cost applied to the guest operating system

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Name

xs:string

1

1

Name of the fixed cost

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Description

xs:string

1

1

Description of the fixed cost 

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Type

1

1

Represents the type of fixed cost.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Type/@id

xs:int

1

1

Type of fixed cost

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Type/Name

xs:string

1

1

Name of the type of fixed cost: One time or recurring

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Currency

1

1

Represents the currency of the fixed cost.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Currency/@id

xs:int

1

1

ID of the currency of the fixed cost

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Currency/Name

xs:string

1

1

Name of the currency of the fixed cost 

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Values/Value

0

unbounded

Represents the value of the fixed cost.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Values/Value/Cost

xs:double

1

1

Value of the fixed cost.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Values/Value/Duration

1

1

Represents the duration for which this fixed cost value is effective.

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

xs:int

1

1

Duration for which this fixed cost value is effective.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Values/Value/Duration/Name

xs:string

1

1

Duration for which this fixed cost value is effective.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Values/Value/StartTime

xs:long

1

1

Start time of a duration for which a specific fixed cost value was effective.

GuestOperatingSystems/GuestOperatingSystem/FixedCosts/FixedCost/Values/Value/EndTime

xs:long

1

1

End time of a duration for which a specific fixed cost value was effective. If not specified, the value will be effective without an end time.

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.