Skip to main content

Module clients.kernel_task.client

Classes

KernelTaskClient

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

KernelTaskClient manages Python kernel tasks.

Methods

cancel_kernel_task

def cancel_kernel_task(self, name: str)

Cancels a KernelTask.

Args
name : str
The name of the KernelTask. Format is workspaces/*/kernels/*/tasks/*.

create_kernel_task

def create_kernel_task(self, parent: str, kernel_task: h2o_notebook.clients.kernel_task.kernel_task.KernelTask, kernel_task_id: str = '') ‑> h2o_notebook.clients.kernel_task.kernel_task.KernelTask

Creates a KernelTask.

Args
parent : str
The resource name of the Kernel to create the KernelTask in. Format is workspaces/*/kernels/*.
kernel_task : KernelTask
The KernelTask resource to create.
kernel_task_id : str, optional
The ID to use for the KernelTask, which will become the final component of the image's resource name. If left unspecified, the server will generate a random value. 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
KernelTask
KernelTask object.

get_kernel_task

def get_kernel_task(self, name: str) ‑> h2o_notebook.clients.kernel_task.kernel_task.KernelTask

Returns a KernelTask.

Args
name : str
The name of the KernelTask. Format is workspaces/*/kernels/*/tasks/*.
Returns
KernelTask
KernelTask object.

get_kernel_task_output

def get_kernel_task_output(self, kernel_task_name: str) ‑> h2o_notebook.clients.kernel_task_output.kernel_task_output.KernelTaskOutput

Get KernelTaskOutput.

Args
kernel_task_name : str
KernelTask resource name. Format is workspaces/*/kernels/*/tasks/*.
Returns
KernelTaskOutput
KernelTaskOutput from KernelTask.

list_all_kernel_task_messages

def list_all_kernel_task_messages(self, kernel_task_name: str) ‑> List[h2o_notebook.clients.kernel_task_message.kernel_task_message.KernelTaskMessage]

List all KernelTaskMessages.

Args
kernel_task_name : str
The resource name of the KernelTask to list KernelTaskMessages from. Format is workspaces/*/kernels/*/tasks/*.
Returns

List of KernelTaskMessages.

list_all_kernel_tasks

def list_all_kernel_tasks(self, parent: str) ‑> List[h2o_notebook.clients.kernel_task.kernel_task.KernelTask]

List all KernelTasks.

Args
parent : str
The resource name of the Kernel to list KernelTasks from. Format is workspaces/*/kernels/*.
Returns

List of KernelTask.

list_kernel_task_messages

def list_kernel_task_messages(self, kernel_task_name: str, page_size: int = 0, page_token: str = '') ‑> h2o_notebook.clients.kernel_task_message.page.KernelTaskMessagesPage

Lists KernelTaskMessages.

Args
kernel_task_name : str
The resource name of the KernelTask to list KernelTaskMessages from. Format is workspaces/*/kernels/*/tasks/*.
page_size : int
Maximum number of KernelTaskMessages to return in a response. If unspecified (or set to 0), at most 50 KernelTaskMessages 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 KernelTaskMessagesPage.
Returns
KernelTaskMessagesPage
KernelTaskMessagesPage object.

list_kernel_tasks

def list_kernel_tasks(self, parent: str, page_size: int = 0, page_token: str = '') ‑> h2o_notebook.clients.kernel_task.page.KernelTasksPage

Lists KernelTasks.

Args
parent : str
The resource name of the Kernel to list KernelTasks from. Format is workspaces/*/kernels/*.
page_size : int
Maximum number of KernelTasks to return in a response. If unspecified (or set to 0), at most 50 KernelTasks 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 KernelTasksPage.
Returns
KernelTasksPage
KernelTasksPage object.

wait_task_completed

def wait_task_completed(self, name: str, timeout_seconds: Optional[float] = None) ‑> h2o_notebook.clients.kernel_task.kernel_task.KernelTask

Wait until the KernelTask is completed.

Args
name : str
The name of the KernelTask. Format is workspaces/*/kernels/*/tasks/*.

timeout_seconds (Optional[float], optional). Timeout in seconds. If not specified, will wait indefinitely.


Feedback