Module clients.login
Functions
login
def login(environment: Optional[str] = None, token_provider: Optional[h2o_authn.provider.TokenProvider] = None, platform_token: Optional[str] = None, default_workspace_id: str = 'default', 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 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 (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.
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'.
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, default_workspace_id: str = 'default', verify_ssl: bool = True, ssl_ca_cert: Optional[str] = None) ‑> 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
. 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(dai_engine_client: h2o_engine_manager.clients.dai_engine.dai_engine_client.DAIEngineClient, h2o_engine_client: h2o_engine_manager.clients.h2o_engine.client.H2OEngineClient, dai_profile_client: h2o_engine_manager.clients.dai_profile.client.DAIProfileClient, internal_dai_version_client: h2o_engine_manager.clients.internal_dai_version.client.InternalDAIVersionClient, internal_h2o_version_client: h2o_engine_manager.clients.internal_h2o_version.client.InternalH2OVersionClient, dai_setup_client: h2o_engine_manager.clients.dai_setup.client.DAISetupClient, h2o_setup_client: h2o_engine_manager.clients.h2o_setup.client.H2OSetupClient)
Feedback
- Submit and view feedback for this page
- Send feedback about AI Engine Manager to cloud-feedback@h2o.ai