Set Attribute Values of an Entity

The API helps you to set the values of specified attributes of an entity in a Chargeback hierarchy.

Syntax

The syntax for calling this method is:

PUT <Base_Url>/hierarchy/{hierarchyId}/entity/{entityId}/attribute

A sample API call is as follows:

PUT https://123.123.123.123/vCenter-CB/api/hierarchy/1/entity/51/attribute

User Privilege

To call this API, you should have a role with Read privilege on the hierarchy and Update privilege on the entity.

Request Body Parameters

The API takes a request XML that captures the following body parameters.

XPath

Type

Min Occurs

Max Occurs

Description

Hierarchies/Hierarchy

 

1

1

Represents the hierarchy to which the entity belongs.

Hierarchies/Hierarchy/@id

xs:int

0

1

ID of the hierarchy.

Hierarchies/Hierarchy/Entities/Entity

 

1

1

Represents the entity you want to modify.

Hierarchies/Hierarchy/Entities/Entity/@id

xs:int

0

1

ID of the entity.

Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute

 

0

unbounded

Represents the attributes of the entity.

Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute/@id

xs:int

1

1

The ID of the attribute

Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute/Value

xs:string

1

1

The value of the attribute specified for the entity. If you want to clear an existing value, specify an empty string.

A sample request XML is provided here.

API Response

The API returns an XML that indicates the status of the operation.

Error Response

The following table explains the error codes returned by the API.

Error Code

Description

VCB_ERR_INVALID_ENTITY_ID

Entity is not found.

VCB_ERR_INVALID_ATTRIBUTE_ID

Attribute is not found.

VCB_ERR_INVALID_VALUE

The length of the value exceeds 4000 characters.