Skip to main content

Methods

Retrieves a list of all latest Clusters. 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

Returns

SyncPager[Cluster]
SyncPager[Cluster]
🔗 ClusterRetrieve latest Clusters. If pagination parameters are provided, 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.clusters.list(
    limit=10,
    offset=10,
)

# 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)
Create or Update cluster with provided manifest

Parameters

manifest
ClusterManifest
required
🔗 ClusterManifestCluster manifest
dry_run
typing.Optional[bool]
Dry run the cluster creation/update

Returns

GetClusterResponse
GetClusterResponse
🔗 GetClusterResponseReturns newly created/updated cluster on success

Usage

from truefoundry import TrueFoundry

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

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

Parameters

id
str
required
Cluster id of the cluster

Returns

GetClusterResponse
GetClusterResponse
🔗 GetClusterResponseReturn the cluster associated with provided id

Usage

from truefoundry import TrueFoundry

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

client.clusters.get(
    id="id_value",
)
Delete cluster associated with provided cluster id

Parameters

id
str
required
Cluster id of the cluster

Returns

ClustersDeleteResponse
ClustersDeleteResponse
🔗 ClustersDeleteResponseReturns success message on successful deletion

Usage

from truefoundry import TrueFoundry

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

client.clusters.delete(
    id="id_value",
)
List addons for the provided cluster.Pagination is available based on query parameters.

Parameters

id
str
required
Cluster id of the cluster
limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip

Returns

ListClusterAddonsResponse
ListClusterAddonsResponse
🔗 ListClusterAddonsResponseReturns the list of addons for the cluster And also 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.clusters.get_addons(
    id="id_value",
    limit=10,
    offset=10,
)
Get the status of provided cluster

Parameters

id
str
required
Cluster id of the cluster

Returns

IsClusterConnectedResponse
IsClusterConnectedResponse
🔗 IsClusterConnectedResponseReturns the status of provided cluster

Usage

from truefoundry import TrueFoundry

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

client.clusters.is_connected(
    id="id_value",
)
I