Skip to main content

Methods

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

Parameters

limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip
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]
🔗 ApplicationsListRequestDeviceTypeFilterFilter 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]
🔗 ApplicationsListRequestLifecycleStageFilter by application lifecycle state
is_recommendation_present_and_visible
typing.Optional[bool]
Filter out applications with recommendations that are allowed to be shown

Returns

SyncPager[Application]
SyncPager[Application]
🔗 ApplicationRetrieve latest applications based on the specified query parameters. If pagination parameters are provided, the response includes paginated data.

Usage

from truefoundry import TrueFoundry

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

client.applications.list(
    limit=10,
    offset=10,
    application_id="application_id_value",
    workspace_id="workspace_id_value",
    application_name="value",
    fqn="value",
    workspace_fqn="value",
    application_type="value",
    name_search_query="value",
    environment_id="value",
    cluster_id="cluster_id_value",
    application_set_id="value",
    paused="value",
    device_type_filter="value",
    last_deployed_by_subjects="value",
    lifecycle_stage="value",
    is_recommendation_present_and_visible="value",
)

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

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Create a new Application Deployment based on the provided manifest.

Parameters

manifest
typing.Dict[str, typing.Optional[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

Returns

GetApplicationDeploymentResponse
GetApplicationDeploymentResponse
🔗 GetApplicationDeploymentResponseReturns new deployment on successful creation
  • It also creates an application if not already present
  • validates third party requirements
  • updates application, version

Usage

from truefoundry 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"},
    dry_run=False,
    force_deploy=False,
    trigger_on_deploy=False,
    workspace_id="workspace_id_value",
    application_id="application_id_value",
    name="value",
    application_set_id="value",
)
Get Application associated with the provided application ID.

Parameters

id
str
required
Id of the application

Returns

GetApplicationResponse
GetApplicationResponse
🔗 GetApplicationResponseApplication details retrieved successfully

Usage

from truefoundry import TrueFoundry

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

client.applications.get(
    id="id_value",
)
Delete Application associated with the provided application ID.

Parameters

id
str
required
Id of the application

Returns

DeleteApplicationResponse
DeleteApplicationResponse
🔗 DeleteApplicationResponseDelete application response.

Usage

from truefoundry import TrueFoundry

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

client.applications.delete(
    id="id_value",
)
Pause a running application by scaling to 0 replicas

Parameters

id
str
required
Id of the application

Returns

None
None

Usage

from truefoundry import TrueFoundry

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

client.applications.scale_to_zero(
    id="id_value",
)
Resume a paused application by scaling back to the original number of replicas

Parameters

id
str
required
Id of the application

Returns

Deployment
Deployment
🔗 DeploymentScales back a paused applicaion to the original number of replicas

Usage

from truefoundry import TrueFoundry

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

client.applications.scale_to_original(
    id="id_value",
)
Cancel an ongoing deployment associated with the provided application ID and deployment ID.

Parameters

id
str
required
Application id of the application
deployment_id
str
required
Deployment id of the deployment

Returns

ApplicationsCancelDeploymentResponse
ApplicationsCancelDeploymentResponse
🔗 ApplicationsCancelDeploymentResponseDeployment cancelled successfully.

Usage

from truefoundry import TrueFoundry

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

client.applications.cancel_deployment(
    id="id_value",
    deployment_id="value",
)
Get Application by FQN.

Parameters

fqn
str
required
FQN of the application

Returns

GetApplicationResponse
GetApplicationResponse
🔗 GetApplicationResponseApplication details

Usage

from truefoundry import TrueFoundry

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

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