The API enables you to create a vCenter Chargeback Manager custom attribute.
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
To add an attribute, you should have superuser or Administrator privileges.
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.
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.
The following table explains the error codes returned by the API.
Error Code |
Description |
VCB_ERR_INVALID_ATTRIBUTE_NAME |
|
VCB_ERR_INVALID_ATTRIBUTE_DESCRIPTION |
Attribute description exceeds 512 characters |
VCB_ERR_ATTRIBUTE_NAME_ALREADY_EXISTS |
Attribute with the given name exists |