Skip to main content

Module clients.login

Functions

login

def login(environment: Optional[str] = None, token_provider: Optional[h2o_authn.provider.TokenProvider] = None, platform_token: Optional[str] = None, config_path: Optional[str] = None, verify_ssl: bool = True, ssl_ca_cert: Optional[str] = None) ‑> Clients

Initializes AI Engine Manager clients for H2O AI Cloud.

All arguments are optional. Configuration-less login is dependent on having the H2O CLI configured. See: https://docs.h2o.ai/h2o-ai-cloud/developerguide/cli#platform-tokenThe Discovery Service is used to discover the Notebook server endpoint. See: https://pypi.org/project/h2o-cloud-discovery/

Args
environment : str, optional
The H2O Cloud environment URL to use (e.g. https://cloud.h2o.ai). If left empty, the environment will be read from the H2O CLI configuration or environmental variables. Then, h2o-cloud-discovery will be used to discover the Notebook API server endpoint.
token_provider (TokenProvider, optional) = Token provider. Takes priority over platform_token argument.
platform_token : str, optional
H2O Platform Token. If neither 'token_provider' nor 'platform_token' is provided the platform token will be read from the H2O CLI configuration.
config_path
(str, optional): Path to the H2O AI Cloud configuration file. Defaults to '~/.h2oai/h2o-cli-config.toml'.
verify_ssl
Set to False to disable SSL certificate verification.
ssl_ca_cert
Path to a CA cert bundle with certificates of trusted CAs.
Raises
FileNotFoundError
When the H2O CLI configuration file is needed but cannot be found.
TomlDecodeError
When the H2O CLI configuration file is needed but cannot be processed.
LookupError
When the service endpoint cannot be discovered.
ConnectionError
When a communication with server failed.

login_custom

def login_custom(endpoint: str, refresh_token: str, issuer_url: str, client_id: str, client_secret: Optional[str] = None, verify_ssl: bool = True, ssl_ca_cert: Optional[str] = None) ‑> Clients

Initializes AI Engine Manager clients.

Args
endpoint : str
The Notebook API server endpoint URL (e.g. https://notebook-api.cloud.h2o.ai).
refresh_token : str
The OIDC refresh token.
issuer_url : str
The OIDC issuer URL.
client_id : str
The OIDC Client ID that issued the 'refresh_token'.
client_secret : str, optional
Optional OIDC Client Secret that issued the 'refresh_token'. Defaults to None.
verify_ssl
Set to False to disable SSL certificate verification.
ssl_ca_cert
Path to a CA cert bundle with certificates of trusted CAs.

Classes

Clients

class Clients(kernel_template_client: h2o_notebook.clients.kernel_template.client.KernelTemplateClient, kernel_image_client: h2o_notebook.clients.kernel_image.client.KernelImageClient, notebook_kernel_spec_client: h2o_notebook.clients.notebook_kernel_spec.client.NotebookKernelSpecClient, kernel_task_client: h2o_notebook.clients.kernel_task.client.KernelTaskClient, kernel_client: h2o_notebook.clients.kernel.client.KernelClient)

Feedback