Other administration tasks

Here are some more global administration tasks that can be performed using the DSS Public API:

  • Reading and writing general instance settings

  • Managing user and group impersonation rules for User Isolation Framework

  • Managing (creating / modifying) code environments

  • Managing instance variables

  • Listing long running tasks, getting their status, aborting them

  • Listing running notebooks, getting their status, unloading them

  • Managing global API keys

  • Listing global DSS usages (projects, datasets, recipes, scenarios…)

  • Managing personal API keys

Reference documentation

class dataikuapi.dss.admin.DSSGeneralSettings(client)

The general settings of the DSS instance. Do not create this object directly, use dataikuapi.DSSClient.get_general_settings() instead.

save()

Save the changes that were made to the settings on the DSS instance Note: this call requires an API key with admin rights

get_raw()

Get the settings as a dictionary

add_impersonation_rule(rule, is_user_rule=True)

Add a rule to the impersonation settings

Parameters
get_impersonation_rules(dss_user=None, dss_group=None, unix_user=None, hadoop_user=None, project_key=None, scope=None, rule_type=None, is_user=None)

Retrieve the user or group impersonation rules that matches the parameters

Parameters
  • dss_user – a DSS user or regular expression to match DSS user names

  • dss_group – a DSS group or regular expression to match DSS groups

  • unix_user – a name to match the target UNIX user

  • hadoop_user – a name to match the target Hadoop user

  • project_key – a project_key

  • scope – project-scoped (‘PROJECT’) or global (‘GLOBAL’)

  • type – the rule user or group matching method (‘IDENTITY’, ‘SINGLE_MAPPING’, ‘REGEXP_RULE’)

  • is_user – True if only user-level rules should be considered, False for only group-level rules, None to consider both

remove_impersonation_rules(dss_user=None, dss_group=None, unix_user=None, hadoop_user=None, project_key=None, scope=None, rule_type=None, is_user=None)

Remove the user or group impersonation rules that matches the parameters from the settings

Parameters
  • dss_user – a DSS user or regular expression to match DSS user names

  • dss_group – a DSS group or regular expression to match DSS groups

  • unix_user – a name to match the target UNIX user

  • hadoop_user – a name to match the target Hadoop user

  • project_key – a project_key

  • scope – project-scoped (‘PROJECT’) or global (‘GLOBAL’)

  • type – the rule user or group matching method (‘IDENTITY’, ‘SINGLE_MAPPING’, ‘REGEXP_RULE’)

  • is_user – True if only user-level rules should be considered, False for only group-level rules, None to consider both

push_container_exec_base_images()

Push the container exec base images to their repository

class dataikuapi.dss.admin.DSSUserImpersonationRule(raw=None)

Helper to build user-level rule items for the impersonation settings

scope_global()

Make the rule apply to all projects

scope_project(project_key)

Make the rule apply to a given project

Args:

project_key : the project this rule applies to

user_identity()

Make the rule map each DSS user to a UNIX user of the same name

user_single(dss_user, unix_user, hadoop_user=None)

Make the rule map a given DSS user to a given UNIX user

Args:

dss_user : a DSS user unix_user : a UNIX user hadoop_user : a Hadoop user (optional, defaults to unix_user)

user_regexp(regexp, unix_user, hadoop_user=None)

Make the rule map a DSS users matching a given regular expression to a given UNIX user

Args:

regexp : a regular expression to match DSS user names unix_user : a UNIX user hadoop_user : a Hadoop user (optional, defaults to unix_user)

class dataikuapi.dss.admin.DSSGroupImpersonationRule(raw=None)

Helper to build group-level rule items for the impersonation settings

group_identity()

Make the rule map each DSS user to a UNIX user of the same name

group_single(dss_group, unix_user, hadoop_user=None)

Make the rule map a given DSS user to a given UNIX user

Args:

dss_group : a DSS group unix_user : a UNIX user hadoop_user : a Hadoop user (optional, defaults to unix_user)

group_regexp(regexp, unix_user, hadoop_user=None)

Make the rule map a DSS users matching a given regular expression to a given UNIX user

Args:

regexp : a regular expression to match DSS groups unix_user : a UNIX user hadoop_user : a Hadoop user (optional, defaults to unix_user)

class dataikuapi.dss.admin.DSSInstanceVariables(client, variables)

Dict containing the instance variables. The variables can be modified directly in the dict and persisted using its save() method.

Do not create this object directly, use dataikuapi.DSSClient.get_global_variables() instead.

save()

Save the changes made to the instance variables.

Note: this call requires an API key with admin rights.

class dataikuapi.dss.future.DSSFuture(client, job_id, state=None, result_wrapper=<function DSSFuture.<lambda>>)

A future on the DSS instance

static from_resp(client, resp, result_wrapper=<function DSSFuture.<lambda>>)

