Module login
Functions
login
def login(environment: Optional[str] = None, token_provider: Callable[[], str] = None, platform_token: Optional[str] = None, default_workspace_id: str = 'default', config_path: str = '~/.h2oai/h2o-cli-config.toml') ‑> 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 Engine Manager service 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 Engine Manager service endpoint.
- token_provider (Callable[[], str], optional) = A callable function providing access token.
- 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.
default_workspace_id:str, optional- The default workspace ID which will client use to manipulate with resources. Defaults to
default. config_path- (str, optional): Path to the H2O AI Cloud configuration file. Defaults to '~/.h2oai/h2o-cli-config.toml'.
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, default_workspace_id: str = 'default') ‑> Clients
Initializes AI Engine Manager clients.
Args
endpoint:str- The Engine Manager service endpoint URL (e.g. https://enginemanager.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.
default_workspace_id:str, optional- The default workspace ID which will client use to manipulate with resources. Defaults to
default.
Classes
Clients
class Clients(dai_engine_client: h2o_engine_manager.clients.dai_engine.dai_engine_client.DAIEngineClient, h2o_engine_client: h2o_engine_manager.clients.h2o_engine.client.H2OEngineClient)
Feedback
- Submit and view feedback for this page
- Send feedback about AI Engine Manager to cloud-feedback@h2o.ai