Set Billing Policy for a Cost Model

This API enables you to modify the billing policy of a cost model for a specified time period.


Syntax

The syntax for calling this method is:

PUT <Base_Url>/costModel/{costModelId}/billingPolicy/{BillingPolicyId}

A sample API call is as follows:

PUT https://123.123.123.123/vCenter-CB/api/costModel/999/billingPolicy/5

User Privilege

You must have a role with Update privilege on the cost model and Read privilege on the billing policy.

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 policy 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 billing policy is to be modified.  If this is not specified, the API sets the billing policy without an end time. If specified, this parameter must be specified as later than the start time. 1232649000000

Request Body Parameters

This API does not require an input XML.

API Response

The API returns an 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

Cost model ID is invalid.

VCB_ERR_INVALID_BILLING_POLICY_ID

Billing policy ID is invalid.

VCB_ERR_INVALID_TIME_PERIOD

Start date is not specified or is specified as later than the end date.