7.3

Table Of Contents
Parameter Description
URL https://$vRA/identity/api/authorization/tenants/$tenantId/principals/$principalId/roles/roleId
$vRA Specifies the appliance name and fully qualified domain name, or IP address of the
vRealize Automation server.
$token Specifies a valid HTTP bearer token with necessary credentials.
$tenantId Specifies the ID of the tenant.
$principalId Specifies the ID of the user in name@domain format.
$roleId Specifies the ID of the user role.
Example: curl Command to Assign a User to a Role
The following example command string submits a request to assign the user tony in the domain
example.mycompany.com to the tenant administrator role. It provides empty braces for the required
JSON payload. For more information about getting the user name and domain values, see Syntax for
Searching LDAP or Active Directory for a User .
curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token"
"https://$vRA/identity/api/authorization/tenants/development/principals/susan@example.mycompany.com/rol
es/CSP_TENANT_ADMIN/" --data "{}"
If the command is successful, the HTTP response body is empty except for a 204 No Content status
statement.
Syntax for Displaying all Roles Assigned to a User
GET /api/authorization/tenants/{tenantId}/principals/{principalId}/roles displays all of
the roles assigned to a user.
Input
Use the supported input parameters to control the command output.
Parameter Description
URL https://$vRA/identity/api/authorization/tenants/$tenantId/principals/$principalId/roles
$vRA Specifies the appliance name and fully qualified domain name, or IP address of the
vRealize Automation server.
$token Specifies a valid HTTP bearer token with necessary credentials.
$tenantId Specifies the ID of the tenant.
principalId Specifies the ID of the user in the form name@domain.
Output
The command output contains property names and values based on the command input parameters.
Programming Guide
VMware, Inc. 39