Module clients.kernel.client
Classes
KernelClient
class KernelClient(connection_config: h2o_notebook.clients.connection_config.ConnectionConfig, verify_ssl: bool = True, ssl_ca_cert: Optional[str] = None)
KernelClient manages Python kernels.
Methods
create_kernel
def create_kernel(self, parent: str, kernel: h2o_notebook.clients.kernel.kernel.Kernel, kernel_id: str = '') ‑> h2o_notebook.clients.kernel.kernel.Kernel
Creates a Kernel.
Args
parent
:str
- The resource name of the workspace to associate with the Kernel. Format is
workspaces/*
. kernel
:Kernel
- Kernel to create.
kernel_id
:str
, optional- The ID to use for the Kernel, which will become the final component of the kernel's resource name. If left unspecified, the server will generate one. This value must: - contain 1-63 characters - contain only lowercase alphanumeric characters or hyphen ('-') - start with an alphabetic character - end with an alphanumeric character
Returns
Kernel
- Kernel object.
delete_all_kernels
def delete_all_kernels(self, parent: str) ‑> None
Helper function for deleting all Kernels.
Args
parent
:str
- The resource name of the workspace from which to delete all Kernels. Format is
workspaces/*
.
delete_kernel
def delete_kernel(self, name: str) ‑> None
get_kernel
list_all_kernels
list_kernels
def list_kernels(self, parent: str, page_size: int = 0, page_token: str = '') ‑> h2o_notebook.clients.kernel.page.KernelsPage
Lists Kernels.
Args
parent
:str
- The resource name of the workspace from which to list Kernels. Format is
workspaces/*
. page_size
:int
- Maximum number of Kernels to return in a response. If unspecified (or set to 0), at most 50 Kernels will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
page_token
:str
- Page token. Leave unset to receive the initial page. To list any subsequent pages use the value of 'next_page_token' returned from the KernelsPage.
Returns
KernelsPage
- KernelsPage object.
terminate_kernel
def terminate_kernel(self, name: str) ‑> h2o_notebook.clients.kernel.kernel.Kernel
Terminates a Kernel.
Args
name
:str
- The resource name of the Kernel. Format is
workspaces/*/kernels/*
.
wait_all_kernels_deleted
def wait_all_kernels_deleted(self, parent: str, timeout_seconds: Optional[float] = None) ‑> None
Waits for all Kernels to be deleted.
Args
parent
:str
- The resource name of the workspace from which to delete all Kernels. Format is
workspaces/*
. timeout_seconds
:float
, optional- Timeout in seconds. If not specified, will wait indefinitely.
wait_kernel_deleted
def wait_kernel_deleted(self, name: str, timeout_seconds: Optional[float] = None) ‑> None
Waits for a Kernel to be deleted.
Args
name
:str
- The resource name of the Kernel. Format is
workspaces/*/kernels/*
. timeout_seconds
:float
, optional- Timeout in seconds. If not specified, will wait indefinitely.
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Notebook Labs to cloud-feedback@h2o.ai