Skip to main content

Module clients.kernel_template.client

Classes

KernelTemplateClient

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

KernelTemplateClient manages Python kernel templates.

Methods

apply_default_kernel_templates

def apply_default_kernel_templates(self, kernel_template_configs: List[h2o_notebook.clients.kernel_template.kernel_template_config.KernelTemplateConfig]) ‑> List[h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate]

Set all KernelTemplates in a default workspace to a state defined in kernel_template_configs. KernelTemplates not specified in the kernel_template_configs will be deleted. KernelTemplates specified in the kernel_template_configs will be recreated with the new values.

Args
kernel_template_configs
configuration of KernelTemplates that should be applied.

Returns: applied KernelTemplates

apply_global_kernel_templates

def apply_global_kernel_templates(self, kernel_template_configs: List[h2o_notebook.clients.kernel_template.kernel_template_config.KernelTemplateConfig]) ‑> List[h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate]

Super-admin only. Set all KernelTemplates in a global workspace to a state defined in kernel_template_configs. KernelTemplates not specified in the kernel_template_configs will be deleted. KernelTemplates specified in the kernel_template_configs will be recreated with the new values.

Args
kernel_template_configs
configuration of KernelTemplates that should be applied.

Returns: applied KernelTemplates

apply_kernel_templates

def apply_kernel_templates(self, kernel_template_configs: List[h2o_notebook.clients.kernel_template.kernel_template_config.KernelTemplateConfig], parent: str) ‑> List[h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate]

Helper function for applying KernelTemplates.

create_kernel_template

def create_kernel_template(self, parent: str, kernel_template: h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate, kernel_template_id: str) ‑> h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate

Creates a KernelTemplate.

Args
parent : str
The resource name of the workspace to associate with the KernelTemplate. Format is workspaces/*.
kernel_template : KernelTemplate
KernelTemplate to create.
kernel_template_id : str
The ID to use for the KernelTemplate, which will become the final component of the template'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
Returns
KernelTemplate
KernelTemplate object.

delete_all_kernel_templates

def delete_all_kernel_templates(self, parent: str) ‑> None

Helper function for deleting all KernelTemplates.

delete_kernel_template

def delete_kernel_template(self, name: str) ‑> None

Deletes a KernelTemplate.

Args
name : str
Name of the KernelTemplate to delete. Format is workspaces/*/kernelTemplates/*

get_kernel_template

def get_kernel_template(self, name: str) ‑> h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate

Returns a KernelTemplate.

Args
name : str
Name of the KernelTemplate to retrieve. Format is workspaces/*/kernelTemplates/*
Returns
KernelTemplate
KernelTemplate object.

list_all_kernel_templates

def list_all_kernel_templates(self, parent: str) ‑> List[h2o_notebook.clients.kernel_template.kernel_template.KernelTemplate]

List all KernelTemplates.

Args
parent : str
The resource name of the workspace from which to list KernelTemplates. Format is workspaces/*.
Returns

List of KernelTemplate.

list_kernel_templates

def list_kernel_templates(self, parent: str, page_size: int = 0, page_token: str = '') ‑> h2o_notebook.clients.kernel_template.page.KernelTemplatesPage

Lists KernelTemplates.

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

Feedback