Import vCenter Server Entity Attributes (deprecated)

This API is deprecated in vCenter Chargeback Manager 2.0. Imported vCenter Server attributes are now automatically synchronized by the data collector.

This API enables you to import the latest vCenter entity custom attributes to a Chargeback entity. It retrieves the latest vCenter attributes from the vCenter server and stores the attributes in the Chargeback entity. The API overrides the value, if an attribute with the same name exists for an entity in the Chargeback hierarchy.

Syntax

The syntax for calling this method is:

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

A sample API call is as follows:

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

User Privilege

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

API Response

If the operation is successful, the API gets an XML response with the following details.

XPath

Type

Min Occurs

Max Occurs

Description

Attributes/Attribute

 

0

unbounded

Represents the attributes of the entity

Attributes/Attribute/@id

xs:int

1

1

ID of the attribute.

Attributes/Attribute/Name

xs:string

1

1

Name of the attribute.

Attributes/Attribute/Description

xs:string

1

1

Description provided for the attribute.

Hierarchies/Hierarchy

 

1

1

Represents the hierarchy element to which entity belongs.

Hierarchies/Hierarchy/@id

xs:int

1

1

ID of the hierarchy.

Hierarchies/Hierarchy/Name

xs:string

1

1

Name of the hierarchy.

Hierarchies/Hierarchy/Description

xs:string

1

1

Description provided for the hierarchy.

Hierarchies/Hierarchy/CreatedOn

xs:long

1

1

Time, in milliseconds, when the hierarchy was created.

Hierarchies/Hierarchy/InSync

xs:boolean

1

1

Indicates if the Chargeback hierarchy is synchronized with the vCenter Server hierarchy. Because the synchronization cannot be turned off, this value is always set to true.

Hierarchies/Hierarchy/LastUpdatedTime

xs:long

1

1

Indicates the time when the Chargeback hierarchy was last updated.

Hierarchies/Hierarchy/LastUpdatedUser

xs:string

1

1

Indicates the user who last updated the Chargeback hierarchy. If the hierarchy is automatically updated because of changes in the vCenter Server hierarchy, the user name is 'CBM Server'.

Hierarchies/Hierarchy/Entities/Entity

 

1

1

Represents the entity element.

Hierarchies/Hierarchy/Entities/Entity/@id

xs:int

1

1

The ID of the entity in the hierarchy.

Hierarchies/Hierarchy/Entities/Entity/Name

xs:string

1

1

Name of the entity.

Hierarchies/Hierarchy/Entities/Entity/Description

xs:string

1

1

Description provided for the entity.

Hierarchies/Hierarchy/Entities/Entity/Type

xs:int

1

1

Type of the entity. For more information, see Chargeback Entity Types.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share

 

1

1

Represents the share of the entity element.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share/Percentage

xs:int

1

1

The shared percentage of the entity.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share/Parent/@id

xs:int

1

1

The ID of the parent entity.

Hierarchies/Hierarchy/Entities/Entity/Shares/Share/StartTime

xs:long

1

1

Time, in milliseconds, when the entity is added to the parent.

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.

A sample response is provided here.

Error Response

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

Error code

Description

VCB_ERR_INVALID_ENTITY_ID

Returned if the specified entity is not found in the hierarchy.
or
Returned if a vCenter entity is not found while retrieving custom attributes for a vCenter entity.

VCB_ERR_NOT_VC_ENTITY

Returned if you are importing vCenter attributes for a non vCenter entity.

VCENTER_COMMON_ERR_VCENTER_SERVER_AUTH_FAILED

Returned if provided credentials for authentication are incorrect.

VCENTER_COMMON_ERR_UNABLE_TO_CONNECT_TO_VCENTER_SERVER

Returned if unable to connect to vCenter server during fetching of custom attributes for a vCenter entity.

VCENTER_COMMON_ERR_INVALID_VCENTER_SERVER_URL

Returned if the vCenter server URL is invalid while retrieving custom attributes for a vCenter entity.

VCB_ERR_RETRIEVING_CUSTOM_ATTRIBUTES

Returned if any error occurs from vCenter during the retrieval of custom attributes for a vCenter entity.