Path: blob/main/L4assets/DSandMLOpsAssets/CLIandSDK/Notebooks/CPD-02 User Management.ipynb
1928 views
User management
Using the API documented at: IBM Cloud Pak for Data Platform API
This is the latest despite CPD 4.6 being out.
Capabilities demonstrated:
Use of a zip file to add python functions to the environment
List all users
List available groups
List available roles
Get the CPD configuration information and display available permissions
Create a role
Create a group
Create a user
Add the user to a group
Add the new role to the user (does not work!!!)
Delete the user
Delete the new group
Delete the new role
Make sure to set the variables in the next cell
cpd_url, username, password
Support functions
Get an access token
Note that the token usually lasts for only one hour.
An access token is used to identify a user in API requests.
List all users
This returns an array of users with a lot of information.
Only part of this information is displayed. See the documentation for details.
List available groups
List available roles
Get the configuration information
List the available permissions in the CPD configuration
Create a role
Create a simple role using the same permissions as the existing User role.
Note that these permissions are a subset of the ones listed from the config permissions list.
Create a Group
Create a user
Note that while we create the user, we also identify the role to use. In this case, "User".
It is possible to add multiple roles to a user at creation time. At the moment it seems to be limited to the roles that were part of the cluster installation. They are:
Add the user to a group
Update the user and add a role
returns status code: 400, reason: Bad Request
Delete the user
Delete the previously created group
Delete the previously created role
Author
Jacques Roy is a member of the IBM Enablement for Data and AI
Copyright © 2023. This notebook and its source code are released under the terms of the MIT License.