This API enables you to change the name and description of a specified cost model. The API modifies the existing name and description with the name and description in the new request.
The syntax for calling this method is:
PUT <Base_Url>/costModel/{costModelId}
A sample API call is as follows:
PUT https://123.123.123.123/vCenter-CB/api/costModel/999
You must have a role with Update privilege on the cost model.
The API takes a request XML that includes the following body parameters.
XPath |
Type |
Min Occurs |
Max occurs |
Description |
---|---|---|---|---|
CostModels/CostModel |
1 |
1 |
Represents the cost model that you want to modify. |
|
CostModels/CostModel/Name |
xs:string |
1 |
1 |
Name of the cost model that you want to modify. The cost |
CostModels/CostModel/Description |
xs:string |
0 |
1 |
An optional description of the cost model. The description must not exceed |
A sample request XML is provided here.
The API returns an XML response with the following details.
XPath |
Type |
Min Occurs |
Max occurs |
Description |
---|---|---|---|---|
CostModels/CostModel |
1 |
1 |
Represents the cost model that is modified. |
|
CostModels/CostModel/@Id |
xs:int |
1 |
1 |
ID of the cost model that is modified. |
CostModels/CostModel/Name |
xs:string |
1 |
1 |
Name of the cost model that is modified. |
CostModels/CostModel/Description |
xs:string |
1 |
1 |
An optional description of the cost model. |
CostModels/CostModel/Currency |
1 |
1 |
Represents the currency set for this cost model. |
|
CostModels/CostModel/Currency/@id |
xs:int |
1 |
1 |
ID of the currency set for this cost model. |
CostModels/CostModel/Currency/Name |
xs:string |
1 |
1 |
Name of the currency set for this cost model. |
A sample response is provided here.
The following table explains the error codes displayed by the API.
Error Code |
Description |
VCB_ERR_INVALID_COST_MODEL_NAME |
Cost model name is not unique, not specified, or has more than 255 characters. |
VCB_ERR_INVALID_COST_MODEL_DESCRIPTION |
Cost model description contains more than 512 characters. |