Skip to content

Latest commit

 

History

History
133 lines (91 loc) · 1.88 KB

jupyter.md

File metadata and controls

133 lines (91 loc) · 1.88 KB
description
Interact with Jupyter app

Jupyter

{% embed url="https://jupyter.org/hub" %} Website {% endembed %}

Connect

{% hint style="danger" %} You must Connect before any other methods {% endhint %}

You should get your token here :

{% hint style="success" %} In Naas cloud you can connect without any argument it will find your token alone {% endhint %}

{% embed url="https://app.naas.ai/hub/token" %}

Connect to Jupyter instance

token = "*****"
jp = naas_drivers.jupyter.connect(token)

Get info

Get my profile

me = jp.get_me()

🔑 Admin

Only Naas admin can do it.

Get Users

users = jp.get_users()

Get one User

email = "[email protected]"
user = jp.get_user(email)

Create

email = "[email protected]"
password = "****"
user = jp.create_user(email, password)

Get Authorize

Get one Authorization for user.

email = "[email protected]"
is_authorize = jp.get_authorize_user(email)

Authorize

Authorize one user.

email = "[email protected]"
is_authorize = True
user = jp.change_authorize_user(email, is_authorize)

Active

check if user has running server

email = "[email protected]"
active = jp.is_user_active(email)

Change password

change password of one user

email = "[email protected]"
newPassowrd = "*****"
user = jp.change_password_user(email, newPassowrd)

Server uptime

email = "[email protected]"
uptime = jp.get_server_uptime(email)

Stop user

email = "[email protected]"
jp.stop_user(email)

Start user

email = "[email protected]"
jp.start_user(email)

Restart user

email = "[email protected]"
jp.restart_user(email)

Official documentation

{% embed url="https://jupyterhub.readthedocs.io/en/stable/reference/rest.html" %}