Skip to content

Latest commit

 

History

History
11541 lines (8118 loc) · 148 KB

File metadata and controls

11541 lines (8118 loc) · 148 KB

Reference

client.apply(...) -> AsyncHttpResponse[TrueFoundryApplyResponse]

📝 Description

Applies a given manifest to create or update resources of specific types, such as provider-account, cluster, workspace, or ml-repo.

🔌 Usage

from truefoundry_sdk import Collaborator, MlRepoManifest, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.apply(
    manifest=MlRepoManifest(
        name="name",
        storage_integration_fqn="storage_integration_fqn",
        collaborators=[
            Collaborator(
                subject="subject",
                role_id="role_id",
            )
        ],
    ),
)

⚙️ Parameters

manifest: TrueFoundryApplyRequestManifest — manifest of the resource to be created or updated

dry_run: typing.Optional[bool] — Dry run the apply operation without actually applying

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.delete(...) -> AsyncHttpResponse[None]

📝 Description

Deletes resources of specific types, such as provider-account, cluster, workspace, or application.

🔌 Usage

from truefoundry_sdk import Collaborator, MlRepoManifest, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.delete(
    manifest=MlRepoManifest(
        name="name",
        storage_integration_fqn="storage_integration_fqn",
        collaborators=[
            Collaborator(
                subject="subject",
                role_id="role_id",
            )
        ],
    ),
)

⚙️ Parameters

manifest: TrueFoundryDeleteRequestManifest — manifest of the resource to be deleted

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal

client.internal.get_id_from_fqn(...) -> AsyncHttpResponse[typing.Dict[str, typing.Any]]

📝 Description

Get IDs associated with the FQN for various entity types, such as deployment, application, workspace, or cluster.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

type: str — Entity Type

fqn: str — Entity FQN

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Users

client.users.list(...) -> AsyncPager[User, ListUsersResponse]

📝 Description

