Skip to content

App

laktory.models.resources.databricks.App ¤

Bases: TagsMixin, AppBase

Databricks App

Examples:

import io

from laktory import models

app_yaml = '''
name: stocks-dash
description: A dashboard app for visualizing stock prices.
resources:
- name: sql-warehouse
  sql_warehouse:
    id: warehouse_id
    permission: CAN_USE
access_controls:
- group_name: account users
  permission_level: CAN_USE
tags:
  cost_center: finance
'''
app = models.resources.databricks.App.model_validate_yaml(io.StringIO(app_yaml))
References
BASE DESCRIPTION
budget_policy_id

The Budget Policy ID set for this resource

TYPE: str | None | VariableType DEFAULT: None

compute_max_instances

TYPE: int | None | VariableType DEFAULT: None

compute_min_instances

TYPE: int | None | VariableType DEFAULT: None

compute_size

A string specifying compute size for the App. Possible values are MEDIUM, LARGE

TYPE: str | None | VariableType DEFAULT: None

description

The description of the resource

TYPE: str | None | VariableType DEFAULT: None

forward_user_access_token

TYPE: bool | None | VariableType DEFAULT: None

git_repository

Git repository configuration.

TYPE: AppGitRepository | None | VariableType DEFAULT: None

git_source

The Git source to deploy from, specifying the reference to check out and an optional path to the app source code within the repository configured in git_repository (see below)

TYPE: AppGitSource | None | VariableType DEFAULT: None

name

The name of the app to grant permission on

TYPE: str | VariableType

no_compute

TYPE: bool | None | VariableType DEFAULT: None

provider_config

TYPE: AppProviderConfig | None | VariableType DEFAULT: None

resources

A list of resources that the app has access to.

TYPE: list[AppResource] | None | VariableType DEFAULT: None

source_code_path

The snapshotted workspace file system path of the source code loaded by the deployed app. * pending_deployment attribute - the pending deployment of the app. A deployment is considered pending when it is being prepared for deployment to the app compute. Schema is identical to active_deployment

TYPE: str | None | VariableType DEFAULT: None

space

TYPE: str | None | VariableType DEFAULT: None

telemetry_export_destinations

Telemetry export destinations.

TYPE: list[AppTelemetryExportDestination] | None | VariableType DEFAULT: None

usage_policy_id

The Usage Policy ID set for this resource

TYPE: str | None | VariableType DEFAULT: None

user_api_scopes

A list of api scopes granted to the user access token. See REST API docs for full list of supported scopes

TYPE: list[str] | None | VariableType DEFAULT: None

LAKTORY DESCRIPTION
access_controls

Access controls list

TYPE: list[AccessControl | VariableType] | VariableType DEFAULT: []

name_prefix

Prefix added to the app name

TYPE: str | VariableType DEFAULT: None

name_suffix

Suffix added to the app name

TYPE: str | VariableType DEFAULT: None

tags

Tags assigned to the entity as {tag_key: tag_value}. Use a null value for a key-only tag. Each tag is deployed as a separate tag assignment resource.

TYPE: dict[str, str | None] DEFAULT: None

METHOD DESCRIPTION
get_tags_additional_resources

Tag assignment resources for entity (a name or a resource reference).

ATTRIBUTE DESCRIPTION
additional_core_resources
  • permissions

TYPE: list

additional_core_resources property ¤

  • permissions
  • tags

get_tags_additional_resources(entity_type, entity, tags=None) ¤

Tag assignment resources for entity (a name or a resource reference). Defaults to the tags of this resource.

Source code in laktory/models/resources/databricks/_tagsmixin.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def get_tags_additional_resources(
    self, entity_type: str, entity: str, tags: dict[str, str | None] | None = None
) -> list:
    """
    Tag assignment resources for `entity` (a name or a resource reference).
    Defaults to the `tags` of this resource.
    """
    if tags is None:
        tags = self.tags
    resources = []
    for key, value in (tags or {}).items():
        if entity_type in WORKSPACE_ENTITY_TYPES:
            r = WorkspaceEntityTagAssignment(
                entity_type=entity_type,
                entity_id=entity,
                tag_key=key,
                tag_value=value,
            )
        else:
            r = EntityTagAssignment(
                entity_type=entity_type,
                entity_name=entity,
                tag_key=key,
                tag_value=value,
            )
        resources += [r]
    return resources

laktory.models.resources.databricks.app.AppGitRepository ¤

Bases: BaseModel

PARAMETER DESCRIPTION
provider

Git provider (e.g. gitHub).

TYPE: str | VariableType

url

URL of the Git repository.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppGitSource ¤

Bases: BaseModel

PARAMETER DESCRIPTION
branch

