Skip to main content
Version: v1.0.22

Manage Workspaces

This guide explains how to create, view, update, and delete workspaces in H2O using the H2O MLOps Python client.

To learn more about workspaces, see Workspaces.

Prerequisites​

Before you begin,

Create a workspace​

This section describes how to create a new workspace in H2O using the H2O MLOps Python client.

Create a new workspace using the create() method.

workspace = mlops.workspaces.create(name="my-workspace", description="my-workspace")

Parameters:

  • name: The name of the workspace.
  • description: A short description of the workspace.

View workspaces​

This section describes how to view existing workspaces in H2O using the H2O MLOps Python client.

Count workspaces​

Get the total number of workspaces:

Input:

mlops.workspaces.count()

Output:

4

List all workspaces​

List all existing workspaces using the list() method.

Input:

workspaces = mlops.workspaces.list()
workspaces

This returns a list of all available workspaces.

Output:

| name | uid
---+--------------------+--------------------------------------
0 | my-workspace | 7bdc6a96-804e-452a-b7dd-8afc1968b3d9
1 | dummy | 559140a8-34de-48f1-ab55-27d805d2f197
2 | Personal Workspace | 92fb7ec4-a011-46b1-bff4-4669d9ab17ee
3 | Appstore Workspace | appstore
note
  • The output of list() method is displayed in a neatly formatted view. By default, only the first 50 rows are displayed to keep the output concise and manageable.

  • Calling len(workspaces) returns the total number of rows it contains, not just the number currently displayed.

  • To customize the number of rows displayed, you can call the show() method with the n argument. This allows more rows to be shown when needed. For example:

    workspaces.show(n=100)

    This will display up to 100 workspaces.

  • The workspaces can be iterated over, as it is designed to behave like an iterator.

List workspace aggregates​

Use the aggregates() method to view workspaces along with the number of models, model versions, and attached experiments.

Input:

mlops.workspaces.aggregates()

Output:

| name | versions | models | experiments | uid
---+--------------------+------------+----------+---------------+--------------------------------------
0 | my-workspace | 0 | 0 | 0 | 7bdc6a96-804e-452a-b7dd-8afc1968b3d9
1 | dummy | 2 | 1 | 2 | 559140a8-34de-48f1-ab55-27d805d2f197
2 | Personal Workspace | 0 | 0 | 0 | 92fb7ec4-a011-46b1-bff4-4669d9ab17ee

Filter workspaces​

Use the list() method with key-value arguments to filter the workspaces.

Input:

mlops.workspaces.list(name="my-workspace")

This returns a list of matching workspaces as a table.

Output:

| name | uid
---+--------------+--------------------------------------
0 | my-workspace | 7bdc6a96-804e-452a-b7dd-8afc1968b3d9

Retrieve a workspace​

To retrieve a specific workspace, use the get() method with the workspace UID.

Input:

workspace = mlops.workspaces.get(uid="7bdc6a96-804e-452a-b7dd-8afc1968b3d9")
workspace
note

You can also retrieve a specific workspace from the list returned by list() using indexing.
For example, workspace = mlops.workspaces.list(key=value)[index]. The key and value arguments are optional.

Output:

<class 'h2o_mlops._workspaces.Workspace(
uid='7bdc6a96-804e-452a-b7dd-8afc1968b3d9',
name='my-workspace',
description='my-workspace',
creator_uid='4c4eb198-bcbc-4442-91f6-a27deb53e9c1',
created_time=datetime.datetime(2025, 7, 17, 15, 43, 0, 583925, tzinfo=tzutc()),
last_modified_time=None,
)'>

Workspace properties​

A workspace has the following main properties:

  • uid: The unique identifier of the workspace.
  • name: The name of the workspace.
  • description: A description of the workspace.
  • creator: The user who created the workspace.
  • created_time: The timestamp when the workspace was created.
  • last_modified_time: The timestamp of the last modification.
  • last_modified_by: The user who made the last modification.

Aggregate​

You can use workspace.aggregate to retrieve the number of:

  • Versions
  • Models
  • Experiments

Input:

workspace.aggregate

Output:

| entity | count
---+-------------+---------
0 | versions | 0
1 | models | 0
2 | experiments | 0

Update a workspace​

You can update only the name and description fields of a workspace.

Make sure to retrieve the workspace instance as described in Retrieve a workspace before proceeding.

Input:

workspace.update(name="my-new-workspace")
workspace

Output:

<class 'h2o_mlops._workspaces.Workspace(
uid='7bdc6a96-804e-452a-b7dd-8afc1968b3d9',
name='my-new-workspace',
description='my-workspace',
creator_uid='4c4eb198-bcbc-4442-91f6-a27deb53e9c1',
created_time=datetime.datetime(2025, 7, 17, 15, 43, 0, 583925, tzinfo=tzutc()),
last_modified_time=datetime.datetime(2025, 7, 17, 15, 43, 4, 696432, tzinfo=tzutc()),
)'>

Delete a workspace​

warning

Deleting a workspace also deletes all entities within it.

To delete a workspace, use the delete() method:

Input:

workspace.delete()

Feedback