Connect to a Driverless AI server created by Steam in H2O AI Cloud¶
Prerequisites¶
- Python environment with
h2osteam
pip install https://enterprise-steam.s3.amazonaws.com/release/1.9.4/python/h2osteam-1.9.4-py2.py3-none-any.whl
- Alternatively, download the python client from the Steam GUI and install it
- Personal Access Token (PAT) from Steam Server
- Go to https://steam.cloud-qa.h2o.ai/ and log in
- Go to the
Configurations
tab and clickAPI Token
>Get Token
- Copy the generated PAT token
In [1]:
Copied!
import h2osteam
import h2osteam
In [2]:
Copied!
# Log in to Steam
h2osteam.login(
url="https://steam.cloud-qa.h2o.ai/",
username="your email address / username",
password="PAT Token"
)
# Log in to Steam
h2osteam.login(
url="https://steam.cloud-qa.h2o.ai/",
username="your email address / username",
password="PAT Token"
)
Out[2]:
<h2osteam.backend.connection.SteamConnection at 0x7f482013aa90>
In [3]:
Copied!
# Get steam driverlessai client
dai_steam_client = h2osteam.clients.DriverlessClient()
# Get steam driverlessai client
dai_steam_client = h2osteam.clients.DriverlessClient()
In [4]:
Copied!
# Get DAI instance and connect to it
dai_client = dai_steam_client.get_instance("python-client-test").connect()
# Get DAI instance and connect to it
dai_client = dai_steam_client.get_instance("python-client-test").connect()
In [5]:
Copied!
# Perform any driverlessai python client operation using the client
# (Example) Create dataset
data_key = dai_client.datasets.create("~/datasets/BostonHousing_JpCols.csv", force=True)
# Perform any driverlessai python client operation using the client
# (Example) Create dataset
data_key = dai_client.datasets.create("~/datasets/BostonHousing_JpCols.csv", force=True)
Complete 100.00% - [4/4] Computed stats for column 低所得
In [6]:
Copied!
# (Example) List datasets
dai_client.datasets.list()
# (Example) List datasets
dai_client.datasets.list()
Out[6]:
| Type | Key | Name ----+---------+--------------------------------------+-------------------------- 0 | Dataset | c3b306f4-f625-11ed-89fd-fa423dee37e0 | BostonHousing_JpCols.csv