The API enables you to modify the name and description of a Chargeback custom attribute.
The syntax for calling this method is:
PUT <Base_Url>/attribute/{attributeId}
A sample API call is as follows:
PUT https://123.123.123.123/vCenter-CB/api/attribute/1
To modify 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 |
0 |
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 returns 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_LOCAL_ATTRIBUTE_ID |
vCenter Chargeback Manager defined attribute with the specified identifier does not exist. |
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. |