Creates a DSSFuture from a parsed JSON response

classmethod get_result_wait_if_needed(client, ret)
abort()

Abort the future

get_state()

Get the status of the future, and its result if it’s ready

peek_state()

Get the status of the future, and its result if it’s ready

get_result()

Get the future result if it’s ready, raises an Exception otherwise

has_result()

Checks whether the future has a result ready

wait_for_result()

Wait and get the future result

class dataikuapi.dss.jupyternotebook.DSSJupyterNotebook(client, project_key, notebook_name)
unload(session_id=None)

Stop this Jupyter notebook and release its resources

get_sessions(as_objects=False)

Get the list of running sessions of this Jupyter notebook

Parameters

as_objects (boolean) – if True, each returned item will be a dataikuapi.dss.notebook.DSSNotebookSession

Return type

list of dataikuapi.dss.notebook.DSSNotebookSession or list of dict

get_content()

Get the content of this Jupyter notebook (metadata, cells, nbformat)

delete()

Delete this Jupyter notebook and stop all of its active sessions.

get_object_discussions()

Get a handle to manage discussions on the notebook

Returns

the handle to manage discussions

Return type

dataikuapi.discussion.DSSObjectDiscussions

class dataikuapi.dss.jupyternotebook.DSSJupyterNotebookListItem(client, data)

An item in a list of Jupyter notebooks. Do not instantiate this class, use dataikuapi.dss.project.DSSProject.list_jupyter_notebooks()

to_notebook()

Gets the DSSJupyterNotebook corresponding to this notebook

property name
property language
property kernel_spec
class dataikuapi.dss.jupyternotebook.DSSNotebookSession(client, session)

Metadata associated to the session of a Jupyter Notebook. Do not create this directly, use DSSJupyterNotebook.get_sessions()

unload()

Stop this Jupyter notebook and release its resources

class dataikuapi.dss.jupyternotebook.DSSNotebookContent(client, project_key, notebook_name, content)

Content of a Jupyter Notebook. Do not create this directly, use DSSJupyterNotebook.get_content()

get_raw()

Get the content of this Jupyter notebook (metadata, cells, nbformat) :rtype: a dict containing the full content of a notebook

get_metadata()

Get the metadata associated to this Jupyter notebook :rtype: dict with metadata

get_cells()

Get the cells associated to this Jupyter notebook :rtype: list of cells

save()

Save the content of this Jupyter notebook

class dataikuapi.dss.notebook.DSSNotebook(client, project_key, notebook_name, state=None)

Deprecated. Use DSSJupyterNotebook A Python/R/Scala notebook on the DSS instance

unload(session_id=None)

Deprecated. Use DSSJupyterNotebook Stop this Jupyter notebook and release its resources

get_state()

Deprecated. Use DSSJupyterNotebook Get the metadata associated to this Jupyter notebook

get_sessions()

Deprecated. Use DSSJupyterNotebook Get the list of running sessions of this Jupyter notebook

get_object_discussions()

Deprecated. Use DSSJupyterNotebook Get a handle to manage discussions on the notebook

Returns

the handle to manage discussions

Return type

dataikuapi.discussion.DSSObjectDiscussions

class dataikuapi.dss.admin.DSSGlobalApiKey(client, key)

A global API key on the DSS instance

delete()

Delete the api key

Note: this call requires an API key with admin rights

get_definition()

Get the API key’s definition

Note: this call requires an API key with admin rights

Returns:

the code env definition, as a JSON object

set_definition(definition)

Set the API key’s definition.

Note: this call requires an API key with admin rights

Args:

definition: the definition for the API key, as a JSON object.

class dataikuapi.dss.admin.DSSPersonalApiKey(client, id_)

A personal API key on the DSS instance. Do not create this object directly, use dataikuapi.DSSClient.get_personal_api_key() instead.

get_definition()

Get the API key’s definition

Returns

the personal API key definition, as a JSON object

delete()

Delete the API key

class dataikuapi.dss.admin.DSSPersonalApiKeyListItem(client, data)

An item in a list of personal API key. Do not create this object directly, use dataikuapi.DSSClient.list_personal_api_keys() or dataikuapi.DSSClient.list_all_personal_api_keys() instead.

to_personal_api_key()

Gets the DSSPersonalApiKey corresponding to this item

property id
property user
property key
property label
property description
property created_on
property created_by
class dataikuapi.dss.admin.DSSGlobalUsageSummary(data)

The summary of the usage of the DSS instance. Do not create this object directly, use dataikuapi.dss.DSSClient.get_global_usage_summary() instead.

property raw
property projects_count
property total_datasets_count
property total_recipes_count
property total_jupyter_notebooks_count
property total_sql_notebooks_count
property total_scenarios_count
property total_active_with_trigger_scenarios_count