Add Attribute

The API enables you to create a vCenter Chargeback Manager custom attribute.

Syntax

The syntax for calling this method is:

POST <Base_Url>/attribute

A sample API call is as follows:

POST https://123.123.123.123/vCenter-CB/api/attribute

User Privilege

To add an attribute, you should have superuser or Administrator privileges.

Request Body Parameters

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

XPath

Type

Min Occurs

Max Occurs

Description

Attributes/Attribute

 

1

1

Represents the attributes of the entity

Attributes/Attribute/Name

xs:string

1

1

Name of the attribute. Attribute names are not case sensitive.

Attributes/Attribute/Description

xs:string

0

1

Description provided for the attribute.

A sample request XML is provided here.

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

 

1

1

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.

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_ATTRIBUTE_NAME

  • If an empty attribute name is specified
  • If the attribute name exceeds 255 characters

VCB_ERR_INVALID_ATTRIBUTE_DESCRIPTION

Attribute description exceeds 512 characters

VCB_ERR_ATTRIBUTE_NAME_ALREADY_EXISTS

Attribute with the given name exists