Modify Computing Resource

This API enables you to modify a computing resource with the specified ID.

Syntax

The syntax for calling this method is:

PUT <Base_Url>/computingResource/{computingResourceId}

A sample API call is as follows:

PUT https://123.123.123.123/vCenter-CB/api/computingResource/15

User Privilege Required

You must have the Super User role.

Request Body Parameters

The request XML for this API contains the parameters described in the following table.

XPath

Type

Min Occurs

Max occurs

Description

ComputingResources/ComputingResource/Name

xs:string

1

1

Name of the computing resource that you want to modify. The computing resource name must be unique and not exceed 255 characters. The name must contain only alphanumeric characters and can contain spaces.

ComputingResources/ComputingResource/Description

xs:string

0

1

An optional description of the computing resource. The description must not exceed
512 characters.

ComputingResources/ComputingResource/Unit

xs:string

1

1

Unit in which the computing resource is measured.

ComputingResources/ComputingResource/Enabled

xs:boolean

0

1

Specifies whether the computing resource is enabled in vCenter Chargeback Manager. Default value is true.

ComputingResources/ComputingResource/Attributes/Attribute

 

1

unbounded

Attributes based on which the computing resource will be calculated.

ComputingResources/ComputingResource/Attributes/Attribute/Name

xs:string

1

1

Name of the attribute based on which the computing resource will be calculated. For custom computing resources, only ‘allocation’ is supported.

A sample request XML is provided here.

API Response

If the operation is successful, the API returns an XML that provides the following details of the modified computing resource.

XPath

Type

Min Occurs

Max occurs

Description

ComputingResources/ComputingResource/@Id

xs:long

1

1

ID of the modified computing resource.

ComputingResources/ComputingResource/Name

xs:string

1

1

Name of the modified computing resource.

ComputingResources/ComputingResource/Description

xs:string

1

1

Description of the modified computing resource.

ComputingResources/ComputingResource/Unit

xs:string

1

1

Unit in which the computer resource is measured.

ComputingResources/ComputingResource/RollUpType

xs:string

0

1

Based on this field, vCenter Chargeback Manager decides the computation method for the computing resource. In this release, this is not a user modifiable parameter. Possible values are: Average and empty(computation is based upon Timed Average of usage); Sum(Computation is based upon summation of usage)

ComputingResources/ComputingResource/Attributes/Attribute

1

unbounded

Attributes that were modified for the computing resource.

ComputingResources/ComputingResource/Attributes/Attribute/Name

xs:string

1

1

Name of the attribute modified for the computing resource.

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_COMPUTING_RESOURCE_NAME

Computing resource name is not specified or the name contains more than 255 characters.

VCB_ERR_INVALID_COMPUTING_RESOURCE_DESCRIPTION

Computing resource description is specified and contains more than 512 characters.

VCB_ERR_INVALID_COMPUTING_RESOURCE_UNIT

Computing Resource Unit is not specified or contains more than 255 characters.

COMPUTING_RESOURCE_ALREADY_EXISTS_NAME

The computing resource name specified already exists.

VCB_ERR_INVALID_COMPUTING_RESOURCE_ATTRIBUTE

Attribute name is not specified or the name contains more than 255 characters.

VCB_ERR_INVALID_COMPUTING_RESOURCE_ID

The computing resource with the given id does not exist. System computing resources cannot be modified.