This API enables you to retrieve the details of a specific role.
The syntax for calling this method is:
GET <Base_Url>/role/{roleId}
A sample API call is as follows:
GET https://123.123.123.123/vCenter-CB/api/role/2
This API does not take any request XML.
If the operation is successful, the API gets an XML response with the following details.
XPath |
Type |
Min Occurs |
Max Occurs |
Description |
---|---|---|---|---|
Roles/Role |
|
1 |
1 |
Represents the Role element. |
Roles/Role/@id |
xs:int |
1 |
1 |
ID of the user role for which the details are listed. |
Roles/Role/Name |
xs:string |
1 |
1 |
Name for the role. |
Roles/Role/Description |
xs:string |
0 |
1 |
An optional description of the role. |
Roles/Role/Custom |
xs:boolean |
|
|
Indicates whether the role is a custom role. |
Roles/Role/Privileges/Privilege |
|
|
|
Represents the Privileges element for a role. |
Roles/Role/Privileges/Privilege/@id |
xs:int |
1 |
unbounded |
Unique ID of the privilege assigned to the role. |
Privileges/Privilege |
|
1 |
unbounded |
Represents the Privilege element. |
Privileges/Privilege/@id |
xs:int |
1 |
1 |
Unique ID of the privilege that the user role is assigned. |
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 API displays errors if inputs are incorrect or if the operation is unsuccessful for any reason. The following table explains the error code displayed by the API.
Error Code |
Description |
---|---|
VCENTER_COMMON_ERR_INSUFFICIENT_PERMISSION |
User does not have sufficient permissions for performing this operation. |
VCENTER_COMMON_ERR_USER_NOT_AUTHENTICATED |
User is not authenticated to perform this operation. |
VCB_ERR_INVALID_ROLE_ID |
The specified role ID is not a valid ID. |