user-mgmt list-ud-roles

Returns a list of user-defined Cloud Pak for Data roles.

Syntax

cpd-cli user-mgmt list-ud-roles \
--profile=<cpd-configuration-profile-name> \
[--cpdconfig=<cpd-configuration-location>] \
[--output=json|yaml|csv|text] \
[--verbose]

Arguments

The list-ud-roles command has no arguments.

Options

Option Description
--cpdconfig The Cloud Pak for Data configuration location.
Status
Optional.
Syntax
--cpdconfig=<cpd-configuration-location>
Default value
$HOME/.cpd-cli/config
Valid values
A valid Cloud Pak for Data configuration location.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.

--output

-o

Specify an output format. Valid formats include json, yaml, csv, or text (the default format).
Status
Optional.
Syntax
--output=json|yaml|csv|text
Default value
text
Valid values
json|yaml|csv|text
--profile The profile-name from the Cloud Pak for Data configuration.
Status
Required.
Syntax
--profile=<cpd-configuration-profile-name>
Default value
default
Valid values
Any valid profile name from the Cloud Pak for Data configuration.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

Examples

Note: The following examples use the recommended installation environment variables.

Use a script to create environment variables with the correct values for your environment. For more information, see Best practice: Setting up install variables.

Return a list of user-defined Cloud Pak for Data roles in the default *.txt output format.
cpd-cli user-mgmt list-ud-roles \
--profile=${PROJECT_CPD_INSTANCE}
Example *.txt output.
Role                                Description                                           Permissions  
---------                           ----------------------                                ---------------- 
can_provision                       user has permission to provision instance.            administrator 
can_access_service                  user has permission to 'Access assigned service'      sign_in_only 
all_admin_permissions               user has all admin permissions                        administrator 
can_manage_users                    User can manage users                                 manage_users
Return a list of user-defined Cloud Pak for Data roles in the *.json output format.
cpd-cli user-mgmt list-ud-roles \
--profile=${PROJECT_CPD_INSTANCE} \
--output=json
Example *.json output.
[
 {
  "role_name": "can_provision",
  "description": "user has permission to provision instance.",
  "permissions": "administrator"
 },
 {
  "role_name": "can_access_service",
  "description": "user has permission to 'Access assigned service'",
  "permissions": "sign_in_only"
 },
 {
  "role_name": "all_admin_permissions",
  "description": "user has all admin permissions",
  "permissions": "administrator"
 },
 {
  "role_name": "can_manage_users",
  "description": "User can manage users",
  "permissions": "manage_users"
 }
Return a list of user-defined Cloud Pak for Data roles in the *.yaml output format.
cpd-cli user-mgmt list-ud-roles \
--profile=${PROJECT_CPD_INSTANCE} \
--output=yaml
Example *.yaml output.
- rolename: can_provision
  description: user has permission to provision instance.
  permissions: administrator
- rolename: can_access_service
  description: user has permission to 'Access assigned service'
  permissions: sign_in_only
- rolename: all_admin_permissions
  description: user has all admin permissions
  permissions: administrator
- rolename: can_manage_users
  description: User can manage users
  permissions: manage_users
Return a list of user-defined Cloud Pak for Data roles in the *.csv output format.
cpd-cli user-mgmt list-ud-roles \
--profile=${PROJECT_CPD_INSTANCE} \
--output=csv

List of user defined roles available in {working-space}/user-mgmt/platform_ud_roles_220919221052.csv
The *.csv output resembles the following.
role_name,description,permissions
can_provision,user has permission to provision instance.,administrator
can_access_service,user has permission to 'Access assigned service',sign_in_only
all_admin_permissions,user has all admin permissions,administrator
can_manage_users,User can manage users,manage_users