Git branch to check out and deploy from. Required when git_repository.auto_deploy is true, since automatic deployment tracks pushes to a branch

TYPE: str | None | VariableType DEFAULT: None

commit

Git commit SHA to check out and deploy from

TYPE: str | None | VariableType DEFAULT: None

git_repository

Git repository configuration for app deployments (see below). When specified, deployments can reference code from this repository by providing only the git reference (branch, tag, or commit)

TYPE: AppGitSourceGitRepository | None | VariableType DEFAULT: None

resolved_commit

TYPE: str | None | VariableType DEFAULT: None

source_code_path

The snapshotted workspace file system path of the source code loaded by the deployed app. * pending_deployment attribute - the pending deployment of the app. A deployment is considered pending when it is being prepared for deployment to the app compute. Schema is identical to active_deployment

TYPE: str | None | VariableType DEFAULT: None

tag

Git tag to check out and deploy from

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppGitSourceGitRepository ¤

Bases: BaseModel

PARAMETER DESCRIPTION
auto_deploy

When true, the app is automatically redeployed on push events to the branch configured in git_source. This requires git_source to specify a branch; a tag or commit cannot be used, because automatic deployment is triggered by pushes to a branch. Automatic deployment is currently supported only for the gitHub and azureDevOpsServices providers

TYPE: bool | None | VariableType DEFAULT: None

caller_credential_id

ID of a personal access token Git credential owned by the caller, used to grant the app's service principal access to this repository. This is only applied when the app is created and is not returned by the service; changing it on an existing app is not supported

TYPE: int | None | VariableType DEFAULT: None

provider

Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit

TYPE: str | VariableType

url

The URL of the app once it is deployed

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppProviderConfig ¤

Bases: BaseModel

PARAMETER DESCRIPTION
workspace_id

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResource ¤

Bases: BaseModel

PARAMETER DESCRIPTION
app

App resource reference.

TYPE: AppResourceApp | None | VariableType DEFAULT: None

database

Database resource reference.

TYPE: AppResourceDatabase | None | VariableType DEFAULT: None

description

Description of the resource.

TYPE: str | None | VariableType DEFAULT: None

experiment

MLflow experiment resource reference.

TYPE: AppResourceExperiment | None | VariableType DEFAULT: None

genie_space

Genie space resource reference.

TYPE: AppResourceGenieSpace | None | VariableType DEFAULT: None

job

Databricks job resource reference.

TYPE: AppResourceJob | None | VariableType DEFAULT: None

name

Name used to refer to this resource inside the app.

TYPE: str | VariableType

postgres

Postgres resource reference.

TYPE: AppResourcePostgres | None | VariableType DEFAULT: None

secret

Secret resource reference.

TYPE: AppResourceSecret | None | VariableType DEFAULT: None

serving_endpoint

Serving endpoint resource reference.

TYPE: AppResourceServingEndpoint | None | VariableType DEFAULT: None

sql_warehouse

SQL warehouse resource reference.

TYPE: AppResourceSqlWarehouse | None | VariableType DEFAULT: None

uc_securable

Unity Catalog securable resource reference.

TYPE: AppResourceUcSecurable | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResourceApp ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

Name of the app resource.

TYPE: str | None | VariableType DEFAULT: None

permission

Permission to grant.

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResourceDatabase ¤

Bases: BaseModel

PARAMETER DESCRIPTION
database_name

Name of the database.

TYPE: str | VariableType

instance_name

Name of the database instance.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourceExperiment ¤

Bases: BaseModel

PARAMETER DESCRIPTION
experiment_id

ID of the MLflow experiment.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourceGenieSpace ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

Name of the Genie space.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType

space_id

ID of the Genie space.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourceJob ¤

Bases: BaseModel

PARAMETER DESCRIPTION
id

ID of the Databricks job.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcePostgres ¤

Bases: BaseModel

PARAMETER DESCRIPTION
branch

Branch name.

TYPE: str | None | VariableType DEFAULT: None

database

Database name.

TYPE: str | None | VariableType DEFAULT: None

permission

Permission to grant.

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResourceSecret ¤

Bases: BaseModel

PARAMETER DESCRIPTION
key

Secret key.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType

scope

Secret scope.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourceServingEndpoint ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

Name of the serving endpoint.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourceSqlWarehouse ¤

Bases: BaseModel

PARAMETER DESCRIPTION
id

ID of the SQL warehouse.

TYPE: str | VariableType

permission

Permission to grant.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourceUcSecurable ¤

Bases: BaseModel

PARAMETER DESCRIPTION
permission

Permission to grant.

TYPE: str | VariableType

securable_full_name

Full name of the UC securable.

TYPE: str | VariableType

securable_type

Type of the UC securable.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResources ¤

Bases: BaseModel

