Skip to main content

Methods

List workspaces associated with the user. Optional filters include clusterId, fqn, and workspace name. Pagination is available based on query parameters.

Parameters

limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip
cluster_id
typing.Optional[str]
ClusterId of the Cluster
name
typing.Optional[str]
Workspace Name
fqn
typing.Optional[str]
Workspace FQN

Returns

SyncPager[Workspace]
SyncPager[Workspace]
🔗 WorkspaceReturns all the workspaces associated with a user and also the response includes paginated data.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.workspaces.list(
    limit=10,
    offset=10,
    cluster_id="cluster_id_value",
    name="value",
    fqn="value",
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Creates a new workspace or updates an existing one based on the provided manifest.

Parameters

manifest
WorkspaceManifest
required
🔗 WorkspaceManifestWorkspace manifest
dry_run
typing.Optional[bool]
Dry run the request

Returns

GetWorkspaceResponse
GetWorkspaceResponse
🔗 GetWorkspaceResponse
  • Creates or updates a workspace with given manifest
  • Corresponding authorization entry with admin role is made using newly created workspace
  • Attached with the cluster id where the workspace is created

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.workspaces.create_or_update(
    manifest={"key": "value"},
    dry_run=False,
)
Get workspace associated with provided workspace id

Parameters

id
str
required
Workspace id of the space

Returns

GetWorkspaceResponse
GetWorkspaceResponse
🔗 GetWorkspaceResponseReturns the workspaces associated with provided workspace id

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.workspaces.get(
    id="id_value",
)
Deletes the workspace with the given workspace ID.

Parameters

id
str
required
Workspace id of the space

Returns

WorkspacesDeleteResponse
WorkspacesDeleteResponse
🔗 WorkspacesDeleteResponseSuccessfully deletes the workspace and returns the workspace details along with a confirmation message.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.workspaces.delete(
    id="id_value",
)
Get Workspace by FQN.

Parameters

fqn
str
required
FQN of the workspace

Returns

GetWorkspaceResponse
GetWorkspaceResponse
🔗 GetWorkspaceResponseWorkspace details

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.workspaces.get_by_fqn(
    fqn="value",
)
I