Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions dataikuapi/dssclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,39 +94,15 @@ def get_future(self, job_id):
# Notebooks
########################################################


def list_jupyter_notebooks(self, active=False, as_objects=True):
"""
List the Jupyter notebooks for every projects

:param boolean active: if True, only the active notebooks
:param boolean as_objects: if True, each returned item will be a :class:`dataikuapi.dss.notebook.DSSJupyterNotebook`

:return: list of notebooks. if as_objects is True, each entry in the list is a :class:`dataikuapi.dss.notebook.DSSJupyterNotebook`. Else, each item in the list is a dict which contains at least a "name" field.
:rtype: list of :class:`dataikuapi.dss.notebook.DSSJupyterNotebook` or list of dict
"""
project_keys = self.list_project_keys()
output = []
for project_key in project_keys:
notebook_names = self._perform_json("GET", "/projects/%s/jupyter-notebooks/" % project_key, params={"active": active})
if as_objects:
output += [DSSJupyterNotebook(self, project_key, notebook_name) for notebook_name in notebook_names]
else:
for notebook_name in notebook_names:
output.append({u"projectKey": project_key, u"name": notebook_name})
return output

def list_running_notebooks(self, as_objects=True):
"""
Deprecated. Use :meth:`DSSClient.list_jupyter_notebooks`
List the currently-running Jupyter notebooks

:param boolean as_objects: if True, each returned item will be a :class:`dataikuapi.dss.notebook.DSSNotebook`

:return: list of notebooks. if as_objects is True, each entry in the list is a :class:`dataikuapi.dss.notebook.DSSNotebook`. Else, each item in the list is a dict which contains at least a "name" field.
:rtype: list of :class:`dataikuapi.dss.notebook.DSSNotebook` or list of dict
"""
warnings.warn("Use DSSClient.list_jupyter_notebooks", DeprecationWarning)
notebook_list = self._perform_json("GET", "/admin/notebooks/")
if as_objects:
return [DSSNotebook(self, notebook['projectKey'], notebook['name'], notebook) for notebook in notebook_list]
Expand Down