Skip to main content

Module clients.dai_profile.client

Classes

DAIProfileClient

class DAIProfileClient(connection_config: h2o_engine_manager.clients.connection_config.ConnectionConfig, verify_ssl: bool = True, ssl_ca_cert: Optional[str] = None)

DAIProfileClient manages DAIProfiles.

Initializes DAIProfileClient. Do not initialize manually, use h2o_engine_manager.login() instead.

Args
connection_config : ConnectionConfig
AIEM connection configuration object.
verify_ssl
Set to False to disable SSL certificate verification.
ssl_ca_cert
Path to a CA cert bundle with certificates of trusted CAs.

Methods

apply_dai_profiles

def apply_dai_profiles(self, dai_profile_configs: List[h2o_engine_manager.clients.dai_profile.profile_config.DAIProfileConfig]) ‑> List[h2o_engine_manager.clients.dai_profile.profile.DAIProfile]

Set all DAIProfiles to a state defined in the dai_profile_configs. DAIProfiles not specified in the dai_profile_configs will be deleted. DAIProfiles specified in the dai_profile_configs will be recreated with the new values. Order of DAIProfiles will be exactly as provided in the dai_profile_configs.

Args
dai_profile_configs
configuration of DAIProfile that should be applied.

Returns: applied DAIProfiles

create_profile

def create_profile(self, profile_id: str, cpu: int, gpu: int, memory_bytes: str, storage_bytes: str, display_name: str = '') ‑> h2o_engine_manager.clients.dai_profile.profile.DAIProfile

Creates Driverless AI profile.

Args
profile_id : str, optional

The ID to use for the Driverless AI profile, which will become the final component of the profile's resource name. This value must:

  • contain 1-63 characters
  • contain only lowercase alphanumeric characters or hyphen ('-')
  • start with an alphabetic character
  • end with an alphanumeric character
cpu : int, optional
The amount of CPU units set for the profile.
gpu : int, optional
Number of nvidia.com/gpu Kubernetes resource units.
memory_bytes : str, optional

Quantity of bytes. Example 8G, 16Gi. Detailed syntax:

  • [quantity] = [number][suffix]
  • [suffix] = [binarySI] | [decimalSI]
  • [binarySI] = Ki | Mi | Gi | Ti | Pi
  • [decimalSI] = k | M | G | T | P
storage_bytes : str, optional
Quantity of bytes. Example 250G, 2T. Same syntax applies as memory_bytes parameter.
display_name : str, optional
Human-readable name of the DAIProfile. Must contain at most 63 characters. Does not have to be unique.
Returns
DAIProfile
Driverless AI profile.

delete_all_profiles

def delete_all_profiles(self) ‑> None

Help function for deleting all DAIProfiles.

delete_profile

def delete_profile(self, profile_id: str) ‑> None

Deletes a profile.

Args
profile_id : str
The ID of an profile.

get_profile

def get_profile(self, profile_id: str) ‑> h2o_engine_manager.clients.dai_profile.profile.DAIProfile

Returns a specific profile.

Args
profile_id : str
The ID of an profile.
Returns
DAIProfile
Driverless AI profile.

list_all_profiles

def list_all_profiles(self) ‑> List[h2o_engine_manager.clients.dai_profile.profile.DAIProfile]

Returns a list of all profiles.

Returns
List[DAIProfile]
A list of Driverless AI profiles.

list_profiles

def list_profiles(self, page_size: int = 0, page_token: str = '') ‑> h2o_engine_manager.clients.dai_profile.profile_page.DAIProfilesPage

Returns a list of profiles.

Args
page_size : int, optional
Maximum number of DAIProfiles to return in a response. If unspecified (or set to 0), at most 50 DAIProfiles will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
page_token : str, optional
Leave unset to receive the initial page. To list any subsequent pages use the value of 'next_page_token' returned from the DAIProfilesPage.
Returns
DAIProfilesPage
A list of Driverless AI profiles together with a next_page_token for the next page.

reorder_profile

def reorder_profile(self, profile_id: str, new_order: int) ‑> List[h2o_engine_manager.clients.dai_profile.profile.DAIProfile]

Change order of a DAIProfile. Changing DAIProfile's order may result in changing order of other DAIProfiles.

Args
profile_id : str
profile ID
new_order : int
new profile order
Returns

All DAIProfiles after reorder.

update_profile

def update_profile(self, profile: h2o_engine_manager.clients.dai_profile.profile.DAIProfile, update_mask: str = '*') ‑> h2o_engine_manager.clients.dai_profile.profile.DAIProfile

Updates the profile.

Args
profile : DAIProfile
The profile to be updated.
update_mask : str, optional

Comma separated paths referencing which fields to update. Update mask must be non-empty.

Allowed field paths are: display_name. Paths are case sensitive (must match exactly). Example - update only cpu: update_mask="cpu" Example - update only cpu and gpu: update_mask="cpu,gpu"

To update all allowed fields, specify exactly one path with value "*", this is a default value.

Returns
DAIProfile
An updated Driverless AI profile.

Feedback