Users and groups#
For usage information and examples, see Users and groups
- class dataikuapi.dss.admin.DSSUser(client, login)#
A handle for a user on the DSS instance.
Important
Do not instantiate directly, use
dataikuapi.DSSClient.get_user()
instead.- delete(allow_self_deletion=False)#
Deletes the user
- :param bool allow_self_deletionAllow the use of this function to delete your own user.
Warning: this is very dangerous and used in a loop could lead to the deletion of all users/admins.
- get_settings()#
Get the settings of the user. You must be admin to call this method.
You must use
save()
on the returned object to make your changes effective on the user.Usage example
# disable some user user = client.get_user('the_user_login') settings = user.get_settings() settings.enabled = False settings.save()
- Returns:
the settings of the user
- Return type:
- get_activity()#
Gets the activity of the user. You must be admin to call this method.
- Returns:
the user’s activity
- Return type:
- get_info()#
Gets basic information about the user. You do not need to be admin to call this method
- Return type:
DSSUserInfo
- start_resync_from_supplier()#
Starts a resync of the user from an external supplier (LDAP, Azure AD or custom auth)
- Returns:
a
dataikuapi.dss.future.DSSFuture
representing the sync process- Return type:
- get_definition()#
Get the definition of the user
Caution
Deprecated, use
get_settings()
instead- Returns:
the user’s definition, as a dict. Notable fields are
login : identifier of the user, can’t be modified
enabled : whether the user can log into DSS
groups : list of group names this user belongs to
- Return type:
dict
- set_definition(definition)#
Set the user’s definition.
Caution
Deprecated, use
dataikuapi.dss.admin.DSSUserSettings.save()
insteadImportant
You should only use
set_definition()
with an object that you obtained throughget_definition()
, not create a new dict.Note
This call requires an API key with admin rights
The fields that may be changed in a user definition are:
email
displayName
enabled
groups
userProfile
password (not returned by
get_definition()
but can be set)userProperties
adminProperties
secrets
credentials
- Parameters:
definition (dict) – the definition for the user, as a dict
- get_client_as()#
Get an API client that has the permissions of this user.
This allows administrators to impersonate actions on behalf of other users, in order to perform actions on their behalf.
- Returns:
a client through which calls will be run as the user
- Return type:
- class dataikuapi.dss.admin.DSSUserSettings(client, login, settings)#
Settings for a DSS user.
Important
Do not instantiate directly, use
DSSUser.get_settings()
instead.- property admin_properties#
Get the admin properties for this user.
Important
Do not set this property, modify the dict in place
Admin properties can be seen and modified only by administrators, not by the user themselves.
- Return type:
dict
- property enabled#
Whether this user is enabled.
- Return type:
boolean
- property creation_date#
Get the timestamp of when the user was created
- Returns:
the creation date
- Return type:
datetime.datetime
or None
- property preferences#
Get the preferences for this user
- Returns:
user preferences
- Return type:
- save()#
Saves the settings
Note: this call is not available to Dataiku Cloud users
- add_secret(name, value)#
Add a user secret.
If there was already a secret with the same name, it is replaced
- Parameters:
name (string) – name of the secret
value (string) – name of the value
- get_raw()#
Get the raw settings of the user.
Modifications made to the returned object are reflected when saving.
- Returns:
the dict of the settings (not a copy). Notable fields are:
login : identifier of the user, can’t be modified
enabled : whether the user can log into DSS
groups : list of group names this user belongs to
- trialStatus: The trial status of the user, with the following keys:
exists: True if this user is or was on trial
expired: True if the trial period has expired
valid: True if the trial is valid (for ex, has not expired and the license allows it)
expiresOn: Date (ms since epoch) when the trial will expire
grantedOn: Date (ms since epoch) when the trial was granted
- Return type:
dict
- remove_connection_credential(connection)#
Remove per-user-credentials for a connection
If no credentials for the givent connection exists, this method does nothing
- Parameters:
connection (string) – name of the connection
- remove_plugin_credential(plugin_id, param_set_id, preset_id, param_name)#
Remove per-user-credentials for a plugin preset
- Parameters:
plugin_id (string) – identifier of the plugin
param_set_id (string) – identifier of the parameter set to which the preset belongs
preset_id (string) – identifier of the preset
param_name (string) – name of the credentials parameter in the preset
- remove_secret(name)#
Remove a user secret based on its name
If no secret of the given name exists, the method does nothing.
- Parameters:
name (string) – name of the secret
- set_basic_connection_credential(connection, login, password)#
Set per-user-credentials for a connection that takes a user/password pair.
- Parameters:
connection (string) – name of the connection
login (string) – login of the credentials
password (string) – password of the credentials
- set_basic_plugin_credential(plugin_id, param_set_id, preset_id, param_name, login, password)#
Set per-user-credentials for a plugin preset that takes a user/password pair
- Parameters:
plugin_id (string) – identifier of the plugin
param_set_id (string) – identifier of the parameter set to which the preset belongs
preset_id (string) – identifier of the preset
param_name (string) – name of the credentials parameter in the preset
login (string) – login of the credentials
password (string) – password of the credentials
- set_oauth2_plugin_credential(plugin_id, param_set_id, preset_id, param_name, refresh_token)#
Set per-user-credentials for a plugin preset that takes a OAuth refresh token
- Parameters:
plugin_id (string) – identifier of the plugin
param_set_id (string) – identifier of the parameter set to which the preset belongs
preset_id (string) – identifier of the preset
param_name (string) – name of the credentials parameter in the preset
refresh_token (string) – value of the refresh token
- property user_properties#
Get the user properties for this user.
Important
Do not set this property, modify the dict in place
User properties can be seen and modified by the user themselves. A contrario admin properties are for administrators’ eyes only.
- Return type:
dict
- class dataikuapi.dss.admin.DSSUserPreferences(preferences)#
Preferences for a DSS user.
Important
Do not instantiate directly, use
DSSUserSettings.preferences()
instead.- property ui_language#
Get or set the language used in the Web User Interface for this user. Valid values are “en” (English) and “ja” (Japanese)
- Return type:
str
- property mention_emails#
Get or set whether the user receives email notifications when mentioned in discussions or commit messages
- Return type:
bool
- property discussion_emails#
Get or set whether the user receives email notifications when a user writes in a discussion thread from any item they are watching
- Return type:
bool
- property access_request_emails#
Get or set whether the user receives email notifications when a user requests access to one of their projects or to use an object from one of their projects
- Return type:
bool
- property granted_access_emails#
Get or set whether the user receives email notifications when they are granted access to a project, or when their access or sharing requests are approved
- Return type:
bool
- property granted_plugin_request_emails#
Get or set whether the user receives email notifications when their plugin requests are approved
- Return type:
bool
- property plugin_request_emails#
Get or set whether the user receives email notifications when users request to install a plugin
- Return type:
bool
- property instance_access_requests_emails#
Get or set whether the user receives email notifications when users request access to the instance
- Return type:
bool
- property profile_upgrade_requests_emails#
Get or set whether the user receives email notifications when users request to upgrade their profile
- Return type:
bool
- property code_env_creation_request_emails#
Get or set whether the user receives email notifications when a user requests a code env creation
- Return type:
bool
- property granted_code_env_creation_request_emails#
Get or set whether the user receives email notifications when their code env creation request is granted
- Return type:
bool
- property daily_digests_emails#
Get or set whether the user receives daily emails to sum-up the day activity regardless of whether they logged-in.
- Return type:
bool
- property offline_activity_emails#
Get or set whether the user receives emails periodically that notify them about activity happening while they are offline
- Return type:
bool
- property remember_position_flow#
Get or set whether for the user the flow remembers zoom settings and re-selects the last item viewed
- Return type:
bool
- property login_logout_notifications#
Get or set whether the user receives notifications when other users log in/out
- Return type:
bool
- property watched_objects_editions_notifications#
Get or set whether the user receives notifications when objects they are watching are edited
- Return type:
bool
- property object_on_current_project_created_deleted_notifications#
Get or set whether the user receives notifications when an object is created/deleted on the project they are browsing
- Return type:
bool
- property any_object_on_current_project_edited_notifications#
Get or set whether the user receives notifications when any object is edited on the project they are browsing
- Return type:
bool
- property watch_star_on_current_project_notifications#
Get or set whether the user receives notifications when an object is starred on the project they are browsing
- Return type:
bool
- property other_users_jobs_tasks_notifications#
Get or set whether the user receives notifications when other users run jobs/scenarios/ML tasks
- Return type:
bool
- property request_access_notifications#
Get or set whether the user receives notifications when they receive an access or sharing request, or one of their requests is approved
- Return type:
bool
- property scenario_run_notifications#
Get or set whether the user receives notifications when scenarios are run under their account
- Return type:
bool
- class dataikuapi.dss.admin.DSSOwnUser(client)#
A handle to interact with your own user
Important
Do not instantiate directly, use
dataikuapi.DSSClient.get_own_user()
instead.
- class dataikuapi.dss.admin.DSSOwnUserSettings(client, settings)#
Settings for the current DSS user.
Important
Do not instantiate directly, use
DSSOwnUser.get_settings()
instead.- save()#
Saves the settings
- add_secret(name, value)#
Add a user secret.
If there was already a secret with the same name, it is replaced
- Parameters:
name (string) – name of the secret
value (string) – name of the value
- get_raw()#
Get the raw settings of the user.
Modifications made to the returned object are reflected when saving.
- Returns:
the dict of the settings (not a copy). Notable fields are:
login : identifier of the user, can’t be modified
enabled : whether the user can log into DSS
groups : list of group names this user belongs to
- trialStatus: The trial status of the user, with the following keys:
exists: True if this user is or was on trial
expired: True if the trial period has expired
valid: True if the trial is valid (for ex, has not expired and the license allows it)
expiresOn: Date (ms since epoch) when the trial will expire
grantedOn: Date (ms since epoch) when the trial was granted
- Return type:
dict
- remove_connection_credential(connection)#
Remove per-user-credentials for a connection
If no credentials for the givent connection exists, this method does nothing
- Parameters:
connection (string) – name of the connection
- remove_plugin_credential(plugin_id, param_set_id, preset_id, param_name)#
Remove per-user-credentials for a plugin preset
- Parameters:
plugin_id (string) – identifier of the plugin
param_set_id (string) – identifier of the parameter set to which the preset belongs
preset_id (string) – identifier of the preset
param_name (string) – name of the credentials parameter in the preset
- remove_secret(name)#
Remove a user secret based on its name
If no secret of the given name exists, the method does nothing.
- Parameters:
name (string) – name of the secret
- set_basic_connection_credential(connection, login, password)#
Set per-user-credentials for a connection that takes a user/password pair.
- Parameters:
connection (string) – name of the connection
login (string) – login of the credentials
password (string) – password of the credentials
- set_basic_plugin_credential(plugin_id, param_set_id, preset_id, param_name, login, password)#
Set per-user-credentials for a plugin preset that takes a user/password pair
- Parameters:
plugin_id (string) – identifier of the plugin
param_set_id (string) – identifier of the parameter set to which the preset belongs
preset_id (string) – identifier of the preset
param_name (string) – name of the credentials parameter in the preset
login (string) – login of the credentials
password (string) – password of the credentials
- set_oauth2_plugin_credential(plugin_id, param_set_id, preset_id, param_name, refresh_token)#
Set per-user-credentials for a plugin preset that takes a OAuth refresh token
- Parameters:
plugin_id (string) – identifier of the plugin
param_set_id (string) – identifier of the parameter set to which the preset belongs
preset_id (string) – identifier of the preset
param_name (string) – name of the credentials parameter in the preset
refresh_token (string) – value of the refresh token
- property user_properties#
Get the user properties for this user.
Important
Do not set this property, modify the dict in place
User properties can be seen and modified by the user themselves. A contrario admin properties are for administrators’ eyes only.
- Return type:
dict
- class dataikuapi.dss.admin.DSSUserActivity(client, login, activity)#
Activity for a DSS user.
Important
Do not instantiate directly, use
DSSUser.get_activity()
ordataikuapi.DSSClient.list_users_activity()
instead.- get_raw()#
Get the raw activity of the user as a dict.
- Returns:
the raw activity. Fields are
login : the login of the user for this activity
lastSuccessfulLogin : timestamp in milliseconds of the last time the user logged into DSS
lastFailedLogin : timestamp in milliseconds of the last time DSS recorded a login failure for this user
lastSessionActivity : timestamp in milliseconds of the last time the user opened a tab
- Return type:
dict
- property last_successful_login#
Get the last successful login of the user
Returns None if there was no successful login for this user.
- Returns:
the last successful login
- Return type:
datetime.datetime
or None
- property last_failed_login#
Get the last failed login of the user
Returns None if there were no failed login for this user.
- Returns:
the last failed login
- Return type:
datetime.datetime
or None
- property last_session_activity#
Get the last session activity of the user
The last session activity is the last time the user opened a new DSS tab or refreshed his session.
Returns None if there is no session activity yet.
- Returns:
the last session activity
- Return type:
datetime.datetime
or None
- class dataikuapi.dss.admin.DSSGroup(client, name)#
A group on the DSS instance.
Important
Do not instantiate directly, use
dataikuapi.DSSClient.get_group()
instead.- delete()#
Deletes the group
- get_definition()#
Get the group’s definition (name, description, admin abilities, type, ldap name mapping)
- Returns:
the group’s definition. Top-level fields are:
name : name of the group
sourceType : type of group. Possible values: LOCAL, LDAP
- Return type:
dict
- set_definition(definition)#
Set the group’s definition.
Important
You should only use
set_definition()
with an object that you obtained throughget_definition()
, not create a new dict.- Parameters:
definition (dict) – the definition for the group, as a dict
- class dataikuapi.dss.admin.DSSAuthorizationMatrix(authorization_matrix)#
The authorization matrix of all groups and enabled users of the DSS instance.
Important
Do not instantiate directly, use
dataikuapi.DSSClient.get_authorization_matrix()
instead.- property raw#
Get the raw authorization matrix as a dict
- Returns:
the authorization matrix. There are 2 parts in the matrix, each as a top-level field and with similar structures, perUser and perGroup.
- Return type:
dict