Get Billing Policies Set to a Cost Model

This API enables you to get the billing policies of the cost model for the specified time period.


Syntax

The syntax for calling this method is:

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

A sample API call is as follows:

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

User Privilege

You must have a role with Read privilege on 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 billing policies 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 billing policies are to be retrieved.  If this is not specified, the API returns all billing policies from specified start time. If specified, this parameter must be specified as later than the start-time. 1232649000000

API Response

The API returns the following information.

XPath

Type

Min Occurs

Max occurs

Description

BillingPolicies/BillingPolicy

0

unbounded

Represents the billing policy that is retrieved.

BillingPolicies/BillingPolicy/@Id

xs:int

1

1

The ID of the billing policy retrieved by the API. For a list of all supported billing policy IDs, see Appendix.

BillingPolicies/BillingPolicy/StartTime

xs:long

1

1

The time from which the billing policy is effective.

BillingPolicies/BillingPolicy/EndTime

xs:long

1

1

The time till which the billing policy is effective. If the end time is not specified, the billing policy will be effective

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 code displayed by the API.

Error Code

Description

VCB_ERR_INVALID_COST_MODEL_ID

Cost model ID is invalid.

VCB_ERR_INVALID_TIME_PERIOD

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