PARAMETER DESCRIPTION
app

TYPE: AppResourcesApp | None | VariableType DEFAULT: None

database

The resource path of a specific database within the branch to grant permission on (e.g. projects/proj-abc123/branches/branch-xyz789/databases/db-456). If omitted, permission applies to the branch

TYPE: AppResourcesDatabase | None | VariableType DEFAULT: None

description

The description of the resource

TYPE: str | None | VariableType DEFAULT: None

experiment

TYPE: AppResourcesExperiment | None | VariableType DEFAULT: None

genie_space

TYPE: AppResourcesGenieSpace | None | VariableType DEFAULT: None

job

TYPE: AppResourcesJob | None | VariableType DEFAULT: None

name

The name of the app to grant permission on

TYPE: str | VariableType

postgres

TYPE: AppResourcesPostgres | None | VariableType DEFAULT: None

secret

TYPE: AppResourcesSecret | None | VariableType DEFAULT: None

serving_endpoint

TYPE: AppResourcesServingEndpoint | None | VariableType DEFAULT: None

sql_warehouse

TYPE: AppResourcesSqlWarehouse | None | VariableType DEFAULT: None

uc_securable

TYPE: AppResourcesUcSecurable | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResourcesApp ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

The name of the app to grant permission on

TYPE: str | None | VariableType DEFAULT: None

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResourcesDatabase ¤

Bases: BaseModel

PARAMETER DESCRIPTION
database_name

The name of database

TYPE: str | VariableType

instance_name

The name of database instance

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesExperiment ¤

Bases: BaseModel

PARAMETER DESCRIPTION
experiment_id

The ID of the MLflow experiment to grant permission on

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesGenieSpace ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

The name of the app to grant permission on

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType

space_id

The unique ID of Genie Space. * app attribute - reference to another Databricks App

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesJob ¤

Bases: BaseModel

PARAMETER DESCRIPTION
id

The unique identifier of the app. * compute_status attribute

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesPostgres ¤

Bases: BaseModel

PARAMETER DESCRIPTION
branch

Git branch to check out and deploy from. Required when git_repository.auto_deploy is true, since automatic deployment tracks pushes to a branch

TYPE: str | None | VariableType DEFAULT: None

database

The resource path of a specific database within the branch to grant permission on (e.g. projects/proj-abc123/branches/branch-xyz789/databases/db-456). If omitted, permission applies to the branch

TYPE: str | None | VariableType DEFAULT: None

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppResourcesSecret ¤

Bases: BaseModel

PARAMETER DESCRIPTION
key

Key of the secret to grant permission on

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType

scope

Scope of the secret to grant permission on

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesServingEndpoint ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

The name of the app to grant permission on

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesSqlWarehouse ¤

Bases: BaseModel

PARAMETER DESCRIPTION
id

The unique identifier of the app. * compute_status attribute

TYPE: str | VariableType

permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppResourcesUcSecurable ¤

Bases: BaseModel

PARAMETER DESCRIPTION
permission

Permission to grant on the experiment. Supported permissions are: CAN_READ, CAN_EDIT, CAN_MANAGE

TYPE: str | VariableType

securable_full_name

The full name of UC securable, i.e. my-catalog.my-schema.my-volume

TYPE: str | VariableType

securable_type

The type of UC securable. Supported values are CONNECTION, FUNCTION, TABLE, VOLUME

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppTelemetryExportDestination ¤

Bases: BaseModel

PARAMETER DESCRIPTION
unity_catalog

Unity Catalog telemetry destination.

TYPE: AppTelemetryExportDestinationUnityCatalog | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppTelemetryExportDestinationUnityCatalog ¤

Bases: BaseModel

PARAMETER DESCRIPTION
logs_table

Full name of the Unity Catalog table for logs.

TYPE: str | VariableType

metrics_table

Full name of the Unity Catalog table for metrics.

TYPE: str | VariableType

traces_table

Full name of the Unity Catalog table for traces.

TYPE: str | VariableType


laktory.models.resources.databricks.app.AppTelemetryExportDestinations ¤

Bases: BaseModel

PARAMETER DESCRIPTION
unity_catalog

TYPE: AppTelemetryExportDestinationsUnityCatalog | None | VariableType DEFAULT: None


laktory.models.resources.databricks.app.AppTelemetryExportDestinationsUnityCatalog ¤

Bases: BaseModel

PARAMETER DESCRIPTION
logs_table

Full name of the Unity Catalog table for OpenTelemetry logs

TYPE: str | VariableType

metrics_table

Full name of the Unity Catalog table for OpenTelemetry metrics

TYPE: str | VariableType

traces_table

Full name of the Unity Catalog table for OpenTelemetry traces (spans)

TYPE: str | VariableType