This API enables you to retrieve a list of roles that you are authorized to view in vCenter Chargeback Manager. If you are a Super User, you can view all the roles in vCenter Chargeback Manager.
The syntax for calling this method is:
GET <Base_Url>/roles
A sample API call is as follows:
GET https://123.123.123.123/vCenter-CB/api/roles
This API does not take any request body parameters.
If successful, the API returns the following details.
XPath |
Type |
Min Occurs |
Max Occurs |
Description |
---|---|---|---|---|
Roles/Role |
|
4 |
unbounded |
This is the Role element |
Roles/Role/@id |
xs:int |
|
|
ID of the role. |
Roles/Role/Name |
xs:string |
1 |
1 |
Name for the role. |
Roles/Role/Description |
xs:string |
1 |
1 |
An optional description for the role. |
Roles/Role/Custom |
xs:boolean |
|
|
Indicates whether the role is a custom role. |
Roles/Role/Privileges/Privilege |
|
|
|
Represents the role's privileges |
Roles/Role/Privileges/Privilege/@id |
xs:int |
1 |
unbounded |
ID of the role's privilege |
Privileges/Privilege |
|
1 |
unbounded |
Represents the Privilege element |
Privileges/Privilege/@id |
xs:int |
1 |
1 |
ID of the role's privilege. |
Privileges/Privilege/Name |
xs:string |
1 |
1 |
Name of the privilege. |
Privileges/Privilege/ResourceType/@id |
xs:int |
1 |
1 | ID of the resource type. |
A sample response is provided here.
The following table explains the error codes displayed by the API.
Error code |
Description |
VCENTER_COMMON_ERR_USER_NOT_AUTHENTICATED |
User is not authenticated to perform this operation. |