List all users of tenant filtered by query and showInvalidUsers. Pagination is available based on query parameters.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.users.list(
    limit=10,
    offset=0,
    query="query",
    show_invalid_users=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

query: typing.Optional[str]

show_invalid_users: typing.Optional[bool] — Show Deactivated users

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.pre_register_users(...) -> AsyncHttpResponse[RegisterUsersResponse]

📝 Description

This endpoint allows tenant administrators to register users within their tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

email: str — Email of the user

send_invite_email: typing.Optional[bool] — Send invite email if user does not exist

skip_if_user_exists: typing.Optional[bool] — Fail if user exists

dry_run: typing.Optional[bool] — Dry run

accept_invite_client_url: typing.Optional[str] — Url to redirect when invite is accepted

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.update_roles(...) -> AsyncHttpResponse[UpdateUserRolesResponse]

📝 Description

This endpoint allows tenant administrators to update the roles of a user within their tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.users.update_roles(
    email="email",
    roles=["roles"],
)

⚙️ Parameters

email: str — Email of the user

roles: typing.Sequence[str] — Role names for the user

resource_type: typing.Optional[str] — Resource Type

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.get(...) -> AsyncHttpResponse[GetUserResponse]

📝 Description

Get User associated with provided User id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — User Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.delete(...) -> AsyncHttpResponse[DeleteUserResponse]

📝 Description

Delete user if they are not a collaborator in any resource and not part of any team other than everyone.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — User Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.invite_user(...) -> AsyncHttpResponse[InviteUserResponse]

📝 Description

Invite a user to the tenant

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.users.invite_user(
    accept_invite_client_url="<control plane url>/invite-accept",
    email="email",
)

⚙️ Parameters

accept_invite_client_url: str — Url to redirect when invite is accepted

email: str — Email of user

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.deactivate(...) -> AsyncHttpResponse[DeactivateUserResponse]

📝 Description

Deactivate user associated with the provided email within the tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

email: str — Email of the user

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.activate(...) -> AsyncHttpResponse[ActivateUserResponse]

📝 Description

Activate user associated with the provided email within the tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

email: str — Email of the user

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.change_password(...) -> AsyncHttpResponse[ChangePasswordResponse]

📝 Description

Change password for the authenticated user. Requires clientId and loginId in the request body.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.users.change_password(
    login_id="loginId",
    new_password="newPassword",
    old_password="oldPassword",
)

⚙️ Parameters

login_id: str — login id of the user(email)

new_password: str — New password

old_password: str — Old password

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.get_resources(...) -> AsyncHttpResponse[GetUserResourcesResponse]

📝 Description

Get all resources associated with a user.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — User Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.get_teams(...) -> AsyncHttpResponse[GetUserTeamsResponse]

📝 Description

Get all manual teams associated with a user.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — User Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Teams

client.teams.list(...) -> AsyncPager[Team, ListTeamsResponse]

📝 Description

Retrieve all teams associated with the authenticated user. If the user is a tenant admin, returns all teams for the tenant. Pagination is available based on query parameters

🔌 Usage

from truefoundry_sdk import TrueFoundry
from truefoundry_sdk.teams import TeamsListRequestType

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.teams.list(
    limit=10,
    offset=0,
    type=TeamsListRequestType.TEAM,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

type: typing.Optional[TeamsListRequestType] — Filter teams by type

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.teams.create_or_update(...) -> AsyncHttpResponse[GetTeamResponse]

📝 Description

Creates a new team or updates an existing team. It ensures that the team name is unique, valid, and that the team has at least one member. The members of the team are added or updated based on the provided emails.

🔌 Usage

from truefoundry_sdk import TeamManifest, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.teams.create_or_update(
    manifest=TeamManifest(
        name="name",
        members=["members"],
    ),
)

⚙️ Parameters

manifest: TeamManifest — Team manifest

dry_run: typing.Optional[bool] — Dry run

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.teams.get(...) -> AsyncHttpResponse[GetTeamResponse]

📝 Description

Get Team associated with provided team id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Team Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.teams.delete(...) -> AsyncHttpResponse[DeleteTeamResponse]

📝 Description

Deletes the Team associated with the provided Id.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Team Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

PersonalAccessTokens

client.personal_access_tokens.list(...) -> AsyncPager[VirtualAccount, ListPersonalAccessTokenResponse]

📝 Description

List Personal Access Tokens created by the user in the current tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.personal_access_tokens.list(
    limit=10,
    offset=0,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.personal_access_tokens.create(...) -> AsyncHttpResponse[CreatePersonalAccessTokenResponse]

📝 Description

Create Personal Access Token

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

name: str — serviceaccount name

expiration_date: typing.Optional[str] — Expiration date in ISO format (e.g. 2025-08-01T12:00)

account_name: typing.Optional[str] — Account name that owns this PAT

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.personal_access_tokens.revoke_all(...) -> AsyncHttpResponse[RevokeAllPersonalAccessTokenResponse]

📝 Description

Revoke All Personal Access Tokens for the user with the given email

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

email: str — Email of the user to revoke all Personal Access Tokens for

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.personal_access_tokens.delete(...) -> AsyncHttpResponse[DeletePersonalAccessTokenResponse]

📝 Description

Delete Personal Access Token associated with the provided serviceAccountId

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — serviceaccount id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.personal_access_tokens.get(...) -> AsyncHttpResponse[GetOrCreatePersonalAccessTokenResponse]

📝 Description

Get an existing Personal Access Token by name, if it doesn't exist, it will create a new one and return the PAT data along with a fresh token.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

name: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

VirtualAccounts

client.virtual_accounts.list(...) -> AsyncPager[VirtualAccount, ListVirtualAccountResponse]

📝 Description

List virtual accounts for the tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.virtual_accounts.list(
    limit=10,
    offset=0,
    name_search_query="nameSearchQuery",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

name_search_query: typing.Optional[str] — Return virtual accounts with names that contain this string

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.create_or_update(...) -> AsyncHttpResponse[GetVirtualAccountResponse]

📝 Description

Creates a new virtual account or updates an existing one based on the provided manifest.

🔌 Usage

from truefoundry_sdk import Permissions, TrueFoundry, VirtualAccountManifest

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.virtual_accounts.create_or_update(
    manifest=VirtualAccountManifest(
        name="name",
        permissions=[
            Permissions(
                resource_fqn="resource_fqn",
                resource_type="resource_type",
                role_id="role_id",
            )
        ],
    ),
)

⚙️ Parameters

manifest: VirtualAccountManifest — Virtual account manifest

dry_run: typing.Optional[bool] — Dry run

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.get(...) -> AsyncHttpResponse[GetVirtualAccountResponse]

📝 Description

Get virtual account by id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — serviceaccount id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.delete(...) -> AsyncHttpResponse[DeleteVirtualAccountResponse]

📝 Description

Delete a virtual account associated with the provided virtual account id.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — serviceaccount id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.get_token(...) -> AsyncHttpResponse[GetTokenForVirtualAccountResponse]

📝 Description

Get token for a virtual account by id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — serviceaccount id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.sync_to_secret_store(...) -> AsyncHttpResponse[SyncVirtualAccountTokenResponse]

📝 Description

Syncs the virtual account token to the configured secret store. Returns the updated JWT with sync metadata including timestamp and error (if any).

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — serviceaccount id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.regenerate_token(...) -> AsyncHttpResponse[GetTokenForVirtualAccountResponse]

📝 Description

Regenerate token for a virtual account by id. The old token will remain valid for the specified grace period.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.virtual_accounts.regenerate_token(
    id="id",
    grace_period_in_days=30.0,
)

⚙️ Parameters

id: str — serviceaccount id

grace_period_in_days: float — Grace period in days for which the old token will remain valid after regeneration

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.virtual_accounts.delete_jwt(...) -> AsyncHttpResponse[None]

📝 Description

Delete a JWT for a virtual account by id

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.virtual_accounts.delete_jwt(
    id="id",
    jwt_id="jwtId",
)

⚙️ Parameters

id: str — virtual account id

jwt_id: str — JWT id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Clusters

client.clusters.list(...) -> AsyncPager[Cluster, ListClustersResponse]

📝 Description

Retrieves a list of all latest Clusters. Pagination is available based on query parameters.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.clusters.list(
    limit=10,
    offset=0,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.clusters.create_or_update(...) -> AsyncHttpResponse[GetClusterResponse]

📝 Description

Create or Update cluster with provided manifest

🔌 Usage

from truefoundry_sdk import (
    ClusterManifest,
    ClusterManifestClusterType,
    Collaborator,
    TrueFoundry,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.clusters.create_or_update(
    manifest=ClusterManifest(
        name="name",
        cluster_type=ClusterManifestClusterType.AWS_EKS,
        environment_names=["environment_names"],
        collaborators=[
            Collaborator(
                subject="subject",
                role_id="role_id",
            )
        ],
    ),
)

⚙️ Parameters

manifest: ClusterManifest — Cluster manifest

dry_run: typing.Optional[bool] — Dry run the cluster creation/update

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.clusters.get(...) -> AsyncHttpResponse[GetClusterResponse]

📝 Description

Get cluster associated with provided id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Cluster id of the cluster

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.clusters.delete(...) -> AsyncHttpResponse[ClustersDeleteResponse]

📝 Description

Delete cluster associated with provided cluster id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Cluster id of the cluster

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.clusters.get_addons(...) -> AsyncHttpResponse[ListClusterAddonsResponse]

📝 Description

List addons for the provided cluster. Pagination is available based on query parameters.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.clusters.get_addons(
    id="id",
    limit=10,
    offset=0,
)

⚙️ Parameters

id: str — Cluster id of the cluster

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.clusters.is_connected(...) -> AsyncHttpResponse[IsClusterConnectedResponse]

📝 Description

Get the status of provided cluster

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Cluster id of the cluster

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Environments

client.environments.list(...) -> AsyncPager[Environment, ListEnvironmentsResponse]

📝 Description

List environments, if no environments are found, default environments are created and returned. Pagination is available based on query parameters

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.environments.list(
    limit=10,
    offset=0,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.environments.create_or_update(...) -> AsyncHttpResponse[GetEnvironmentResponse]

📝 Description

Creates a new Environment or updates an existing Environment.

🔌 Usage

from truefoundry_sdk import (
    EnvironmentColor,
    EnvironmentManifest,
    EnvironmentOptimizeFor,
    TrueFoundry,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.environments.create_or_update(
    manifest=EnvironmentManifest(
        name="name",
        color=EnvironmentColor(),
        is_production=True,
        optimize_for=EnvironmentOptimizeFor.COST,
    ),
)

⚙️ Parameters

manifest: EnvironmentManifest — Environment Manifest

dry_run: typing.Optional[bool] — Dry run

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.environments.get(...) -> AsyncHttpResponse[GetEnvironmentResponse]

📝 Description

Get Environment associated with the provided id.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Environment id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.environments.delete(...) -> AsyncHttpResponse[bool]

📝 Description

Delete Environment associated with the provided id.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Environment id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Applications

client.applications.list(...) -> AsyncPager[Application, ListApplicationsResponse]

📝 Description

Retrieves a list of all latest applications. Supports filtering by application ID, name, type, and other parameters. Pagination is available based on query parameters.

🔌 Usage

from truefoundry_sdk import TrueFoundry
from truefoundry_sdk.applications import (
    ApplicationsListRequestDeviceTypeFilter,
    ApplicationsListRequestLifecycleStage,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.applications.list(
    limit=10,
    offset=0,
    application_id="applicationId",
    workspace_id="workspaceId",
    application_name="applicationName",
    fqn="fqn",
    workspace_fqn="workspaceFqn",
    application_type="applicationType",
    name_search_query="nameSearchQuery",
    environment_id="environmentId",
    cluster_id="clusterId",
    application_set_id="applicationSetId",
    paused=True,
    device_type_filter=ApplicationsListRequestDeviceTypeFilter.CPU,
    last_deployed_by_subjects="lastDeployedBySubjects",
    lifecycle_stage=ApplicationsListRequestLifecycleStage.ACTIVE,
    is_recommendation_present_and_visible=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

application_id: typing.Optional[str] — Application id of the application

workspace_id: typing.Optional[str] — Workspace id of the application (comma separated for multiple)

application_name: typing.Optional[str] — Name of application

fqn: typing.Optional[str] — Fully qualified name (FQN) of the application

workspace_fqn: typing.Optional[str] — Fully qualified name (FQN) of the workspace

application_type: typing.Optional[str] — Type of application (comma separated for multiple). Allowed Values: async-service, service, job, spark-job, helm, notebook, codeserver, rstudio, ssh-server, volume, application, application-set, intercept, workflow

name_search_query: typing.Optional[str] — Search query for application name

environment_id: typing.Optional[str] — Filter by Environment ids of the application (comma separated for multiple)

cluster_id: typing.Optional[str] — Filter by Cluster ids of the application (comma separated for multiple)

application_set_id: typing.Optional[str] — Filter by Application Set id of the application

paused: typing.Optional[bool] — Filter by Application Paused status

device_type_filter: typing.Optional[ApplicationsListRequestDeviceTypeFilter] — Filter by device type of the application. Allowed values: cpu, nvidia_gpu, aws_inferentia, nvidia_mig_gpu, nvidia_timeslicing_gpu, gcp_tpu

last_deployed_by_subjects: typing.Optional[str] — Filter by last deployed by specific users

lifecycle_stage: typing.Optional[ApplicationsListRequestLifecycleStage] — Filter by application lifecycle state

is_recommendation_present_and_visible: typing.Optional[bool] — Filter out applications with recommendations that are allowed to be shown

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.create_or_update(...) -> AsyncHttpResponse[GetApplicationDeploymentResponse]

📝 Description

Create a new Application Deployment based on the provided manifest.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.applications.create_or_update(
    manifest={"key": "value"},
)

⚙️ Parameters

manifest: typing.Dict[str, typing.Any] — Manifest of application

dry_run: typing.Optional[bool] — Dry run

force_deploy: typing.Optional[bool] — Cancels any ongoing deployments

trigger_on_deploy: typing.Optional[bool] — Trigger on deploy

workspace_id: typing.Optional[str] — workspace id of the workspace

application_id: typing.Optional[str] — Id of the application

name: typing.Optional[str] — Name of application

application_set_id: typing.Optional[str] — Application Set Id

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.get(...) -> AsyncHttpResponse[GetApplicationResponse]

📝 Description

Get Application associated with the provided application ID.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Id of the application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.delete(...) -> AsyncHttpResponse[DeleteApplicationResponse]

📝 Description

Delete Application associated with the provided application ID.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Id of the application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.redeploy(...) -> AsyncHttpResponse[GetApplicationDeploymentResponse]

📝 Description

Creates a new deployment with the same manifest as the given deployment.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.applications.redeploy(
    id="id",
    deployment_id="deploymentId",
)

⚙️ Parameters

id: str — Application id of the application

deployment_id: str — Deployment id of the deployment

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.scale_to_zero(...) -> AsyncHttpResponse[None]

📝 Description

Pause a running application by scaling to 0 replicas

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Id of the application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.scale_to_original(...) -> AsyncHttpResponse[Deployment]

📝 Description

Resume a paused application by scaling back to the original number of replicas

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Id of the application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.applications.cancel_deployment(...) -> AsyncHttpResponse[ApplicationsCancelDeploymentResponse]

📝 Description

Cancel an ongoing deployment associated with the provided application ID and deployment ID.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.applications.cancel_deployment(
    id="id",
    deployment_id="deploymentId",
)

⚙️ Parameters

id: str — Application id of the application

deployment_id: str — Deployment id of the deployment

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ApplicationVersions

client.application_versions.list(...) -> AsyncPager[Deployment, ListApplicationDeploymentsResponse]

📝 Description

Fetch all deployments for a given application ID with optional filters such as deployment ID or version. Supports pagination.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.application_versions.list(
    id="id",
    limit=10,
    offset=0,
    version="1",
    deployment_id="deployment123",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

id: str — Id of the application

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

version: typing.Optional[str] — Deployment version. Filter deployments by version.

deployment_id: typing.Optional[str] — Deployment ID. Filter deployments by a specific ID.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.application_versions.get(...) -> AsyncHttpResponse[GetApplicationDeploymentResponse]

📝 Description

Get Deployment associated with the provided application ID and deployment ID.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.application_versions.get(
    id="id",
    deployment_id="deploymentId",
)

⚙️ Parameters

id: str — Application id of the application

deployment_id: str — Deployment id of the deployment

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Jobs

client.jobs.list_runs(...) -> AsyncPager[JobRun, ListJobRunResponse]

📝 Description

List Job Runs for provided Job Id. Filter the data based on parameters passed in the query

🔌 Usage

from truefoundry_sdk import JobRunsSortBy, SortDirection, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.jobs.list_runs(
    job_id="jobId",
    limit=10,
    offset=0,
    search_prefix="searchPrefix",
    sort_by=JobRunsSortBy.START_TIME,
    order=SortDirection.ASC,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

job_id: str — Job id of the application

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

search_prefix: typing.Optional[str] — Prefix used to search for job runs by name or identifier

sort_by: typing.Optional[JobRunsSortBy] — Attribute to sort by

order: typing.Optional[SortDirection] — Sorting order

triggered_by: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Array of subject slugs

status: typing.Optional[typing.Union[JobRunStatus, typing.Sequence[JobRunStatus]]] — Status of the job run

version_numbers: typing.Optional[typing.Union[float, typing.Sequence[float]]] — Version number of the deployment

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.get_run(...) -> AsyncHttpResponse[GetJobRunResponse]

📝 Description

Get Job Run for provided jobRunName and jobId

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.jobs.get_run(
    job_id="jobId",
    job_run_name="jobRunName",
)

⚙️ Parameters

job_id: str — Application Id of JOB

job_run_name: str — Job run name of the application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.delete_run(...) -> AsyncHttpResponse[DeleteJobRunResponse]

📝 Description

Delete Job Run for provided jobRunName and jobId

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.jobs.delete_run(
    job_id="jobId",
    job_run_name="jobRunName",
)

⚙️ Parameters

job_id: str — Application Id of JOB

job_run_name: str — Job run name of the application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.trigger(...) -> AsyncHttpResponse[TriggerJobRunResponse]

📝 Description

Trigger Job for provided deploymentId or applicationId

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

deployment_id: typing.Optional[str] — Deployment Id of the job

application_id: typing.Optional[str] — Application Id of the job

input: typing.Optional[TriggerJobRequestInput] — Job trigger input

metadata: typing.Optional[Metadata] — Metadata for the job run including job_alias_name

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jobs.terminate(...) -> AsyncHttpResponse[TerminateJobResponse]

📝 Description

Terminate Job for provided deploymentId and jobRunName

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.jobs.terminate(
    deployment_id="deploymentId",
    job_run_name="jobRunName",
)

⚙️ Parameters

deployment_id: str — Deployment Id of the Deployment

job_run_name: str — Job Run name

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Workspaces

client.workspaces.list(...) -> AsyncPager[Workspace, ListWorkspacesResponse]

📝 Description

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

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.workspaces.list(
    limit=10,
    offset=0,
    cluster_id="clusterId",
    name="name",
    fqn="fqn",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ 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

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.create_or_update(...) -> AsyncHttpResponse[GetWorkspaceResponse]

📝 Description

Creates a new workspace or updates an existing one based on the provided manifest.

🔌 Usage

from truefoundry_sdk import TrueFoundry, WorkspaceManifest

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.workspaces.create_or_update(
    manifest=WorkspaceManifest(
        cluster_fqn="cluster_fqn",
        name="name",
    ),
)

⚙️ Parameters

manifest: WorkspaceManifest — Workspace manifest

dry_run: typing.Optional[bool] — Dry run the request

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.get(...) -> AsyncHttpResponse[GetWorkspaceResponse]

📝 Description

Get workspace associated with provided workspace id

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Workspace id of the space

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.delete(...) -> AsyncHttpResponse[WorkspacesDeleteResponse]

📝 Description

Deletes the workspace with the given workspace ID. - Removes the associated namespace from the cluster. - Deletes the corresponding authorization entry.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Workspace id of the space

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Secrets

client.secrets.list(...) -> AsyncPager[Secret, ListSecretsResponse]

📝 Description

List secrets associated with a user filtered with optional parameters passed in the body.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.secrets.list()
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

secret_fqns: typing.Optional[typing.Sequence[str]] — Array of FQNs

secret_group_id: typing.Optional[str] — Secret Group Id of the secret gourp.

with_value: typing.Optional[bool] — Whether to include the secret values in the response. Defaults to false.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secrets.get(...) -> AsyncHttpResponse[GetSecretResponse]

📝 Description

Get Secret associated with provided id. The secret value is not returned if the control plane has DISABLE_SECRET_VALUE_VIEW set

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Secret Id of the secret.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secrets.delete(...) -> AsyncHttpResponse[float]

📝 Description

Deletes a secret and its versions along with its values.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.secrets.delete(
    id="id",
    force_delete=True,
)

⚙️ Parameters

id: str — Secret Id of the secret.

force_delete: typing.Optional[bool] — Whether to force delete the secret.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

SecretGroups

client.secret_groups.list(...) -> AsyncPager[SecretGroup, ListSecretGroupResponse]

📝 Description

List the secret groups associated with a user along with the associated secrets for each group. Filtered with the options passed in the query fields. Note: This method does not return the secret values of the associatedSecrets in the response. A separate API call to /v1/secrets/{id} should be made to fetch the associated secret value.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.secret_groups.list(
    limit=10,
    offset=0,
    fqn="fqn",
    search="search",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

limit: typing.Optional[int] — Number of items per page

offset: typing.Optional[int] — Number of items to skip

fqn: typing.Optional[str] — Fqn of secret group.

search: typing.Optional[str] — Search query - filters by secret group names that contain the search string

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secret_groups.create(...) -> AsyncHttpResponse[GetSecretGroupResponse]

📝 Description

Creates a secret group with secrets in it. A secret version for each of the created secret is created with version number as 1. The returned secret group does not have any secret values in the associatedSecrets field. A separate API call to /v1/secrets/{id} should be made to fetch the associated secret value.

🔌 Usage

from truefoundry_sdk import SecretInput, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.secret_groups.create(
    name="name",
    integration_id="integrationId",
    secrets=[
        SecretInput(
            key="key",
            value="value",
        )
    ],
)

⚙️ Parameters

name: str — Name of the secret group.

integration_id: str — Id of the provider integration.

secrets: typing.Sequence[SecretInput] — The secrets to be associated with the secret group

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secret_groups.create_or_update(...) -> AsyncHttpResponse[GetSecretGroupResponse]

📝 Description

Creates a new secret group or updates an existing one based on the provided manifest.

🔌 Usage

from truefoundry_sdk import Collaborator, SecretGroupManifest, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.secret_groups.create_or_update(
    manifest=SecretGroupManifest(
        name="name",
        integration_fqn="integration_fqn",
        collaborators=[
            Collaborator(
                subject="subject",
                role_id="role_id",
            )
        ],
    ),
)

⚙️ Parameters

manifest: SecretGroupManifest — Secret Group Manifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secret_groups.get(...) -> AsyncHttpResponse[GetSecretGroupResponse]

📝 Description

Get Secret Group by id. This method does not return the secret values of the associatedSecrets in the response. A separate API call to /v1/secrets/{id} should be made to fetch the associated secret value.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Secret Id of the secret group.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secret_groups.update(...) -> AsyncHttpResponse[GetSecretGroupResponse]

📝 Description

Updates the secrets in a secret group with new values. A new secret version is created for every secret that has a modified value and any omitted secrets are deleted. The returned updated secret group does not have any secret values in the associatedSecrets field. A separate API call to /v1/secrets/{id} should be made to fetch the associated secret value.

🔌 Usage

from truefoundry_sdk import TrueFoundry, UpdateSecretInput

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.secret_groups.update(
    id="id",
    secrets=[
        UpdateSecretInput(
            key="key",
        )
    ],
)

⚙️ Parameters

id: str — Secret Id of the secret group.

secrets: typing.Sequence[UpdateSecretInput]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.secret_groups.delete(...) -> AsyncHttpResponse[DeleteSecretGroupResponse]

📝 Description

Deletes the secret group, its associated secrets and secret versions of those secrets.

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Secret Id of the secret group.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Events

client.events.get(...) -> AsyncHttpResponse[GetEventsResponse]

📝 Description

Get Events for Pod, Job Run, Application. The events are sourced from Kubernetes as well as events captured by truefoundry. Optional query parameters include startTs, endTs for filtering.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.events.get(
    start_ts="startTs",
    end_ts="endTs",
    application_id="applicationId",
    application_fqn="applicationFqn",
    job_run_name="jobRunName",
)

⚙️ Parameters

start_ts: typing.Optional[str] — Start timestamp (ISO format) for querying events

end_ts: typing.Optional[str] — End timestamp (ISO format) for querying events

application_id: typing.Optional[str] — Application ID

application_fqn: typing.Optional[str] — Application FQN

pod_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Name of the pods

job_run_name: typing.Optional[str] — Job run name

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Alerts

client.alerts.list(...) -> AsyncHttpResponse[GetAlertsResponse]

📝 Description

Get alerts for a given application or cluster filtered by start and end timestamp

🔌 Usage

from truefoundry_sdk import AlertStatus, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.alerts.list(
    start_ts="startTs",
    end_ts="endTs",
    cluster_id="clusterId",
    application_id="applicationId",
    alert_status=AlertStatus.FIRING,
)

⚙️ Parameters

start_ts: typing.Optional[str] — Start timestamp (ISO format) for querying events

end_ts: typing.Optional[str] — End timestamp (ISO format) for querying events

cluster_id: typing.Optional[str] — Cluster id

application_id: typing.Optional[str] — Application id

alert_status: typing.Optional[AlertStatus] — Alert status

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Logs

client.logs.get(...) -> AsyncHttpResponse[GetLogsResponse]

📝 Description

Fetch logs for various workload components, including Services, Jobs, Workflows, Job Runs, and Pods. Logs are filtered based on the provided query parameters.

🔌 Usage

from truefoundry_sdk import (
    LogsSearchFilterType,
    LogsSearchOperatorType,
    LogsSortingDirection,
    TrueFoundry,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.logs.get(
    start_ts=1000000,
    end_ts=1000000,
    limit=1,
    direction=LogsSortingDirection.ASC,
    num_logs_to_ignore=1,
    application_id="applicationId",
    application_fqn="applicationFqn",
    deployment_id="deploymentId",
    job_run_name="jobRunName",
    pod_name="podName",
    container_name="containerName",
    pod_names_regex="podNamesRegex",
    search_filters="searchFilters",
    search_string="searchString",
    search_type=LogsSearchFilterType.REGEX,
    search_operator=LogsSearchOperatorType.EQUAL,
)

⚙️ Parameters

start_ts: typing.Optional[int] — Start timestamp for querying logs, in nanoseconds from the Unix epoch.

end_ts: typing.Optional[int] — End timestamp for querying logs, in nanoseconds from the Unix epoch.

limit: typing.Optional[int] — Max number of log lines to fetch

direction: typing.Optional[LogsSortingDirection] — Direction of sorting logs. Can be asc or desc

num_logs_to_ignore: typing.Optional[int] — Number of logs corresponding to the starting timestamp to be ignored.

application_id: typing.Optional[str] — Application ID

application_fqn: typing.Optional[str] — Application FQN

deployment_id: typing.Optional[str] — Deployment ID

job_run_name: typing.Optional[str] — Name of the Job Run for which to fetch logs.

pod_name: typing.Optional[str] — Name of Pod for which to fetch logs.

container_name: typing.Optional[str] — Name of the Container for which to fetch logs.

pod_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] — List of pod names for which to fetch logs.

pod_names_regex: typing.Optional[str] — Regex pattern for pod names to fetch logs.

search_filters: typing.Optional[str] — JSON string containing array of search filters with string, type and operator

search_string: typing.Optional[str] — String that needs to be matched

search_type: typing.Optional[LogsSearchFilterType] — Query filter type, regex substring ignore_case_substring

search_operator: typing.Optional[LogsSearchOperatorType] — Comparison operator for filter. equal or not_equal

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

MlRepos

client.ml_repos.create_or_update(...) -> AsyncHttpResponse[GetMlRepoResponse]

📝 Description

Creates or updates an MLRepo entity based on the provided manifest.

🔌 Usage

from truefoundry_sdk import Collaborator, MlRepoManifest, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.ml_repos.create_or_update(
    manifest=MlRepoManifest(
        name="name",
        storage_integration_fqn="storage_integration_fqn",
        collaborators=[
            Collaborator(
                subject="subject",
                role_id="role_id",
            )
        ],
    ),
)

⚙️ Parameters

manifest: MlRepoManifest — MLRepo manifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml_repos.get(...) -> AsyncHttpResponse[GetMlRepoResponse]

📝 Description

Get a ml repo by id Args: id: Unique identifier of the ml repo to get user_info: Authenticated user information

Returns: GetMLRepoResponse: The ml repo

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml_repos.delete(...) -> AsyncHttpResponse[EmptyResponse]

📝 Description

Delete a ml repo Args: id: Unique identifier of the ml repo to delete user_info: Authenticated user information

Returns: EmptyResponse: Empty response indicating successful deletion

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml_repos.list(...) -> AsyncPager[MlRepo, ListMlReposResponse]

📝 Description

List ml repos Args: filters: Filters for the ml repos user_info: Authenticated user information

Returns: ListMLReposResponse: List of ml repos

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.ml_repos.list(
    name="name",
    limit=1,
    offset=1,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

name: typing.Optional[str]

limit: typing.Optional[int]

offset: typing.Optional[int]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Traces

client.traces.query_spans(...) -> AsyncPager[TraceSpan, QuerySpansResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.traces.query_spans(
    start_time="startTime",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

start_time: str — Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z)

end_time: typing.Optional[str] — End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided.

trace_ids: typing.Optional[typing.Sequence[str]] — Array of trace IDs to filter by

span_ids: typing.Optional[typing.Sequence[str]] — Array of span IDs to filter by

parent_span_ids: typing.Optional[typing.Sequence[str]] — Array of parent span IDs to filter by

created_by_subject_types: typing.Optional[typing.Sequence[SubjectType]] — Array of subject types to filter by

created_by_subject_slugs: typing.Optional[typing.Sequence[str]] — Array of subject slugs to filter by

application_names: typing.Optional[typing.Sequence[str]] — Array of application names to filter by

limit: typing.Optional[int] — The maximum number of spans to return per page. Defaults to 200 if not provided.

sort_direction: typing.Optional[SortDirection] — Sort direction for results based on time. Defaults to descending (latest first)

page_token: typing.Optional[str] — An opaque string that should be passed as-is from previous response for fetching the next page. Pass $response.pagination.nextPageToken from previous response for fetching the next page.

tracing_project_fqn: typing.Optional[str] — Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default)

data_routing_destination: typing.Optional[str] — Data Routing Destination. One of tracingProjectFqn or dataRoutingDestination is required.

filters: typing.Optional[typing.Sequence[QuerySpansRequestFiltersItem]] — Array of filters

include_feedbacks: typing.Optional[bool] — When true, feedback data is included in the response. When false, feedback data is excluded (returns empty array).

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Artifacts

client.artifacts.get(...) -> AsyncHttpResponse[GetArtifactResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifacts.delete(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifacts.list(...) -> AsyncPager[Artifact, ListArtifactsResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.artifacts.list(
    fqn="fqn",
    ml_repo_id="ml_repo_id",
    name="name",
    offset=1,
    limit=1,
    run_id="run_id",
    include_empty_artifacts=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

fqn: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

offset: typing.Optional[int]

limit: typing.Optional[int]

run_id: typing.Optional[str]

include_empty_artifacts: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifacts.create_or_update(...) -> AsyncHttpResponse[GetArtifactVersionResponse]

🔌 Usage

from truefoundry_sdk import (
    ArtifactManifest,
    TrueFoundry,
    TrueFoundryManagedSource,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.artifacts.create_or_update(
    manifest=ArtifactManifest(
        name="name",
        metadata={"key": "value"},
        ml_repo="ml_repo",
        source=TrueFoundryManagedSource(),
    ),
)

⚙️ Parameters

manifest: ArtifactManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Prompts

client.prompts.get(...) -> AsyncHttpResponse[GetPromptResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.delete(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.list(...) -> AsyncPager[Prompt, ListPromptsResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.prompts.list(
    fqn="fqn",
    ml_repo_id="ml_repo_id",
    name="name",
    offset=1,
    limit=1,
    include_empty_prompts=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

fqn: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

offset: typing.Optional[int]

limit: typing.Optional[int]

include_empty_prompts: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.create_or_update(...) -> AsyncHttpResponse[GetPromptVersionResponse]

🔌 Usage

from truefoundry_sdk import ChatPromptManifest, SystemMessage, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.prompts.create_or_update(
    manifest=ChatPromptManifest(
        name="name",
        metadata={"key": "value"},
        ml_repo="ml_repo",
        messages=[
            SystemMessage(
                content="content",
            )
        ],
    ),
)

⚙️ Parameters

manifest: ChatPromptManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Models

client.models.get(...) -> AsyncHttpResponse[GetModelResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.models.delete(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.models.list(...) -> AsyncPager[Model, ListModelsResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.models.list(
    fqn="fqn",
    ml_repo_id="ml_repo_id",
    name="name",
    offset=1,
    limit=1,
    run_id="run_id",
    include_empty_models=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

fqn: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

offset: typing.Optional[int]

limit: typing.Optional[int]

run_id: typing.Optional[str]

include_empty_models: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.models.create_or_update(...) -> AsyncHttpResponse[GetModelVersionResponse]

🔌 Usage

from truefoundry_sdk import ModelManifest, TrueFoundry, TrueFoundryManagedSource

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.models.create_or_update(
    manifest=ModelManifest(
        name="name",
        metadata={"key": "value"},
        ml_repo="ml_repo",
        source=TrueFoundryManagedSource(),
    ),
)

⚙️ Parameters

manifest: ModelManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ArtifactVersions

client.artifact_versions.apply_tags(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.artifact_versions.apply_tags(
    artifact_version_id="artifact_version_id",
    tags=["tags"],
)

⚙️ Parameters

artifact_version_id: str

tags: typing.Sequence[str]

force: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.get(...) -> AsyncHttpResponse[GetArtifactVersionResponse]

📝 Description

Get artifact version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.delete(...) -> AsyncHttpResponse[EmptyResponse]

📝 Description

Delete artifact versions API

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.list(...) -> AsyncPager[ArtifactVersion, ListArtifactVersionsResponse]

📝 Description

List artifact version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.artifact_versions.list(
    tag="tag",
    fqn="fqn",
    artifact_id="artifact_id",
    ml_repo_id="ml_repo_id",
    name="name",
    version=1,
    offset=1,
    limit=1,
    include_internal_metadata=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

tag: typing.Optional[str]

fqn: typing.Optional[str]

artifact_id: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

version: typing.Optional[int]

run_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]]

run_steps: typing.Optional[typing.Union[int, typing.Sequence[int]]]

offset: typing.Optional[int]

limit: typing.Optional[int]

include_internal_metadata: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.get_signed_urls(...) -> AsyncHttpResponse[GetSignedUrLsResponse]

🔌 Usage

from truefoundry_sdk import Operation, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.artifact_versions.get_signed_urls(
    id="id",
    paths=["paths"],
    operation=Operation.READ,
)

⚙️ Parameters

id: str

paths: typing.Sequence[str]

operation: Operation

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.create_multi_part_upload(...) -> AsyncHttpResponse[MultiPartUploadResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.artifact_versions.create_multi_part_upload(
    id="id",
    path="path",
    num_parts=1,
)

⚙️ Parameters

id: str

path: str

num_parts: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.stage(...) -> AsyncHttpResponse[StageArtifactResponse]

🔌 Usage

from truefoundry_sdk import ModelManifest, TrueFoundry, TrueFoundryManagedSource

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.artifact_versions.stage(
    manifest=ModelManifest(
        name="name",
        metadata={"key": "value"},
        ml_repo="ml_repo",
        source=TrueFoundryManagedSource(),
    ),
)

⚙️ Parameters

manifest: StageArtifactRequestManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.list_files(...) -> AsyncPager[FileInfo, ListFilesResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.artifact_versions.list_files(
    id="id",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

id: str

path: typing.Optional[str]

limit: typing.Optional[int]

page_token: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.artifact_versions.mark_stage_failure(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ModelVersions

client.model_versions.apply_tags(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.model_versions.apply_tags(
    model_version_id="model_version_id",
    tags=["tags"],
)

⚙️ Parameters

model_version_id: str

tags: typing.Sequence[str]

force: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_versions.get(...) -> AsyncHttpResponse[GetModelVersionResponse]

📝 Description

Get model version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_versions.delete(...) -> AsyncHttpResponse[EmptyResponse]

📝 Description

Delete model versions API

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_versions.list(...) -> AsyncPager[ModelVersion, ListModelVersionsResponse]

📝 Description

List model version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.model_versions.list(
    tag="tag",
    fqn="fqn",
    model_id="model_id",
    ml_repo_id="ml_repo_id",
    name="name",
    version=1,
    offset=1,
    limit=1,
    include_internal_metadata=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

tag: typing.Optional[str]

fqn: typing.Optional[str]

model_id: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

version: typing.Optional[int]

run_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]]

run_steps: typing.Optional[typing.Union[int, typing.Sequence[int]]]

offset: typing.Optional[int]

limit: typing.Optional[int]

include_internal_metadata: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

PromptVersions

client.prompt_versions.apply_tags(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.prompt_versions.apply_tags(
    prompt_version_id="prompt_version_id",
    tags=["tags"],
)

⚙️ Parameters

prompt_version_id: str

tags: typing.Sequence[str]

force: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompt_versions.get(...) -> AsyncHttpResponse[GetPromptVersionResponse]

📝 Description

Get prompt version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompt_versions.delete(...) -> AsyncHttpResponse[EmptyResponse]

📝 Description

Delete prompt versions API

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompt_versions.list(...) -> AsyncPager[PromptVersion, ListPromptVersionsResponse]

📝 Description

List prompt version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.prompt_versions.list(
    tag="tag",
    fqn="fqn",
    prompt_id="prompt_id",
    ml_repo_id="ml_repo_id",
    name="name",
    version=1,
    offset=1,
    limit=1,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

tag: typing.Optional[str]

fqn: typing.Optional[str]

prompt_id: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

version: typing.Optional[int]

offset: typing.Optional[int]

limit: typing.Optional[int]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

DataDirectories

client.data_directories.get(...) -> AsyncHttpResponse[GetDataDirectoryResponse]

📝 Description

Get a data directory by its ID.

Args: id (str): The ID of the data directory to retrieve user_info: Current authenticated user info

Returns: DataDirectoryResponse: Response containing the retrieved data directory

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.delete(...) -> AsyncHttpResponse[EmptyResponse]

📝 Description

Delete a data directory and optionally its contents.

Args: id: Unique identifier of the data directory to delete delete_contents: If True, also deletes the data directory's contents user_info: Authenticated user information

Returns: EmptyResponse: Empty response indicating successful deletion

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.data_directories.delete(
    id="id",
    delete_contents=True,
)

⚙️ Parameters

id: str

delete_contents: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.list(...) -> AsyncPager[DataDirectory, ListDataDirectoriesResponse]

📝 Description

List all data directories with optional filtering and pagination.

Args: filters: Query parameters for filtering and pagination - ml_repo_id: Filter data directories by ml repo ID - name: Optional filter data directories by name - limit: Optional maximum number of data directories to return - offset: Optional number of data directories to skip user_info: Authenticated user information

Returns: ListDataDirectoriesResponse: List of data directories and pagination info

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.data_directories.list(
    fqn="fqn",
    ml_repo_id="ml_repo_id",
    name="name",
    limit=1,
    offset=1,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

fqn: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

limit: typing.Optional[int]

offset: typing.Optional[int]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.create_or_update(...) -> AsyncHttpResponse[GetDataDirectoryResponse]

🔌 Usage

from truefoundry_sdk import (
    DataDirectoryManifest,
    TrueFoundry,
    TrueFoundryManagedSource,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.data_directories.create_or_update(
    manifest=DataDirectoryManifest(
        name="name",
        ml_repo="ml_repo",
        metadata={"key": "value"},
        source=TrueFoundryManagedSource(),
    ),
)

⚙️ Parameters

manifest: DataDirectoryManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.list_files(...) -> AsyncPager[FileInfo, ListFilesResponse]

📝 Description

List files in a dataset.

Args: request_dto: Request containing dataset ID, path, page token and limit user_info: Authenticated user information

Returns: ListFilesResponse: Response containing files and pagination info

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.data_directories.list_files(
    id="id",
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

id: str

path: typing.Optional[str]

limit: typing.Optional[int]

page_token: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.delete_files(...) -> AsyncHttpResponse[EmptyResponse]

📝 Description

Delete files from the dataset.

Args: request_dto: Request containing dataset ID and paths user_info: Authenticated user information

Returns: EmptyResponse: Empty response indicating successful deletion

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.data_directories.delete_files(
    id="id",
    paths=["paths"],
)

⚙️ Parameters

id: str

paths: typing.Sequence[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.get_signed_urls(...) -> AsyncHttpResponse[GetSignedUrLsResponse]

📝 Description

Get signed URLs for a dataset.

Args: request_dto: Request containing dataset ID, paths and operation user_info: Authenticated user information

Returns: GetSignedURLsResponse: Response containing signed URLs

🔌 Usage

from truefoundry_sdk import Operation, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.data_directories.get_signed_urls(
    id="id",
    paths=["paths"],
    operation=Operation.READ,
)

⚙️ Parameters

id: str

paths: typing.Sequence[str]

operation: Operation

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.data_directories.create_multipart_upload(...) -> AsyncHttpResponse[MultiPartUploadResponse]

📝 Description

Create a multipart upload for a dataset

Args: request_dto: Request containing dataset ID, path and number of parts user_info: Authenticated user information

Returns: MultiPartUploadResponse: Response containing multipart upload info

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.data_directories.create_multipart_upload(
    id="id",
    path="path",
    num_parts=1,
)

⚙️ Parameters

id: str

path: str

num_parts: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Users

client.internal.users.get_info() -> AsyncHttpResponse[Session]

📝 Description

Get the user session details for the currently authenticated user

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal AiGateway

client.internal.ai_gateway.get_gateway_config(...) -> AsyncHttpResponse[GatewayConfiguration]

📝 Description

Get Gateway configuration based on type for the tenant.

🔌 Usage

from truefoundry_sdk import TrueFoundry
from truefoundry_sdk.internal.ai_gateway import (
    AiGatewayGetGatewayConfigRequestType,
)

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.ai_gateway.get_gateway_config(
    type=AiGatewayGetGatewayConfigRequestType.GATEWAY_RATE_LIMITING_CONFIG,
)

⚙️ Parameters

type: AiGatewayGetGatewayConfigRequestType — Type of Config

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Clusters

client.internal.clusters.get_autoprovisioning_state(...) -> AsyncHttpResponse[GetAutoProvisioningStateResponse]

📝 Description

Get the auto provisioning status for the provided cluster

🔌 Usage

from truefoundry_sdk import TrueFoundry

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

⚙️ Parameters

id: str — Cluster id of the cluster

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Deployments

client.internal.deployments.get_deployment_statuses(...) -> AsyncHttpResponse[typing.List[DeploymentStatus]]

📝 Description

This endpoint returns all statuses for a specific deployment in a given application.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.deployments.get_deployment_statuses(
    id="id",
    deployment_id="deploymentId",
)

⚙️ Parameters

id: str — Application id of the application

deployment_id: str — Deployment id of the deployment

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.deployments.get_builds(...) -> AsyncHttpResponse[typing.List[DeploymentBuild]]

📝 Description

This endpoint returns all build details associated with a specific deployment in a given application.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.deployments.get_builds(
    id="id",
    deployment_id="deploymentId",
)

⚙️ Parameters

id: str — Application id of the application

deployment_id: str — Deployment id of the deployment

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.deployments.get_code_upload_url(...) -> AsyncHttpResponse[PresignedUrlObject]

📝 Description

Generate presigned URL to upload code for given serviceName and workspaceFqn

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.deployments.get_code_upload_url(
    service_name="serviceName",
    workspace_fqn="workspaceFqn",
)

⚙️ Parameters

service_name: str — ServiceName of the deployment

workspace_fqn: str — WorkSpaceFQN of the workspace

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.deployments.get_suggested_endpoint(...) -> AsyncHttpResponse[GetSuggestedDeploymentEndpointResponse]

📝 Description

Generate deployment endpoint based on the provided query parameters.

🔌 Usage

from truefoundry_sdk import ApplicationType, TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.deployments.get_suggested_endpoint(
    application_type=ApplicationType.ASYNC_SERVICE,
    application_name="applicationName",
    workspace_id="workspaceId",
    base_domain="baseDomain",
    port="port",
    prefer_wildcard=True,
)

⚙️ Parameters

application_type: ApplicationType — Application Type

application_name: str — Application name

workspace_id: str — Workspace id

base_domain: typing.Optional[str] — Base domain

port: typing.Optional[str] — Port

prefer_wildcard: typing.Optional[bool] — Prefer wildcard

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Applications

client.internal.applications.promote_rollout(...) -> AsyncHttpResponse[None]

📝 Description

Promote an application rollout for canary and blue-green.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.applications.promote_rollout(
    id="id",
    full=True,
)

⚙️ Parameters

id: str — Id of the application

full: typing.Optional[bool] — Whether to promote a rollout to full

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.applications.get_pod_template_hash_to_deployment_version(...) -> AsyncHttpResponse[typing.Dict[str, float]]

📝 Description

This endpoint fetches the pod template hash to deployment version map for a specific application.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.applications.get_pod_template_hash_to_deployment_version(
    id="id",
    pod_template_hashes="podTemplateHashes",
)

⚙️ Parameters

id: str — Id of the application

pod_template_hashes: typing.Optional[str] — Pod Template Hashes (comma separated for multiple)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Metrics

client.internal.metrics.get_charts(...) -> AsyncHttpResponse[GetChartsResponse]

📝 Description

List charts for a given Application based on parameters passed in the query.

🔌 Usage

from truefoundry_sdk import TrueFoundry
from truefoundry_sdk.internal.metrics import MetricsGetChartsRequestFilterEntity

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.metrics.get_charts(
    workspace_id="workspaceId",
    application_id="applicationId",
    start_ts="startTs",
    end_ts="endTs",
    filter_entity=MetricsGetChartsRequestFilterEntity.APPLICATION,
    filter_query="filterQuery",
)

⚙️ Parameters

workspace_id: str

application_id: str

filter_entity: MetricsGetChartsRequestFilterEntity

start_ts: typing.Optional[str] — Start Timestamp

end_ts: typing.Optional[str] — End Timestamp

filter_query: typing.Optional[str] — Query params to filter metrics

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Vcs

client.internal.vcs.get_repository_details(...) -> AsyncHttpResponse[GitRepositoryExistsResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.vcs.get_repository_details(
    repo_url="repoURL",
)

⚙️ Parameters

repo_url: str — The URL of the repository

id: typing.Optional[str] — The integration id of the repository

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.vcs.get_authenticated_url(...) -> AsyncHttpResponse[GetAuthenticatedVcsurlResponse]

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.vcs.get_authenticated_url(
    repo_url="repoURL",
)

⚙️ Parameters

repo_url: str — Repository URL (e.g., https://github.com/user/repo, https://bitbucket.org/user/repo)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal DockerRegistries

client.internal.docker_registries.create_repository(...) -> AsyncHttpResponse[DockerRegistriesCreateRepositoryResponse]

📝 Description

Create a docker repository in the provided workspace.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.docker_registries.create_repository(
    fqn="fqn",
    application_name="applicationName",
    workspace_fqn="workspaceFqn",
)

⚙️ Parameters

fqn: str — Docker registry FQN

application_name: str — Application Name for the image being built

workspace_fqn: str — FQN for the workspace of application

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.docker_registries.get_credentials(...) -> AsyncHttpResponse[DockerRegistriesGetCredentialsResponse]

📝 Description

Get docker registry credentials for building and pushing an image.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.docker_registries.get_credentials(
    fqn="fqn",
    cluster_id="clusterId",
)

⚙️ Parameters

fqn: typing.Optional[str] — Docker registry FQN

cluster_id: typing.Optional[str] — Cluster Id if provided will fetch the default docker registry for the cluster

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Workflows

client.internal.workflows.execute_workflow(...) -> AsyncHttpResponse[WorkflowsExecuteWorkflowResponse]

📝 Description

Execute a workflow for the specified application

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.workflows.execute_workflow(
    application_id="applicationId",
)

⚙️ Parameters

application_id: str — Id of the application

inputs: typing.Optional[typing.Dict[str, typing.Any]] — Workflow inputs

inputs_literal_map: typing.Optional[typing.Dict[str, typing.Any]] — Workflow inputs literal map

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal BuildLogs

client.internal.build_logs.get(...) -> AsyncHttpResponse[LogsResponse]

📝 Description

Get logs for a given pipeline run by its name, with optional filters and time range.

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.build_logs.get(
    pipeline_run_name="pipelineRunName",
    start_ts="1635467890123456789",
    end_ts="1635467891123456789",
    limit="limit",
    direction="direction",
    num_logs_to_ignore=1.1,
)

⚙️ Parameters

pipeline_run_name: str — PipelineRun Name

start_ts: typing.Optional[str] — Start timestamp for querying logs, in nanoseconds from the Unix epoch.

end_ts: typing.Optional[str] — End timestamp for querying logs, in nanoseconds from the Unix epoch.

limit: typing.Optional[str] — Max number of log lines to fetch

direction: typing.Optional[str] — Direction of sorting logs. Can be asc or desc

filter_query: typing.Optional[LogsFilterQuery] — Query to filter logs

num_logs_to_ignore: typing.Optional[float] — Number of logs corresponding to the starting timestamp to be ignored.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal ArtifactVersions

client.internal.artifact_versions.list(...) -> AsyncPager[ InternalListArtifactVersionsResponseDataItem, InternalListArtifactVersionsResponse, ]

📝 Description

List artifact version API

🔌 Usage

from truefoundry_sdk import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
response = client.internal.artifact_versions.list(
    tag="tag",
    fqn="fqn",
    artifact_id="artifact_id",
    ml_repo_id="ml_repo_id",
    name="name",
    version=1,
    offset=1,
    limit=1,
    include_internal_metadata=True,
    include_model_versions=True,
)
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

tag: typing.Optional[str]

fqn: typing.Optional[str]

artifact_id: typing.Optional[str]

ml_repo_id: typing.Optional[str]

name: typing.Optional[str]

version: typing.Optional[int]

run_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]]

run_steps: typing.Optional[typing.Union[int, typing.Sequence[int]]]

offset: typing.Optional[int]

limit: typing.Optional[int]

include_internal_metadata: typing.Optional[bool]

include_model_versions: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Internal Ml

client.internal.ml.apply(...) -> AsyncHttpResponse[ApplyMlEntityResponse]

🔌 Usage

from truefoundry_sdk import ModelManifest, TrueFoundry, TrueFoundryManagedSource

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.ml.apply(
    manifest=ModelManifest(
        name="name",
        metadata={"key": "value"},
        ml_repo="ml_repo",
        source=TrueFoundryManagedSource(),
    ),
)

⚙️ Parameters

manifest: ApplyMlEntityRequestManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.internal.ml.delete(...) -> AsyncHttpResponse[EmptyResponse]

🔌 Usage

from truefoundry_sdk import ModelManifest, TrueFoundry, TrueFoundryManagedSource

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)
client.internal.ml.delete(
    manifest=ModelManifest(
        name="name",
        metadata={"key": "value"},
        ml_repo="ml_repo",
        source=TrueFoundryManagedSource(),
    ),
)

⚙️ Parameters

manifest: DeleteMlEntityRequestManifest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.