From 8056fafa1527057138695b7b5050667f461c8ee9 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:22:34 +0000 Subject: [PATCH 01/52] Test the dataclass path in test_add_resource_type test_add_resource_type and test_add_resource_type_dict had byte-identical bodies, both feeding dict_example, so the add_(dataclass) normalization path went untested for the parametrized resources. Feed dataclass_example to the non-_dict variant, mirroring test_add_job vs test_add_job_dict. Co-authored-by: Isaac --- python/databricks_tests/core/test_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/databricks_tests/core/test_resources.py b/python/databricks_tests/core/test_resources.py index ee2ab7ec405..e27b4331db2 100644 --- a/python/databricks_tests/core/test_resources.py +++ b/python/databricks_tests/core/test_resources.py @@ -163,7 +163,7 @@ def test_add_resource_type(tc: TestCase, tpe: _ResourceType): resources, **{ "resource_name": "my_resource", - tpe.singular_name: tc.dict_example, + tpe.singular_name: tc.dataclass_example, }, ) From 41d5a5d587a040b9a11d91b91584294ff16353cd Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:22:56 +0000 Subject: [PATCH 02/52] Generate per-resource unit-test cases from the codegen model Stop hand-writing a TestCase per resource in test_resources.py. A new codegen step (generated_test_cases.py, rendered from test_case.py.tmpl) synthesizes dict_example and dataclass_example for every wired resource from the schema model and writes one file per resource under databricks_tests/core/_generated/, collected into test_cases. A newly wired resource now gets its unit-test coverage for free. dict_example and dataclass_example are rendered two independent ways from one synthesized value tree, so the dict->dataclass _transform assertion stays meaningful. Field policy: required fields fully expanded, plus optional composite fields on the resource itself; nested objects contribute only their required fields, which bounds example size and avoids the recursive Task/ForEachTask schema. Optional scalar, deprecated, and private-preview fields are omitted. The hand-written TestCase dataclass moves to _resource_test_case.py so the generated modules can import it without a cycle. Co-authored-by: Isaac --- python/Taskfile.yml | 2 + .../codegen/codegen/generated_test_cases.py | 278 ++++++++++++++++++ python/codegen/codegen/main.py | 4 + python/codegen/codegen/test_case.py.tmpl | 16 + python/databricks_tests/.gitattributes | 4 + .../core/_generated/__init__.py | 21 ++ .../core/_generated/alerts.py | 58 ++++ .../core/_generated/catalogs.py | 35 +++ .../databricks_tests/core/_generated/jobs.py | 92 ++++++ .../core/_generated/pipelines.py | 65 ++++ .../core/_generated/schemas.py | 32 ++ .../core/_generated/volumes.py | 35 +++ .../core/_resource_test_case.py | 12 + .../databricks_tests/core/test_resources.py | 129 +------- 14 files changed, 659 insertions(+), 124 deletions(-) create mode 100644 python/codegen/codegen/generated_test_cases.py create mode 100644 python/codegen/codegen/test_case.py.tmpl create mode 100644 python/databricks_tests/.gitattributes create mode 100644 python/databricks_tests/core/_generated/__init__.py create mode 100644 python/databricks_tests/core/_generated/alerts.py create mode 100644 python/databricks_tests/core/_generated/catalogs.py create mode 100644 python/databricks_tests/core/_generated/jobs.py create mode 100644 python/databricks_tests/core/_generated/pipelines.py create mode 100644 python/databricks_tests/core/_generated/schemas.py create mode 100644 python/databricks_tests/core/_generated/volumes.py create mode 100644 python/databricks_tests/core/_resource_test_case.py diff --git a/python/Taskfile.yml b/python/Taskfile.yml index 602e92028a5..49621efd6a6 100644 --- a/python/Taskfile.yml +++ b/python/Taskfile.yml @@ -78,6 +78,8 @@ tasks: -exec rm -rf {} \; # core/ is hand-written except for the generated wiring under _generated/. - rm -rf databricks/bundles/core/_generated + # test_resources.py is hand-written except for the generated TestCase data. + - rm -rf databricks_tests/core/_generated - cd codegen && uv run -m pytest codegen_tests - cd codegen && uv run -m codegen.main --output .. # Generated code is fixed and formatted by the global ruff (see ../ruff.toml). diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py new file mode 100644 index 00000000000..7decc29a897 --- /dev/null +++ b/python/codegen/codegen/generated_test_cases.py @@ -0,0 +1,278 @@ +""" +Generates the per-resource TestCase data driving databricks_tests/core/test_resources.py. + +For every wired resource a file _generated/.py is written (rendered from +test_case.py.tmpl) exposing _test_case() -> (TestCase, _ResourceType). The generated +_generated/__init__.py collects them into `test_cases`, which test_resources.py imports +and parametrizes its per-resource tests off. + +dict_example and dataclass_example are synthesized from one value tree and rendered two +independent ways -- a dict literal and a constructor expression -- so the dict->dataclass +_transform assertion in test_resources.py stays meaningful (the two forms don't share the +runtime transform path). + +Field policy: all required fields (fully expanded), plus optional composite fields +(nested dataclass / list / map / enum) on the resource itself; nested objects contribute +only their required fields, which keeps examples bounded and avoids recursive schemas +(e.g. jobs Task -> ForEachTask -> Task, reachable only through an optional field). Optional +scalar, deprecated, and experimental fields are omitted. +""" + +from dataclasses import dataclass +from pathlib import Path +from string import Template +from typing import Union + +import codegen.jsonschema as openapi +import codegen.packages as packages +from codegen.generated_enum import _camel_to_upper_snake +from codegen.generated_wiring import _WiredResource, _wired_resources + +HEADER = "# Code generated by pydabs-codegen. DO NOT EDIT.\n\n" + +_TEST_CASE_TEMPLATE = Template( + (Path(__file__).parent / "test_case.py.tmpl").read_text() +) + + +# Synthesized value tree. Each node renders both as a dict literal (dict_example) +# and as a constructor expression (dataclass_example). + + +@dataclass +class _Scalar: + dict_src: str + dataclass_src: str + + +@dataclass +class _Enum: + value: str + class_name: str + module: str + member: str + + +@dataclass +class _Object: + class_name: str + module: str + fields: "list[tuple[str, _Value]]" + + +@dataclass +class _List: + item: "_Value" + + +@dataclass +class _Map: + key: str + value: "_Value" + + +_Value = Union[_Scalar, _Enum, _Object, _List, _Map] + + +def _ref_name(ref: str) -> str: + return ref.split("/")[-1] + + +def _is_composite(ref: str) -> bool: + if ref.startswith("#/$defs/slice/") or ref.startswith("#/$defs/map/"): + return True + + return _ref_name(ref) not in packages.PRIMITIVES + + +def _synth_scalar(name: str, hint: str) -> _Scalar: + if name == "string": + return _Scalar(f'"{hint}"', f'"{hint}"') + if name in ("integer", "int", "int64"): + return _Scalar("0", "0") + if name in ("number", "float", "float64"): + return _Scalar("0.0", "0.0") + if name in ("boolean", "bool"): + return _Scalar("True", "True") + + raise ValueError(f"Unknown primitive: {name}") + + +def _synth_ref( + namespace: str, + ref: str, + hint: str, + schemas: dict[str, openapi.Schema], + visiting: set[str], +) -> _Value: + if ref.startswith("#/$defs/slice/"): + element_ref = ref.replace("#/$defs/slice/", "#/$defs/") + + return _List(_synth_ref(namespace, element_ref, hint, schemas, visiting)) + + if ref.startswith("#/$defs/map/"): + # generate_type only ever produces dict[str, str] maps (map/string). + if ref != "#/$defs/map/string": + raise ValueError(f"Unsupported map ref: {ref}") + + return _Map("key", _Scalar('"value"', '"value"')) + + name = _ref_name(ref) + if name in packages.PRIMITIVES: + return _synth_scalar(name, hint) + + schema = schemas[name] + class_name = packages.get_class_name(ref) + module = packages.get_package(namespace, ref) + assert module + + if schema.type == openapi.SchemaType.STRING: + value = schema.enum[0] + + return _Enum(value, class_name, module, _camel_to_upper_snake(value)) + + # Only reachable through required fields at this depth (see _synth_object); a + # required cycle has no finite value, so fail loudly instead of looping. + if name in visiting: + raise ValueError(f"Required-field cycle through '{name}'") + + return _synth_object(namespace, name, schema, schemas, visiting, top_level=False) + + +def _synth_object( + namespace: str, + schema_name: str, + schema: openapi.Schema, + schemas: dict[str, openapi.Schema], + visiting: set[str], + top_level: bool, +) -> _Object: + visiting = visiting | {schema_name} + fields: list[tuple[str, _Value]] = [] + + for field_name, prop in schema.properties.items(): + required = field_name in schema.required + + if not required: + # Nested objects contribute only required fields; on the resource + # itself, also include stable optional composite fields. + if not top_level: + continue + if not _is_composite(prop.ref): + continue + if prop.deprecated or prop.stage == openapi.LaunchStage.PRIVATE_PREVIEW: + continue + + value = _synth_ref(namespace, prop.ref, field_name, schemas, visiting) + fields.append((field_name, value)) + + return _Object( + packages.get_class_name(schema_name), _module_of(namespace, schema_name), fields + ) + + +def _module_of(namespace: str, schema_name: str) -> str: + module = packages.get_package(namespace, schema_name) + assert module + + return module + + +def _render_dict(value: _Value) -> str: + if isinstance(value, _Scalar): + return value.dict_src + if isinstance(value, _Enum): + return f'"{value.value}"' + if isinstance(value, _List): + return f"[{_render_dict(value.item)}]" + if isinstance(value, _Map): + return "{" + f'"{value.key}": {_render_dict(value.value)}' + "}" + + fields = ", ".join( + f'"{name}": {_render_dict(child)}' for name, child in value.fields + ) + + return "{" + fields + "}" + + +def _render_dataclass(value: _Value) -> str: + if isinstance(value, _Scalar): + return value.dataclass_src + if isinstance(value, _Enum): + return f"{value.class_name}.{value.member}" + if isinstance(value, _List): + return f"[{_render_dataclass(value.item)}]" + if isinstance(value, _Map): + return "{" + f'"{value.key}": {_render_dataclass(value.value)}' + "}" + + fields = ", ".join( + f"{name}={_render_dataclass(child)}" for name, child in value.fields + ) + + return f"{value.class_name}({fields})" + + +def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: + if isinstance(value, _Enum): + out.add((value.module, value.class_name)) + elif isinstance(value, _Object): + out.add((value.module, value.class_name)) + for _, child in value.fields: + _collect_imports(child, out) + elif isinstance(value, _List): + _collect_imports(value.item, out) + elif isinstance(value, _Map): + _collect_imports(value.value, out) + + +def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): + resources = _wired_resources() + + generated_path = Path(output) / "databricks_tests" / "core" / "_generated" + generated_path.mkdir(parents=True, exist_ok=True) + + plural_to_ref = {ns: ref for ref, ns in packages.RESOURCE_NAMESPACE.items()} + + for r in resources: + resource_ref = plural_to_ref[r.plural_name] + schema = schemas[resource_ref] + + example = _synth_object( + r.plural_name, resource_ref, schema, schemas, set(), top_level=True + ) + + imports: set[tuple[str, str]] = set() + _collect_imports(example, imports) + model_imports = "\n".join( + f"from {module} import {class_name}" + for module, class_name in sorted(imports) + ) + + code = _TEST_CASE_TEMPLATE.substitute( + singular=r.singular_name, + plural=r.plural_name, + model_imports=model_imports, + dict_example=_render_dict(example), + dataclass_example=_render_dataclass(example), + ) + (generated_path / f"{r.plural_name}.py").write_text(HEADER + code) + + (generated_path / "__init__.py").write_text(HEADER + _collector_code(resources)) + + print(f"Writing test cases into {generated_path}") + + +def _collector_code(resources: list[_WiredResource]) -> str: + module_imports = "\n".join(f" {r.plural_name}," for r in resources) + entries = "\n".join(f" {r.plural_name}._test_case()," for r in resources) + + return f"""from databricks_tests.core._generated import ( +{module_imports} +) + +__all__ = ["test_cases"] + +test_cases = [ +{entries} +] +""" diff --git a/python/codegen/codegen/main.py b/python/codegen/codegen/main.py index 7927da85961..924ec269e88 100644 --- a/python/codegen/codegen/main.py +++ b/python/codegen/codegen/main.py @@ -8,6 +8,7 @@ import codegen.generated_dataclass_patch as generated_dataclass_patch import codegen.generated_enum as generated_enum import codegen.generated_imports as generated_imports +import codegen.generated_test_cases as generated_test_cases import codegen.generated_wiring as generated_wiring import codegen.jsonschema as openapi import codegen.jsonschema_patch as openapi_patch @@ -52,6 +53,9 @@ def main(output: str): # decorators, and the core package __init__). generated_wiring.write_wiring(output) + # Generate the per-resource TestCase data driving test_resources.py. + generated_test_cases.write_test_cases(output, schemas) + def _transitively_mark_deprecated_and_private( roots: list[str], diff --git a/python/codegen/codegen/test_case.py.tmpl b/python/codegen/codegen/test_case.py.tmpl new file mode 100644 index 00000000000..8abe9d1ce5e --- /dev/null +++ b/python/codegen/codegen/test_case.py.tmpl @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources, ${singular}_mutator +from databricks.bundles.core._generated.${plural} import _resource_type +from databricks_tests.core._resource_test_case import TestCase +$model_imports + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_${singular}, + dict_example=$dict_example, + dataclass_example=$dataclass_example, + mutator=${singular}_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/.gitattributes b/python/databricks_tests/.gitattributes new file mode 100644 index 00000000000..810eb0c20ec --- /dev/null +++ b/python/databricks_tests/.gitattributes @@ -0,0 +1,4 @@ +# Generated by pydabs-codegen (see python/codegen). The per-resource TestCase +# data under core/_generated/ drives the parametrized tests in test_resources.py; +# the rest of databricks_tests/ is hand-written. +core/_generated/** linguist-generated=true diff --git a/python/databricks_tests/core/_generated/__init__.py b/python/databricks_tests/core/_generated/__init__.py new file mode 100644 index 00000000000..9cf2cc18cee --- /dev/null +++ b/python/databricks_tests/core/_generated/__init__.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks_tests.core._generated import ( + alerts, + catalogs, + jobs, + pipelines, + schemas, + volumes, +) + +__all__ = ["test_cases"] + +test_cases = [ + alerts._test_case(), + catalogs._test_case(), + jobs._test_case(), + pipelines._test_case(), + schemas._test_case(), + volumes._test_case(), +] diff --git a/python/databricks_tests/core/_generated/alerts.py b/python/databricks_tests/core/_generated/alerts.py new file mode 100644 index 00000000000..ec85f6daeae --- /dev/null +++ b/python/databricks_tests/core/_generated/alerts.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.alerts._models.alert import Alert +from databricks.bundles.alerts._models.alert_v2_evaluation import AlertV2Evaluation +from databricks.bundles.alerts._models.alert_v2_operand_column import ( + AlertV2OperandColumn, +) +from databricks.bundles.alerts._models.alert_v2_run_as import AlertV2RunAs +from databricks.bundles.alerts._models.comparison_operator import ComparisonOperator +from databricks.bundles.alerts._models.cron_schedule import CronSchedule +from databricks.bundles.alerts._models.lifecycle import Lifecycle +from databricks.bundles.alerts._models.permission import Permission +from databricks.bundles.alerts._models.permission_level import PermissionLevel +from databricks.bundles.core import Resources, alert_mutator +from databricks.bundles.core._generated.alerts import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_alert, + dict_example={ + "display_name": "display_name", + "evaluation": { + "comparison_operator": "LESS_THAN", + "source": {"name": "name"}, + }, + "lifecycle": {}, + "permissions": [{"level": "CAN_MANAGE"}], + "query_text": "query_text", + "run_as": {}, + "schedule": { + "quartz_cron_schedule": "quartz_cron_schedule", + "timezone_id": "timezone_id", + }, + "warehouse_id": "warehouse_id", + }, + dataclass_example=Alert( + display_name="display_name", + evaluation=AlertV2Evaluation( + comparison_operator=ComparisonOperator.LESS_THAN, + source=AlertV2OperandColumn(name="name"), + ), + lifecycle=Lifecycle(), + permissions=[Permission(level=PermissionLevel.CAN_MANAGE)], + query_text="query_text", + run_as=AlertV2RunAs(), + schedule=CronSchedule( + quartz_cron_schedule="quartz_cron_schedule", + timezone_id="timezone_id", + ), + warehouse_id="warehouse_id", + ), + mutator=alert_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/catalogs.py b/python/databricks_tests/core/_generated/catalogs.py new file mode 100644 index 00000000000..177ada20428 --- /dev/null +++ b/python/databricks_tests/core/_generated/catalogs.py @@ -0,0 +1,35 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.catalogs._models.catalog import Catalog +from databricks.bundles.catalogs._models.encryption_settings import EncryptionSettings +from databricks.bundles.catalogs._models.lifecycle import Lifecycle +from databricks.bundles.catalogs._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.core import Resources, catalog_mutator +from databricks.bundles.core._generated.catalogs import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_catalog, + dict_example={ + "grants": [{}], + "lifecycle": {}, + "managed_encryption_settings": {}, + "name": "name", + "options": {"key": "value"}, + "properties": {"key": "value"}, + }, + dataclass_example=Catalog( + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + managed_encryption_settings=EncryptionSettings(), + name="name", + options={"key": "value"}, + properties={"key": "value"}, + ), + mutator=catalog_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/jobs.py b/python/databricks_tests/core/_generated/jobs.py new file mode 100644 index 00000000000..3a9dd6cec6d --- /dev/null +++ b/python/databricks_tests/core/_generated/jobs.py @@ -0,0 +1,92 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, job_mutator +from databricks.bundles.core._generated.jobs import _resource_type +from databricks.bundles.jobs._models.continuous import Continuous +from databricks.bundles.jobs._models.cron_schedule import CronSchedule +from databricks.bundles.jobs._models.git_provider import GitProvider +from databricks.bundles.jobs._models.git_source import GitSource +from databricks.bundles.jobs._models.job import Job +from databricks.bundles.jobs._models.job_cluster import JobCluster +from databricks.bundles.jobs._models.job_email_notifications import ( + JobEmailNotifications, +) +from databricks.bundles.jobs._models.job_environment import JobEnvironment +from databricks.bundles.jobs._models.job_notification_settings import ( + JobNotificationSettings, +) +from databricks.bundles.jobs._models.job_parameter_definition import ( + JobParameterDefinition, +) +from databricks.bundles.jobs._models.job_permission import JobPermission +from databricks.bundles.jobs._models.job_permission_level import JobPermissionLevel +from databricks.bundles.jobs._models.job_run_as import JobRunAs +from databricks.bundles.jobs._models.jobs_health_rules import JobsHealthRules +from databricks.bundles.jobs._models.lifecycle import Lifecycle +from databricks.bundles.jobs._models.performance_target import PerformanceTarget +from databricks.bundles.jobs._models.queue_settings import QueueSettings +from databricks.bundles.jobs._models.task import Task +from databricks.bundles.jobs._models.trigger_configuration import TriggerConfiguration +from databricks.bundles.jobs._models.trigger_settings import TriggerSettings +from databricks.bundles.jobs._models.webhook_notifications import WebhookNotifications +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_job, + dict_example={ + "continuous": {}, + "email_notifications": {}, + "environments": [{"environment_key": "environment_key"}], + "git_source": {"git_provider": "gitHub", "git_url": "git_url"}, + "health": {}, + "job_clusters": [{"job_cluster_key": "job_cluster_key"}], + "lifecycle": {}, + "notification_settings": {}, + "parameters": [{"default": "default", "name": "name"}], + "performance_target": "PERFORMANCE_OPTIMIZED", + "permissions": [{"level": "CAN_MANAGE"}], + "queue": {"enabled": True}, + "run_as": {}, + "schedule": { + "quartz_cron_expression": "quartz_cron_expression", + "timezone_id": "timezone_id", + }, + "tags": {"key": "value"}, + "tasks": [{"task_key": "task_key"}], + "trigger": {}, + "triggers": [{}], + "webhook_notifications": {}, + }, + dataclass_example=Job( + continuous=Continuous(), + email_notifications=JobEmailNotifications(), + environments=[JobEnvironment(environment_key="environment_key")], + git_source=GitSource( + git_provider=GitProvider.GIT_HUB, git_url="git_url" + ), + health=JobsHealthRules(), + job_clusters=[JobCluster(job_cluster_key="job_cluster_key")], + lifecycle=Lifecycle(), + notification_settings=JobNotificationSettings(), + parameters=[JobParameterDefinition(default="default", name="name")], + performance_target=PerformanceTarget.PERFORMANCE_OPTIMIZED, + permissions=[JobPermission(level=JobPermissionLevel.CAN_MANAGE)], + queue=QueueSettings(enabled=True), + run_as=JobRunAs(), + schedule=CronSchedule( + quartz_cron_expression="quartz_cron_expression", + timezone_id="timezone_id", + ), + tags={"key": "value"}, + tasks=[Task(task_key="task_key")], + trigger=TriggerSettings(), + triggers=[TriggerConfiguration()], + webhook_notifications=WebhookNotifications(), + ), + mutator=job_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/pipelines.py b/python/databricks_tests/core/_generated/pipelines.py new file mode 100644 index 00000000000..a4e65573317 --- /dev/null +++ b/python/databricks_tests/core/_generated/pipelines.py @@ -0,0 +1,65 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, pipeline_mutator +from databricks.bundles.core._generated.pipelines import _resource_type +from databricks.bundles.pipelines._models.event_log_spec import EventLogSpec +from databricks.bundles.pipelines._models.filters import Filters +from databricks.bundles.pipelines._models.ingestion_pipeline_definition import ( + IngestionPipelineDefinition, +) +from databricks.bundles.pipelines._models.lifecycle import Lifecycle +from databricks.bundles.pipelines._models.notifications import Notifications +from databricks.bundles.pipelines._models.pipeline import Pipeline +from databricks.bundles.pipelines._models.pipeline_cluster import PipelineCluster +from databricks.bundles.pipelines._models.pipeline_library import PipelineLibrary +from databricks.bundles.pipelines._models.pipeline_permission import PipelinePermission +from databricks.bundles.pipelines._models.pipeline_permission_level import ( + PipelinePermissionLevel, +) +from databricks.bundles.pipelines._models.pipelines_environment import ( + PipelinesEnvironment, +) +from databricks.bundles.pipelines._models.run_as import RunAs +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_pipeline, + dict_example={ + "clusters": [{}], + "configuration": {"key": "value"}, + "environment": {}, + "event_log": {}, + "filters": {}, + "ingestion_definition": {}, + "libraries": [{}], + "lifecycle": {}, + "notifications": [{}], + "parameters": {"key": "value"}, + "permissions": [{"level": "CAN_MANAGE"}], + "run_as": {}, + "tags": {"key": "value"}, + }, + dataclass_example=Pipeline( + clusters=[PipelineCluster()], + configuration={"key": "value"}, + environment=PipelinesEnvironment(), + event_log=EventLogSpec(), + filters=Filters(), + ingestion_definition=IngestionPipelineDefinition(), + libraries=[PipelineLibrary()], + lifecycle=Lifecycle(), + notifications=[Notifications()], + parameters={"key": "value"}, + permissions=[ + PipelinePermission(level=PipelinePermissionLevel.CAN_MANAGE) + ], + run_as=RunAs(), + tags={"key": "value"}, + ), + mutator=pipeline_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/schemas.py b/python/databricks_tests/core/_generated/schemas.py new file mode 100644 index 00000000000..49adceab523 --- /dev/null +++ b/python/databricks_tests/core/_generated/schemas.py @@ -0,0 +1,32 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, schema_mutator +from databricks.bundles.core._generated.schemas import _resource_type +from databricks.bundles.schemas._models.lifecycle import Lifecycle +from databricks.bundles.schemas._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.schemas._models.schema import Schema +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_schema, + dict_example={ + "catalog_name": "catalog_name", + "grants": [{}], + "lifecycle": {}, + "name": "name", + "properties": {"key": "value"}, + }, + dataclass_example=Schema( + catalog_name="catalog_name", + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + properties={"key": "value"}, + ), + mutator=schema_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/volumes.py b/python/databricks_tests/core/_generated/volumes.py new file mode 100644 index 00000000000..bf8b434adec --- /dev/null +++ b/python/databricks_tests/core/_generated/volumes.py @@ -0,0 +1,35 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, volume_mutator +from databricks.bundles.core._generated.volumes import _resource_type +from databricks.bundles.volumes._models.lifecycle import Lifecycle +from databricks.bundles.volumes._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.volumes._models.volume import Volume +from databricks.bundles.volumes._models.volume_type import VolumeType +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_volume, + dict_example={ + "catalog_name": "catalog_name", + "grants": [{}], + "lifecycle": {}, + "name": "name", + "schema_name": "schema_name", + "volume_type": "MANAGED", + }, + dataclass_example=Volume( + catalog_name="catalog_name", + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + schema_name="schema_name", + volume_type=VolumeType.MANAGED, + ), + mutator=volume_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_resource_test_case.py b/python/databricks_tests/core/_resource_test_case.py new file mode 100644 index 00000000000..a9755e8e95c --- /dev/null +++ b/python/databricks_tests/core/_resource_test_case.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from typing import Callable + +from databricks.bundles.core._resource import Resource + + +@dataclass(kw_only=True) +class TestCase: + add_resource: Callable + dict_example: dict + dataclass_example: Resource + mutator: Callable diff --git a/python/databricks_tests/core/test_resources.py b/python/databricks_tests/core/test_resources.py index e27b4331db2..ed50243d785 100644 --- a/python/databricks_tests/core/test_resources.py +++ b/python/databricks_tests/core/test_resources.py @@ -1,134 +1,15 @@ -from dataclasses import dataclass, replace -from typing import Callable +from dataclasses import replace import pytest -from databricks.bundles.alerts._models.alert import Alert -from databricks.bundles.alerts._models.alert_v2_evaluation import AlertV2Evaluation -from databricks.bundles.alerts._models.alert_v2_operand_column import ( - AlertV2OperandColumn, -) -from databricks.bundles.alerts._models.comparison_operator import ComparisonOperator -from databricks.bundles.alerts._models.cron_schedule import CronSchedule -from databricks.bundles.catalogs._models.catalog import Catalog -from databricks.bundles.core import ( - Location, - Resources, - Severity, - alert_mutator, - catalog_mutator, - job_mutator, - pipeline_mutator, - schema_mutator, - volume_mutator, -) +from databricks.bundles.core import Location, Resources, Severity from databricks.bundles.core._bundle import Bundle -from databricks.bundles.core._resource import Resource from databricks.bundles.core._resource_mutator import ResourceMutator from databricks.bundles.core._resource_type import _ResourceType from databricks.bundles.jobs._models.job import Job -from databricks.bundles.pipelines._models.pipeline import Pipeline -from databricks.bundles.schemas._models.schema import Schema -from databricks.bundles.volumes._models.volume import Volume - - -@dataclass(kw_only=True) -class TestCase: - add_resource: Callable - dict_example: dict - dataclass_example: Resource - mutator: Callable - - -resource_types = {tpe.resource_type: tpe for tpe in _ResourceType.all()} -test_cases = [ - ( - TestCase( - add_resource=Resources.add_job, - dict_example={"name": "My job"}, - dataclass_example=Job(name="My job"), - mutator=job_mutator, - ), - resource_types[Job], - ), - ( - TestCase( - add_resource=Resources.add_pipeline, - dict_example={"name": "My pipeline"}, - dataclass_example=Pipeline(name="My pipeline"), - mutator=pipeline_mutator, - ), - resource_types[Pipeline], - ), - ( - TestCase( - add_resource=Resources.add_volume, - dict_example={ - "name": "My Volume", - "catalog_name": "my_catalog", - "schema_name": "my_schema", - }, - dataclass_example=Volume( - catalog_name="my_catalog", - name="My Volume", - schema_name="my_schema", - ), - mutator=volume_mutator, - ), - resource_types[Volume], - ), - ( - TestCase( - add_resource=Resources.add_schema, - dict_example={"catalog_name": "my_catalog", "name": "my_schema"}, - dataclass_example=Schema(catalog_name="my_catalog", name="my_schema"), - mutator=schema_mutator, - ), - resource_types[Schema], - ), - ( - TestCase( - add_resource=Resources.add_alert, - dict_example={ - "display_name": "My Alert", - "query_text": "SELECT 1", - "warehouse_id": "my_warehouse", - "evaluation": { - "comparison_operator": "GREATER_THAN", - "source": {"name": "column_1"}, - }, - "schedule": { - "quartz_cron_schedule": "0 0 0 * * ?", - "timezone_id": "UTC", - }, - }, - dataclass_example=Alert( - display_name="My Alert", - query_text="SELECT 1", - warehouse_id="my_warehouse", - evaluation=AlertV2Evaluation( - comparison_operator=ComparisonOperator.GREATER_THAN, - source=AlertV2OperandColumn(name="column_1"), - ), - schedule=CronSchedule( - quartz_cron_schedule="0 0 0 * * ?", - timezone_id="UTC", - ), - ), - mutator=alert_mutator, - ), - resource_types[Alert], - ), - ( - TestCase( - add_resource=Resources.add_catalog, - dict_example={"name": "my_catalog"}, - dataclass_example=Catalog(name="my_catalog"), - mutator=catalog_mutator, - ), - resource_types[Catalog], - ), -] +from databricks_tests.core._generated import test_cases +from databricks_tests.core._resource_test_case import TestCase + test_case_ids = [tpe.plural_name for _, tpe in test_cases] From 871f7d24038024923c82c86aec3f2892e090e182 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:45:17 +0000 Subject: [PATCH 03/52] Fix ruff lint in the test-case generator The generator source lives outside databricks/databricks_tests, so pydabs-codegen's targeted ruff --fix does not reach it, but the root ruff check does. Sort imports and merge the two startswith calls into a single tuple call. No change to generated output. Co-authored-by: Isaac --- python/codegen/codegen/generated_test_cases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index 7decc29a897..1de481b5d0a 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -26,7 +26,7 @@ import codegen.jsonschema as openapi import codegen.packages as packages from codegen.generated_enum import _camel_to_upper_snake -from codegen.generated_wiring import _WiredResource, _wired_resources +from codegen.generated_wiring import _wired_resources, _WiredResource HEADER = "# Code generated by pydabs-codegen. DO NOT EDIT.\n\n" @@ -79,7 +79,7 @@ def _ref_name(ref: str) -> str: def _is_composite(ref: str) -> bool: - if ref.startswith("#/$defs/slice/") or ref.startswith("#/$defs/map/"): + if ref.startswith(("#/$defs/slice/", "#/$defs/map/")): return True return _ref_name(ref) not in packages.PRIMITIVES From d80a3608befb9c050b94813f9dd7e1a828a9d522 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 12:17:15 +0000 Subject: [PATCH 04/52] added explainatory comments --- .../codegen/codegen/generated_test_cases.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index 1de481b5d0a..c3984879c46 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -75,10 +75,18 @@ class _Map: def _ref_name(ref: str) -> str: + """Last path segment of a JSON-schema ref -- the schema name. + + :param ref: a JSON-schema reference, e.g. "#/$defs/.../jobs.Task" or "#/$defs/string". + """ return ref.split("/")[-1] def _is_composite(ref: str) -> bool: + """Whether a ref is a composite type (list, map, object, or enum) rather than a scalar. + + :param ref: the JSON-schema reference of a field's type. + """ if ref.startswith(("#/$defs/slice/", "#/$defs/map/")): return True @@ -86,6 +94,11 @@ def _is_composite(ref: str) -> bool: def _synth_scalar(name: str, hint: str) -> _Scalar: + """Placeholder value for a primitive (str -> hint, int -> 0, float -> 0.0, bool -> True). + + :param name: the primitive's schema name, e.g. "string", "int", "boolean". + :param hint: enclosing field name, used as the string placeholder so examples read meaningfully. + """ if name == "string": return _Scalar(f'"{hint}"', f'"{hint}"') if name in ("integer", "int", "int64"): @@ -105,6 +118,14 @@ def _synth_ref( schemas: dict[str, openapi.Schema], visiting: set[str], ) -> _Value: + """Synthesize a value node for whatever type a ref points at: list, map, scalar, enum, or nested object. + + :param namespace: the resource's namespace (e.g. "jobs"); selects the module a referenced type is generated into. + :param ref: the JSON-schema reference of the type to synthesize. + :param hint: enclosing field name, passed through as the string placeholder. + :param schemas: all post-patch schemas keyed by schema name, for looking up nested/enum types. + :param visiting: ancestor object names on the current path, used to detect required cycles. + """ if ref.startswith("#/$defs/slice/"): element_ref = ref.replace("#/$defs/slice/", "#/$defs/") @@ -147,6 +168,15 @@ def _synth_object( visiting: set[str], top_level: bool, ) -> _Object: + """Synthesize an object value, choosing fields by policy: all required fields, plus (only at the resource top level) stable optional composite fields. + + :param namespace: the resource's namespace, threaded through to resolve nested types' modules. + :param schema_name: this object's schema name (e.g. "resources.Alert"). + :param schema: the Schema for this object -- its properties and required list. + :param schemas: all post-patch schemas, for recursing into nested types. + :param visiting: ancestor object names on the current path (cycle guard). + :param top_level: True only for the resource itself; when False, all optional fields are dropped. + """ visiting = visiting | {schema_name} fields: list[tuple[str, _Value]] = [] @@ -172,6 +202,11 @@ def _synth_object( def _module_of(namespace: str, schema_name: str) -> str: + """Python module a (non-primitive) schema's generated class lives in; asserts it exists. + + :param namespace: the resource's namespace; the type is generated under databricks.bundles.._models. + :param schema_name: the object/enum schema name to resolve. + """ module = packages.get_package(namespace, schema_name) assert module @@ -179,6 +214,10 @@ def _module_of(namespace: str, schema_name: str) -> str: def _render_dict(value: _Value) -> str: + """Render a synthesized value as a dict-literal source string (the dict_example form). + + :param value: the synthesized value node to render. + """ if isinstance(value, _Scalar): return value.dict_src if isinstance(value, _Enum): @@ -196,6 +235,10 @@ def _render_dict(value: _Value) -> str: def _render_dataclass(value: _Value) -> str: + """Render a synthesized value as a constructor-expression source string (the dataclass_example form). + + :param value: the synthesized value node to render. + """ if isinstance(value, _Scalar): return value.dataclass_src if isinstance(value, _Enum): @@ -213,6 +256,11 @@ def _render_dataclass(value: _Value) -> str: def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: + """Collect (module, class_name) pairs the dataclass_example needs, walking nested objects/enums. + + :param value: the synthesized value node to walk. + :param out: set accumulating the (module, class_name) import pairs; mutated in place. + """ if isinstance(value, _Enum): out.add((value.module, value.class_name)) elif isinstance(value, _Object): @@ -226,6 +274,11 @@ def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): + """Write one _generated/.py per wired resource plus the collector __init__.py. + + :param output: codegen output root (the python/ directory); files land under databricks_tests/core/_generated. + :param schemas: all post-patch schemas, used to synthesize each resource's dict/dataclass examples. + """ resources = _wired_resources() generated_path = Path(output) / "databricks_tests" / "core" / "_generated" @@ -263,6 +316,10 @@ def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): def _collector_code(resources: list[_WiredResource]) -> str: + """Source for _generated/__init__.py: imports the per-resource modules and assembles `test_cases`. + + :param resources: the wired resources, in the order their test cases are collected. + """ module_imports = "\n".join(f" {r.plural_name}," for r in resources) entries = "\n".join(f" {r.plural_name}._test_case()," for r in resources) From 24c12002a9dc2b32a336c2b47cdaf7e8bd43ffa6 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 12:59:32 +0000 Subject: [PATCH 05/52] Emit x-databricks-launch-stage for all stamped launch stages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The schema generator only emitted x-databricks-launch-stage for private-preview fields, bundling two concerns in one branch: hiding private-preview fields from editor completions (DoNotSuggest) and emitting the machine-readable launch stage. Downstream codegen could therefore only distinguish private-preview from everything else. Split the two concerns: DoNotSuggest stays private-preview-only, while every field the contract stamps with a launch stage — GA, PUBLIC_BETA, PUBLIC_PREVIEW, PRIVATE_PREVIEW — now emits x-databricks-launch-stage so downstream tooling can read each field's stability. A field the contract leaves unstamped stays unmarked rather than defaulting to GA, via the new parseFieldLaunchStage (the enum path keeps dropping GA, unchanged). Regenerated jsonschema.json. pydabs codegen is unaffected (it branches only on PRIVATE_PREVIEW), so python/databricks/bundles is unchanged. Co-authored-by: Isaac --- bundle/internal/schema/annotations.go | 14 +- bundle/internal/schema/annotations_test.go | 25 +- bundle/internal/schema/parser.go | 14 +- bundle/internal/schema/parser_test.go | 23 + bundle/schema/jsonschema.json | 3279 +++++++++++++------- 5 files changed, 2260 insertions(+), 1095 deletions(-) diff --git a/bundle/internal/schema/annotations.go b/bundle/internal/schema/annotations.go index d3e105540dc..8f5568b8249 100644 --- a/bundle/internal/schema/annotations.go +++ b/bundle/internal/schema/annotations.go @@ -158,14 +158,16 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) { s.DeprecationMessage = a.DeprecationMessage } - // Private-preview fields are hidden from completions and surfaced to - // downstream codegen via the launch stage: pydabs reads - // x-databricks-launch-stage from jsonschema.json to mark these fields - // experimental. Only the private-preview stage is emitted into the published - // schema — nothing consumes the others there; they surface only as the - // description prefix below and the per-value enumDescriptions labels. + // Private-preview fields are also hidden from editor completions. if a.LaunchStage == clijson.LaunchStagePrivatePreview { s.DoNotSuggest = true + } + + // Emit the launch stage for every field the contract stamps (GA included) so + // downstream codegen can read each field's stability, not just private + // preview. Fields the contract leaves unstamped stay empty. pydabs reads + // x-databricks-launch-stage from jsonschema.json. + if a.LaunchStage != "" { s.LaunchStage = string(a.LaunchStage) } diff --git a/bundle/internal/schema/annotations_test.go b/bundle/internal/schema/annotations_test.go index 7caaa0d29df..fde827de5ce 100644 --- a/bundle/internal/schema/annotations_test.go +++ b/bundle/internal/schema/annotations_test.go @@ -151,7 +151,7 @@ func TestStalePlaceholderDoesNotShadowMergedDescription(t *testing.T) { } func TestAssignAnnotationLaunchStage(t *testing.T) { - t.Run("public preview prefixes description and stays suggestible", func(t *testing.T) { + t.Run("public preview prefixes description, emits stage, stays suggestible", func(t *testing.T) { s := &jsonschema.Schema{} assignAnnotation(s, annotation.Descriptor{ Description: "Target QPS for the endpoint.", @@ -159,16 +159,35 @@ func TestAssignAnnotationLaunchStage(t *testing.T) { }) assert.Equal(t, "[Public Preview] Target QPS for the endpoint.", s.Description) assert.False(t, s.DoNotSuggest) - assert.Empty(t, s.LaunchStage) + assert.Equal(t, "PUBLIC_PREVIEW", s.LaunchStage) }) - t.Run("public beta prefixes description", func(t *testing.T) { + t.Run("public beta prefixes description and emits stage", func(t *testing.T) { s := &jsonschema.Schema{} assignAnnotation(s, annotation.Descriptor{ Description: "A field.", LaunchStage: "PUBLIC_BETA", }) assert.Equal(t, "[Beta] A field.", s.Description) + assert.Equal(t, "PUBLIC_BETA", s.LaunchStage) + }) + + t.Run("GA emits the stage without a description prefix", func(t *testing.T) { + s := &jsonschema.Schema{} + assignAnnotation(s, annotation.Descriptor{ + Description: "A field.", + LaunchStage: "GA", + }) + assert.Equal(t, "A field.", s.Description) + assert.False(t, s.DoNotSuggest) + assert.Equal(t, "GA", s.LaunchStage) + }) + + t.Run("unstamped field emits no stage", func(t *testing.T) { + s := &jsonschema.Schema{} + assignAnnotation(s, annotation.Descriptor{Description: "A field."}) + assert.Equal(t, "A field.", s.Description) + assert.Empty(t, s.LaunchStage) }) t.Run("private preview also hides from autocomplete", func(t *testing.T) { diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index 315a1e82ada..7b29451244d 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -109,6 +109,18 @@ func normalizeLaunchStage(launchStage string) (clijson.LaunchStage, error) { return stage, nil } +// parseFieldLaunchStage validates a field's contract launch stage, keeping every +// explicit stage (GA included) so the generated schema records each field's +// stability, not just previews. An empty stage means the contract assigns none; +// it stays empty (unmarked) instead of defaulting to GA, so only fields the +// contract actually stamps carry a stage. +func parseFieldLaunchStage(launchStage string) (clijson.LaunchStage, error) { + if launchStage == "" { + return "", nil + } + return clijson.ParseLaunchStage(launchStage) +} + // notableEnumLaunchStages keeps only the enum values whose launch stage is // worth surfacing (i.e. not GA), so the annotation file isn't polluted with a // stage for every value of a GA enum. Returns nil when nothing remains. @@ -199,7 +211,7 @@ func (p *annotationParser) extractAnnotations(typ reflect.Type) (annotation.File for k := range s.Properties { if refProp, ok := ref.Fields[k]; ok { - launchStage, fieldErr := normalizeLaunchStage(refProp.LaunchStage) + launchStage, fieldErr := parseFieldLaunchStage(refProp.LaunchStage) if fieldErr != nil { stageErr = errors.Join(stageErr, fmt.Errorf("%s.%s: %w", basePath, k, fieldErr)) } diff --git a/bundle/internal/schema/parser_test.go b/bundle/internal/schema/parser_test.go index 9b88228d89d..1e42591e53c 100644 --- a/bundle/internal/schema/parser_test.go +++ b/bundle/internal/schema/parser_test.go @@ -169,6 +169,29 @@ func TestNormalizeLaunchStageUnknown(t *testing.T) { assert.Error(t, err) } +func TestParseFieldLaunchStage(t *testing.T) { + tests := []struct { + input string + want clijson.LaunchStage + }{ + {"", ""}, // unstamped stays unstamped rather than defaulting to GA + {"GA", clijson.LaunchStageGA}, + {"PUBLIC_PREVIEW", clijson.LaunchStagePublicPreview}, + {"PUBLIC_BETA", clijson.LaunchStagePublicBeta}, + {"PRIVATE_PREVIEW", clijson.LaunchStagePrivatePreview}, + } + for _, tc := range tests { + got, err := parseFieldLaunchStage(tc.input) + require.NoError(t, err) + assert.Equal(t, tc.want, got) + } +} + +func TestParseFieldLaunchStageUnknown(t *testing.T) { + _, err := parseFieldLaunchStage("SOMETHING_ELSE") + assert.Error(t, err) +} + func TestNotableEnumLaunchStages(t *testing.T) { t.Run("drops GA, keeps preview values", func(t *testing.T) { got, err := notableEnumLaunchStages(map[string]string{ diff --git a/bundle/schema/jsonschema.json b/bundle/schema/jsonschema.json index 6383b5ac2c5..318d9a5d51d 100644 --- a/bundle/schema/jsonschema.json +++ b/bundle/schema/jsonschema.json @@ -85,18 +85,22 @@ "properties": { "custom_description": { "description": "Custom description for the alert. support mustache template.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "custom_summary": { "description": "Custom summary for the alert. support mustache template.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "display_name": { "description": "The display name of the alert.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "evaluation": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Evaluation" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Evaluation", + "x-databricks-launch-stage": "GA" }, "file_path": { "$ref": "#/$defs/string" @@ -113,7 +117,8 @@ }, "parent_path": { "description": "The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -122,24 +127,29 @@ }, "query_text": { "description": "Text of the query to be run.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "run_as": { "description": "Specifies the identity that will be used to run the alert.\nThis field allows you to configure alerts to run as a specific user or service principal.\n- For user identity: Set `user_name` to the email of an active workspace user. Users can only set this to their own email.\n- For service principal: Set `service_principal_name` to the application ID. Requires the `servicePrincipal/user` role.\nIf not specified, the alert will run as the request user.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2RunAs" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2RunAs", + "x-databricks-launch-stage": "GA" }, "run_as_user_name": { "description": "The run as username or application ID of service principal.\nOn Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role.\nDeprecated: Use `run_as` field instead. This field will be removed in a future release.", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "schedule": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.CronSchedule" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.CronSchedule", + "x-databricks-launch-stage": "GA" }, "warehouse_id": { "description": "ID of the SQL warehouse attached to the alert.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -164,7 +174,8 @@ "properties": { "budget_policy_id": { "description": "[Public Preview]", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "compute_max_instances": { "description": "[Private Preview] Maximum number of app instances. Must be set together with `compute_min_instances`.", @@ -179,14 +190,16 @@ "doNotSuggest": true }, "compute_size": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.ComputeSize" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.ComputeSize", + "x-databricks-launch-stage": "GA" }, "config": { "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.AppConfig" }, "description": { "description": "The description of the app.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "forward_user_access_token": { "description": "[Private Preview] Forward the user's access token to the app. Requires stopping and starting app compute to take effect.", @@ -196,11 +209,13 @@ }, "git_repository": { "description": "Git repository configuration for app deployments. When specified, deployments can\nreference code from this repository by providing only the git reference (branch, tag, or commit).", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.GitRepository" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.GitRepository", + "x-databricks-launch-stage": "GA" }, "git_source": { "description": "[Beta] Git source configuration for app deployments. Specifies which git reference (branch, tag, or commit)\nto use when deploying the app. Used in conjunction with git_repository to deploy code directly from git.\nThe source_code_path within git_source specifies the relative path to the app code within the repository.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.GitSource" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.GitSource", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -208,7 +223,8 @@ }, "name": { "description": "The name of the app. The name must contain only lowercase alphanumeric characters and hyphens.\nIt must be unique within the workspace.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -217,11 +233,13 @@ }, "resources": { "description": "Resources for the app.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/apps.AppResource" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/apps.AppResource", + "x-databricks-launch-stage": "GA" }, "source_code_path": { "description": "[Beta]", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "space": { "description": "[Private Preview] Name of the space this app belongs to.", @@ -231,15 +249,18 @@ }, "telemetry_export_destinations": { "description": "[Public Preview]", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/apps.TelemetryExportDestination" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/apps.TelemetryExportDestination", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "usage_policy_id": { "description": "[Public Preview]", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "user_api_scopes": { "description": "[Public Preview]", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -339,15 +360,18 @@ "properties": { "comment": { "description": "User-provided free-form text description.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "connection_name": { "description": "The name of the connection to an external data source.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "custom_max_retention_hours": { "description": "[Public Preview] Custom maximum retention period in hours for the catalog", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "grants": { "description": "The Unity Catalog privileges to grant to principals on this securable.", @@ -360,31 +384,38 @@ }, "managed_encryption_settings": { "description": "Control CMK encryption for managed catalog data", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.EncryptionSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.EncryptionSettings", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Name of catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "options": { "description": "A map of key-value properties attached to the securable.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "properties": { "description": "A map of key-value properties attached to the securable.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "provider_name": { "description": "The name of delta sharing provider.\n\nA Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "share_name": { "description": "The name of the share under the share provider.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "storage_root": { "description": "Storage root URL for managed tables within catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -406,87 +437,108 @@ "properties": { "apply_policy_default_values": { "description": "When set to true, fixed and default values from the policy will be used for fields that are omitted. When set to false, only fixed values from the policy will be applied.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "autoscale": { "description": "Parameters needed in order to automatically scale clusters up and down based on load.\nNote: autoscaling works best with DB runtime versions 3.0 or later.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AutoScale" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AutoScale", + "x-databricks-launch-stage": "GA" }, "autotermination_minutes": { "description": "Automatically terminates the cluster after it is inactive for this time in minutes. If not set,\nthis cluster will not be automatically terminated. If specified, the threshold must be between\n10 and 10000 minutes.\nUsers can also set this value to 0 to explicitly disable automatic termination.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "aws_attributes": { "description": "Attributes related to clusters running on Amazon Web Services.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes", + "x-databricks-launch-stage": "GA" }, "azure_attributes": { "description": "Attributes related to clusters running on Microsoft Azure.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes", + "x-databricks-launch-stage": "GA" }, "cluster_log_conf": { "description": "The configuration for delivering spark logs to a long-term storage destination.\nThree kinds of destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be specified\nfor one cluster. If the conf is given, the logs will be delivered to the destination every\n`5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while\nthe destination of executor logs is `$destination/$clusterId/executor`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf", + "x-databricks-launch-stage": "GA" }, "cluster_name": { "description": "Cluster name requested by the user. This doesn't have to be unique.\nIf not specified at creation, the cluster name will be an empty string.\nFor job clusters, the cluster name is automatically set based on the job and job run IDs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "custom_tags": { "description": "Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS\ninstances and EBS volumes) with these tags in addition to `default_tags`. Notes:\n\n- Currently, Databricks allows at most 45 custom tags\n\n- Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "data_security_mode": { "description": "Data security mode decides what data governance model to use when accessing data\nfrom a cluster.\n\n* `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate access mode depending on your compute configuration.\n* `DATA_SECURITY_MODE_STANDARD`: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other’s data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited.\n* `DATA_SECURITY_MODE_DEDICATED`: A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode.\n\nThe following modes are legacy aliases for the above modes:\n\n* `USER_ISOLATION`: Legacy alias for `DATA_SECURITY_MODE_STANDARD`.\n* `SINGLE_USER`: Legacy alias for `DATA_SECURITY_MODE_DEDICATED`.\n\nThe following modes are deprecated starting with Databricks Runtime 15.0 and\nwill be removed for future Databricks Runtime versions:\n\n* `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters.\n* `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high concurrency clusters.\n* `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy Passthrough on standard clusters.\n* `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have UC nor passthrough enabled.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DataSecurityMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DataSecurityMode", + "x-databricks-launch-stage": "GA" }, "dependency_mode": { "description": "[Beta] Controls dependency configuration for the cluster.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DependencyMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DependencyMode", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "docker_image": { "description": "Custom docker image BYOC", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DockerImage" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DockerImage", + "x-databricks-launch-stage": "GA" }, "driver_instance_pool_id": { "description": "The optional ID of the instance pool for the driver of the cluster belongs.\nThe pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not\nassigned.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "driver_node_type_flexibility": { "description": "Flexible node type configuration for the driver node.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility", + "x-databricks-launch-stage": "GA" }, "driver_node_type_id": { "description": "The node type of the Spark driver.\nNote that this field is optional; if unset, the driver node type will be set as the same value\nas `node_type_id` defined above.\n\nThis field, along with node_type_id, should not be set if virtual_cluster_size is set.\nIf both driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id and node_type_id take precedence.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enable_elastic_disk": { "description": "Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk\nspace when its Spark workers are running low on disk space.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "enable_local_disk_encryption": { "description": "Whether to enable LUKS on cluster VMs' local disks", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "gcp_attributes": { "description": "Attributes related to clusters running on Google Cloud Platform.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes", + "x-databricks-launch-stage": "GA" }, "init_scripts": { "description": "The configuration for storing init scripts. Any number of destinations can be specified.\nThe scripts are executed sequentially in the order provided.\nIf `cluster_log_conf` is specified, init script logs are sent to `\u003cdestination\u003e/\u003ccluster-ID\u003e/init_scripts`.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo", + "x-databricks-launch-stage": "GA" }, "instance_pool_id": { "description": "The optional ID of the instance pool to which the cluster belongs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "is_single_node": { "description": "This field can only be used when `kind = CLASSIC_PREVIEW`.\n\nWhen set to true, Databricks will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers`", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "kind": { "description": "The kind of compute described by this compute specification.\n\nDepending on `kind`, different validations and default values will be applied.\n\nClusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no specified `kind` do not.\n* [is_single_node](/api/workspace/clusters/create#is_single_node)\n* [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime)\n\nBy using the [simple form](https://docs.databricks.com/compute/simple-form.html), your clusters are automatically using `kind = CLASSIC_PREVIEW`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Kind" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Kind", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -494,11 +546,13 @@ }, "node_type_id": { "description": "This field encodes, through a single value, the resources available to each of\nthe Spark nodes in this cluster. For example, the Spark nodes can be provisioned\nand optimized for memory or compute intensive workloads. A list of available node\ntypes can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "num_workers": { "description": "Number of worker nodes that this cluster should have. A cluster has one Spark Driver\nand `num_workers` Executors for a total of `num_workers` + 1 Spark nodes.\n\nNote: When reading the properties of a cluster, this field reflects the desired number\nof workers rather than the actual current number of workers. For instance, if a cluster\nis resized from 5 to 10 workers, this field will immediately be updated to reflect\nthe target size of 10 workers, whereas the workers listed in `spark_info` will gradually\nincrease from 5 to 10 as the new nodes are provisioned.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -507,51 +561,63 @@ }, "policy_id": { "description": "The ID of the cluster policy used to create the cluster if applicable.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "remote_disk_throughput": { "description": "If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "runtime_engine": { "description": "Determines the cluster's runtime engine, either standard or Photon.\n\nThis field is not compatible with legacy `spark_version` values that contain `-photon-`.\nRemove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`.\n\nIf left unspecified, the runtime engine defaults to standard unless the spark_version\ncontains -photon-, in which case Photon will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.RuntimeEngine" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.RuntimeEngine", + "x-databricks-launch-stage": "GA" }, "single_user_name": { "description": "Single user name if data_security_mode is `SINGLE_USER`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "spark_conf": { "description": "An object containing a set of optional, user-specified Spark configuration key-value pairs.\nUsers can also pass in a string of extra JVM options to the driver and the executors via\n`spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "spark_env_vars": { "description": "An object containing a set of optional, user-specified environment variable key-value pairs.\nPlease note that key-value pair of the form (X,Y) will be exported as is (i.e.,\n`export X='Y'`) while launching the driver and workers.\n\nIn order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending\nthem to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all\ndefault databricks managed environmental variables are included as well.\n\nExample Spark environment variables:\n`{\"SPARK_WORKER_MEMORY\": \"28000m\", \"SPARK_LOCAL_DIRS\": \"/local_disk0\"}` or\n`{\"SPARK_DAEMON_JAVA_OPTS\": \"$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true\"}`", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "spark_version": { "description": "The Spark version of the cluster, e.g. `3.3.x-scala2.11`.\nA list of available Spark versions can be retrieved by using\nthe [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "ssh_public_keys": { "description": "SSH public key contents that will be added to each Spark node in this cluster. The\ncorresponding private keys can be used to login with the user name `ubuntu` on port `2200`.\nUp to 10 keys can be specified.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "total_initial_remote_disk_size": { "description": "If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "use_ml_runtime": { "description": "This field can only be used when `kind = CLASSIC_PREVIEW`.\n\n`effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "worker_node_type_flexibility": { "description": "Flexible node type configuration for worker nodes.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility", + "x-databricks-launch-stage": "GA" }, "workload_type": { "description": "Cluster Attributes showing for clusters workload types.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.WorkloadType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.WorkloadType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -603,26 +669,31 @@ "properties": { "definition": { "description": "Policy definition document expressed in [Databricks Cluster Policy Definition Language](https://docs.databricks.com/administration-guide/clusters/policy-definition.html).", - "$ref": "#/$defs/interface" + "$ref": "#/$defs/interface", + "x-databricks-launch-stage": "GA" }, "description": { "description": "Additional human-readable description of the cluster policy.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "libraries": { "description": "A list of libraries to be installed on the next cluster restart that uses this policy. The maximum number of libraries is 500.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.Library" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.Library", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.Lifecycle" }, "max_clusters_per_user": { "description": "Max number of clusters per user that can be active using this policy. If not present, there is no max limit.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Cluster Policy name requested by the user. This has to be unique. Length must be between 1 and 100\ncharacters.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -631,11 +702,13 @@ }, "policy_family_definition_overrides": { "description": "Policy definition JSON document expressed in [Databricks Policy Definition Language](https://docs.databricks.com/administration-guide/clusters/policy-definition.html).\nThe JSON document must be passed as a string and cannot be embedded in the requests.\n\nYou can use this to customize the policy definition inherited from the policy family.\nPolicy rules specified here are merged into the inherited policy definition.", - "$ref": "#/$defs/interface" + "$ref": "#/$defs/interface", + "x-databricks-launch-stage": "GA" }, "policy_family_id": { "description": "ID of the policy family. The cluster policy's policy definition inherits the policy\nfamily's policy definition.\n\nCannot be used with `definition`. Use `policy_family_definition_overrides` instead to\ncustomize the policy definition.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -764,15 +837,18 @@ "properties": { "create_database_if_not_exists": { "description": "[Public Preview]", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "database_instance_name": { "description": "[Public Preview] The name of the DatabaseInstance housing the database.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "database_name": { "description": "[Public Preview] The name of the database (in an instance) associated with the catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -780,7 +856,8 @@ }, "name": { "description": "[Public Preview] The name of the catalog in UC.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -804,19 +881,23 @@ "properties": { "capacity": { "description": "[Public Preview] The sku of the instance. Valid values are \"CU_1\", \"CU_2\", \"CU_4\", \"CU_8\".", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "custom_tags": { "description": "[Beta] Custom tags associated with the instance. This field is only included on create and update responses.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/database.CustomTag" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/database.CustomTag", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "enable_pg_native_login": { "description": "[Public Preview] Whether to enable PG native password login on the instance. Defaults to false.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "enable_readable_secondaries": { "description": "[Public Preview] Whether to enable secondaries to serve read-only traffic. Defaults to false.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -824,15 +905,18 @@ }, "name": { "description": "[Public Preview] The name of the instance. This is the unique identifier for the instance.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "node_count": { "description": "[Public Preview] The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to\n1 primary and 0 secondaries. This field is input only, see effective_node_count for the output.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "parent_instance_ref": { "description": "[Public Preview] The ref of the parent instance. This is only available if the instance is\nchild instance.\nInput: For specifying the parent instance to create a child instance. Optional.\nOutput: Only populated if provided as input to create a child instance.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.DatabaseInstanceRef" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.DatabaseInstanceRef", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -841,15 +925,18 @@ }, "retention_window_in_days": { "description": "[Public Preview] The retention window for the instance. This is the time window in days\nfor which the historical data is retained. The default value is 7 days.\nValid values are 2 to 35 days.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "stopped": { "description": "[Public Preview] Whether to stop the instance. An input only param, see effective_stopped for the output.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "usage_policy_id": { "description": "[Beta] The desired usage policy to associate with the instance.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -870,27 +957,33 @@ "properties": { "comment": { "description": "User-provided free-form text description.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "credential_name": { "description": "Name of the storage credential used with this location.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enable_file_events": { "description": "Whether to enable file events on this external location. Default to `true`. Set to `false` to disable file events.\nThe actual applied value may differ due to server-side defaults; check `effective_enable_file_events` for the effective state.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "encryption_details": { "description": "Encryption options that apply to clients connecting to cloud storage.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.EncryptionDetails" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.EncryptionDetails", + "x-databricks-launch-stage": "GA" }, "fallback": { "description": "Indicates whether fallback mode is enabled for this external location. When fallback mode is enabled, the access to the location falls back to cluster credentials if UC credentials are not sufficient.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "file_event_queue": { "description": "File event queue settings. If `enable_file_events` is not `false`, must be defined and have exactly one of the documented properties.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.FileEventQueue" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.FileEventQueue", + "x-databricks-launch-stage": "GA" }, "grants": { "description": "The Unity Catalog privileges to grant to principals on this securable.", @@ -903,19 +996,23 @@ }, "name": { "description": "Name of the external location.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "read_only": { "description": "Indicates whether the external location is read-only.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "skip_validation": { "description": "Skips validation of the storage credential associated with the external location.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "url": { "description": "Path URL of the external location.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -988,35 +1085,43 @@ "properties": { "aws_attributes": { "description": "Attributes related to instance pools running on Amazon Web Services.\nIf not specified at pool creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAwsAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAwsAttributes", + "x-databricks-launch-stage": "GA" }, "azure_attributes": { "description": "Attributes related to instance pools running on Azure.\nIf not specified at pool creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAzureAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAzureAttributes", + "x-databricks-launch-stage": "GA" }, "custom_tags": { "description": "Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS\ninstances and EBS volumes) with these tags in addition to `default_tags`. Notes:\n\n- Currently, Databricks allows at most 45 custom tags", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "disk_spec": { "description": "Defines the specification of the disks that will be attached to all spark containers.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskSpec", + "x-databricks-launch-stage": "GA" }, "enable_elastic_disk": { "description": "Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire\nadditional disk space when its Spark workers are running low on disk space. In AWS, this\nfeature requires specific AWS permissions to function correctly - refer to the User Guide for\nmore details.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "gcp_attributes": { "description": "Attributes related to instance pools running on Google Cloud Platform.\nIf not specified at pool creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolGcpAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolGcpAttributes", + "x-databricks-launch-stage": "GA" }, "idle_instance_autotermination_minutes": { "description": "Automatically terminates the extra instances in the pool cache after they are inactive for this\ntime in minutes if min_idle_instances requirement is already met. If not set, the extra pool\ninstances will be automatically terminated after a default timeout. If specified, the\nthreshold must be between 0 and 10000 minutes.\nUsers can also set this value to 0 to instantly remove idle instances from the cache if\nmin cache size could still hold.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "instance_pool_name": { "description": "Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100\ncharacters.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1024,19 +1129,23 @@ }, "max_capacity": { "description": "Maximum number of outstanding instances to keep in the pool, including both instances used by\nclusters and idle instances. Clusters that require further instance provisioning will fail during\nupsize requests.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_idle_instances": { "description": "Minimum number of idle instances to keep in the instance pool", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "node_type_flexibility": { "description": "Flexible node type configuration for the pool.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility", + "x-databricks-launch-stage": "GA" }, "node_type_id": { "description": "This field encodes, through a single value, the resources available to each of\nthe Spark nodes in this cluster. For example, the Spark nodes can be provisioned\nand optimized for memory or compute intensive workloads. A list of available node\ntypes can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -1045,19 +1154,23 @@ }, "preloaded_docker_images": { "description": "Custom Docker Image BYOC", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.DockerImage" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.DockerImage", + "x-databricks-launch-stage": "GA" }, "preloaded_spark_versions": { "description": "A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started\nwith the preloaded Spark version will start faster. A list of available Spark versions\ncan be retrieved by using the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "remote_disk_throughput": { "description": "If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "total_initial_remote_disk_size": { "description": "If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -1113,35 +1226,43 @@ "properties": { "budget_policy_id": { "description": "[Public Preview] The id of the user specified budget policy to use for this job.\nIf not specified, a default budget policy may be applied when creating or modifying the job.\nSee `effective_budget_policy_id` for the budget policy used by this workload.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "continuous": { "description": "An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Continuous" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Continuous", + "x-databricks-launch-stage": "GA" }, "description": { "description": "An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "email_notifications": { "description": "An optional set of email addresses that is notified when runs of this job begin or complete as well as when this job is deleted.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobEmailNotifications" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobEmailNotifications", + "x-databricks-launch-stage": "GA" }, "environments": { "description": "A list of task execution environment specifications that can be referenced by serverless tasks of this job.\nFor serverless notebook tasks, if the environment_key is not specified, the notebook environment will be used if present. If a jobs environment is specified, it will override the notebook environment.\nFor other serverless tasks, the task environment is required to be specified using environment_key in the task settings.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobEnvironment" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobEnvironment", + "x-databricks-launch-stage": "GA" }, "git_source": { "description": "An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.\n\nIf `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task.\n\nNote: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.GitSource" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.GitSource", + "x-databricks-launch-stage": "GA" }, "health": { "description": "An optional set of health rules that can be defined for this job.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRules" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRules", + "x-databricks-launch-stage": "GA" }, "job_clusters": { "description": "A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobCluster" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobCluster", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1149,19 +1270,23 @@ }, "max_concurrent_runs": { "description": "An optional maximum allowed number of concurrent runs of the job.\nSet this value if you want to be able to execute multiple runs of the same job concurrently.\nThis is useful for example if you trigger your job on a frequent schedule and want to allow consecutive runs to overlap with each other, or if you want to trigger multiple runs which differ by their input parameters.\nThis setting affects only new runs. For example, suppose the job’s concurrency is 4 and there are 4 concurrent active runs. Then setting the concurrency to 3 won’t kill any of the active runs.\nHowever, from then on, new runs are skipped unless there are fewer than 3 active runs.\nThis value cannot exceed 1000. Setting this value to `0` causes all new runs to be skipped.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "name": { "description": "An optional name for the job. The maximum length is 4096 bytes in UTF-8 encoding.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "notification_settings": { "description": "Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this job.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobNotificationSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobNotificationSettings", + "x-databricks-launch-stage": "GA" }, "parameters": { "description": "Job-level parameter definitions", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobParameterDefinition" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobParameterDefinition", + "x-databricks-launch-stage": "GA" }, "parent_path": { "description": "[Private Preview] Path of the job parent folder in workspace file tree. If absent, the job doesn't have a workspace object.", @@ -1171,7 +1296,8 @@ }, "performance_target": { "description": "The performance mode on a serverless job. This field determines the level of compute performance or cost-efficiency for the run.\nThe performance target does not apply to tasks that run on Serverless GPU compute.\n\n* `STANDARD`: Enables cost-efficient execution of serverless workloads.\n* `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PerformanceTarget" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PerformanceTarget", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -1180,35 +1306,43 @@ }, "queue": { "description": "The queue settings of the job.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.QueueSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.QueueSettings", + "x-databricks-launch-stage": "GA" }, "run_as": { "description": "The user or service principal that the job runs as, if specified in the request.\nThis field indicates the explicit configuration of `run_as` for the job.\nTo find the value in all cases, explicit or implicit, use `run_as_user_name`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobRunAs" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobRunAs", + "x-databricks-launch-stage": "GA" }, "schedule": { "description": "An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.CronSchedule" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.CronSchedule", + "x-databricks-launch-stage": "GA" }, "tags": { "description": "A map of tags associated with the job. These are forwarded to the cluster as cluster tags for jobs clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "tasks": { "description": "A list of task specifications to be executed by this job.\nIt supports up to 1000 elements in write endpoints (:method:jobs/create, :method:jobs/reset, :method:jobs/update, :method:jobs/submit).\nRead endpoints return only 100 tasks. If more than 100 tasks are available, you can paginate through them using :method:jobs/get. Use the `next_page_token` field at the object root to determine if more results are available.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Task" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Task", + "x-databricks-launch-stage": "GA" }, "timeout_seconds": { "description": "An optional timeout applied to each run of this job. A value of `0` means no timeout.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "trigger": { "description": "A configuration to trigger a run when certain conditions are met. The default behavior is that the job runs only when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TriggerSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TriggerSettings", + "x-databricks-launch-stage": "GA" }, "triggers": { "description": "[Beta] List of triggers attached to this job. A run starts when any active trigger evaluates to true. Cannot be set in\nthe same request as the legacy `schedule`, `trigger`, or `continuous` fields. Gated behind the \"Multiple Triggers\" feature preview.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.TriggerConfiguration" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.TriggerConfiguration", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "usage_policy_id": { "description": "[Private Preview] The id of the user specified usage policy to use for this job.\nIf not specified, a default usage policy may be applied when creating or modifying the job.\nSee `effective_usage_policy_id` for the usage policy used by this workload.", @@ -1218,7 +1352,8 @@ }, "webhook_notifications": { "description": "A collection of system notification IDs to notify when runs of this job begin or complete.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.WebhookNotifications" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.WebhookNotifications", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -1286,11 +1421,13 @@ }, "job_id": { "description": "The ID of the job to be executed", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "job_parameters": { "description": "Job-level parameters used in the run. for example `\"param\": \"overriding_val\"`", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed and when the run re-fires.", @@ -1306,15 +1443,18 @@ }, "only": { "description": "A list of task keys to run inside of the job. If this field is not provided, all tasks in the job will be run.\n\nPrefix a task key with `+` to also run its upstream tasks, or suffix it with `+` to also run its downstream tasks.\nFor example, `+my_task` runs `my_task` and everything upstream of it, `my_task+` runs `my_task` and everything\ndownstream of it, and `+my_task+` runs both. A task key with no `+` runs only that task.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "performance_target": { "description": "The performance mode on a serverless job. The performance target determines the level of compute performance or cost-efficiency for the run. This field overrides the performance target defined on the job level.\n\n* `STANDARD`: Enables cost-efficient execution of serverless workloads.\n* `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PerformanceTarget" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PerformanceTarget", + "x-databricks-launch-stage": "GA" }, "pipeline_params": { "description": "Controls whether the pipeline should perform a full refresh", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineParams" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineParams", + "x-databricks-launch-stage": "GA" }, "python_named_params": { "description": "[Private Preview]", @@ -1334,7 +1474,8 @@ }, "queue": { "description": "The queue settings of the run.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.QueueSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.QueueSettings", + "x-databricks-launch-stage": "GA" }, "spark_submit_params": { "description": "[Private Preview] A list of parameters for jobs with spark submit task, for example `\"spark_submit_params\": [\"--class\", \"org.apache.spark.examples.SparkPi\"]`.\nThe parameters are passed to spark-submit script as command-line parameters. If specified upon `run-now`, it would overwrite the\nparameters specified in job setting. The JSON representation of this field (for example `{\"python_params\":[\"john doe\",\"35\"]}`)\ncannot exceed 10,000 bytes.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.\n\nImportant\n\nThese parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error.\nExamples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis.", @@ -1451,7 +1592,8 @@ "properties": { "artifact_location": { "description": "Location where all artifacts for the experiment are stored.\nIf not provided, the remote server will select an appropriate default.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1459,7 +1601,8 @@ }, "name": { "description": "Experiment name.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -1468,7 +1611,8 @@ }, "tags": { "description": "A collection of tags to set on the experiment. Maximum tag size and number of tags per request\ndepends on the storage backend. All storage backends are guaranteed to support tag keys up\nto 250 bytes in size and tag values up to 5000 bytes in size. All storage backends are also\nguaranteed to support up to 20 tags per request.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/ml.ExperimentTag" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/ml.ExperimentTag", + "x-databricks-launch-stage": "GA" }, "trace_location": { "description": "[Private Preview] The location where the experiment's traces are stored. When set, the\nunderlying storage is provisioned and the experiment's traces are routed\nto it. When unset, traces are stored in the default MLflow backend. This\nfield cannot be updated after the experiment is created.", @@ -1529,7 +1673,8 @@ "properties": { "description": { "description": "Optional description for registered model.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1537,7 +1682,8 @@ }, "name": { "description": "Register models under this name", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -1546,7 +1692,8 @@ }, "tags": { "description": "Additional metadata for registered model.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/ml.ModelTag" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/ml.ModelTag", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -1601,22 +1748,27 @@ "properties": { "ai_gateway": { "description": "The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayConfig", + "x-databricks-launch-stage": "GA" }, "budget_policy_id": { "description": "The budget policy to be applied to the serving endpoint.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "config": { "description": "The core config of the serving endpoint.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.EndpointCoreConfigInput" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.EndpointCoreConfigInput", + "x-databricks-launch-stage": "GA" }, "description": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "email_notifications": { "description": "Email notification settings.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.EmailNotifications" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.EmailNotifications", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1624,7 +1776,8 @@ }, "name": { "description": "The name of the serving endpoint. This field is required and must be unique across a Databricks workspace.\nAn endpoint name can consist of alphanumeric characters, dashes, and underscores.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -1634,20 +1787,24 @@ "rate_limits": { "description": "Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits.", "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.RateLimit", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "route_optimized": { "description": "Enable route optimization for the serving endpoint.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "tags": { "description": "Tags to be attached to the serving endpoint and automatically propagated to billing logs.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.EndpointTag" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.EndpointTag", + "x-databricks-launch-stage": "GA" }, "telemetry_config": { "description": "[Public Preview] Configuration for persisting endpoint telemetry (logs, traces, and metrics) to Unity Catalog tables.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.TelemetryConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.TelemetryConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -1735,11 +1892,13 @@ "properties": { "allow_duplicate_names": { "description": "If false, deployment will fail if name conflicts with that of another pipeline.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "budget_policy_id": { "description": "[Public Preview] Budget policy of this pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "cascade_on_destroy": { "description": "Whether destroying the pipeline also deletes its datasets (MVs, STs, Views). Defaults to true (the server default). Set to false to retain the datasets when the pipeline is deleted. Only affects the delete operation.", @@ -1747,43 +1906,53 @@ }, "catalog": { "description": "A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "channel": { "description": "SDP Release Channel that specifies which version to use.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "clusters": { "description": "Cluster settings for this pipeline deployment.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineCluster" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineCluster", + "x-databricks-launch-stage": "GA" }, "configuration": { "description": "String-String configuration for this pipeline execution.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "continuous": { "description": "Whether the pipeline is continuous or triggered. This replaces `trigger`.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "development": { "description": "Whether the pipeline is in Development mode. Defaults to false.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "edition": { "description": "Pipeline product edition.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "environment": { "description": "[Public Preview] Environment specification for this pipeline used to install dependencies.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelinesEnvironment" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelinesEnvironment", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "event_log": { "description": "Event log configuration for this pipeline", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.EventLogSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.EventLogSpec", + "x-databricks-launch-stage": "GA" }, "filters": { "description": "Filters on which Pipeline packages to include in the deployed graph.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Filters" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Filters", + "x-databricks-launch-stage": "GA" }, "gateway_definition": { "description": "[Private Preview] The definition of a gateway pipeline to support change data capture.", @@ -1793,15 +1962,18 @@ }, "id": { "description": "Unique identifier for this pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "ingestion_definition": { "description": "[Public Preview] The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinition" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinition", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "libraries": { "description": "Libraries or code needed by this deployment.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineLibrary" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineLibrary", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1809,15 +1981,18 @@ }, "name": { "description": "Friendly identifier for this pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "notifications": { "description": "List of notification settings for this pipeline.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.Notifications" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.Notifications", + "x-databricks-launch-stage": "GA" }, "parameters": { "description": "[Beta] Key/value map of default parameters to use for pipeline execution.\nMaximum total size: 10k characters (JSON format)", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -1826,7 +2001,8 @@ }, "photon": { "description": "Whether Photon is enabled for this pipeline.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "restart_window": { "description": "[Private Preview] Restart window of this pipeline.", @@ -1836,19 +2012,23 @@ }, "root_path": { "description": "[Public Preview] Root path for this pipeline.\nThis is used as the root directory when editing the pipeline in the Databricks user interface and it is\nadded to sys.path when executing Python sources during pipeline execution.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "run_as": { "description": "Write-only setting, available only in Create/Update calls. Specifies the user or service principal that the pipeline runs as. If not specified, the pipeline runs as the user who created the pipeline.\n\nOnly `user_name` or `service_principal_name` can be specified. If both are specified, an error is thrown.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.RunAs" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.RunAs", + "x-databricks-launch-stage": "GA" }, "schema": { "description": "The default schema (database) where tables are read from or published to.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "serverless": { "description": "Whether serverless compute is enabled for this pipeline.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "serverless_compute_id": { "description": "[Private Preview] Serverless compute ID specified by the user for serverless pipelines.", @@ -1858,21 +2038,25 @@ }, "storage": { "description": "DBFS root directory for storing checkpoints and tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "tags": { "description": "A map of tags associated with the pipeline.\nThese are forwarded to the cluster as cluster tags, and are therefore subject to the same limitations.\nA maximum of 25 tags can be added to the pipeline.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "target": { "description": "Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field.", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "trigger": { "description": "Which pipeline trigger to use. Deprecated: Use `continuous` instead.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineTrigger", + "x-databricks-launch-stage": "GA", "deprecationMessage": "Use continuous instead", "deprecated": true }, @@ -1936,11 +2120,13 @@ }, "expire_time": { "description": "[Beta] Absolute expiration timestamp. When set, the branch will expire at this time.\nMutually exclusive with `ttl` and `no_expiry`. When updating, use `spec.expiration` in the update_mask.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "is_protected": { "description": "[Beta] When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -1948,7 +2134,8 @@ }, "no_expiry": { "description": "[Beta] Explicitly disable expiration. When set to true, the branch will not expire.\nIf set to false, the request is invalid; provide either ttl or expire_time instead.\nMutually exclusive with `expire_time` and `ttl`. When updating, use `spec.expiration` in the update_mask.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "parent": { "description": "The project containing this branch (API resource hierarchy). Format: projects/{project_id}\n\nThis field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see `source_branch`.", @@ -1964,19 +2151,23 @@ }, "source_branch": { "description": "[Beta] The name of the source branch from which this branch was created (data lineage for point-in-time recovery).\nIf not specified, defaults to the project's default branch.\nFormat: projects/{project_id}/branches/{branch_id}", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "source_branch_lsn": { "description": "[Beta] The Log Sequence Number (LSN) on the source branch from which this branch was created.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "source_branch_time": { "description": "[Beta] The point in time on the source branch from which this branch was created.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "ttl": { "description": "[Beta] Relative time-to-live duration. When set, the branch will expire at creation_time + ttl.\nMutually exclusive with `expire_time` and `no_expiry`. When updating, use `spec.expiration` in the update_mask.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -1999,7 +2190,8 @@ "properties": { "branch": { "description": "[Beta] The resource path of the branch associated with the catalog.\n\nFormat: projects/{project_id}/branches/{branch_id}.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "catalog_id": { "description": "The ID of the catalog in Unity Catalog; becomes the full resource name. For example, `my_catalog` becomes `catalogs/my_catalog`.", @@ -2007,7 +2199,8 @@ }, "create_database_if_missing": { "description": "[Beta] If set to true, the specified postgres_database is created on behalf of the calling user\nif it does not already exist. In this case, the calling user has a role created for\nthem in Postgres if they do not already have one.\n\nDefaults to false, meaning that the request fails if the specified postgres_database does not already exist.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2015,7 +2208,8 @@ }, "postgres_database": { "description": "[Beta] The name of the Postgres database inside the specified Lakebase project and branch to be associated with the UC catalog.\nThis database must already exist, unless create_database_if_missing is set to true on creation.\n\nA database can only be registered with one UC catalog at a time.\nTo re-register a database with a different catalog, the existing catalog must be deleted first.\n\nA child branch inherits the fact of parent's registration. This means the same-named database\nin a child branch cannot be registered with a second catalog\nwhile the parent's registration exists. To allow registering the database of a child branch,\ndrop and recreate the database on the child branch.\nThis removes the fact of parent's registration from this branch only.\n\nDoing Point In Time Restore (PITR) prior to the moment before the Postgres DB was registered\nin the Catalog drops the fact of registration of the database. So the user should avoid doing so.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -2049,7 +2243,8 @@ }, "postgres_database": { "description": "[Beta] The name of the Postgres database.\n\nThis expects a valid Postgres identifier as specified in the link below.\nhttps://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS\nRequired when creating the Database.\n\nTo rename, pass a valid postgres identifier when updating the Database.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "replace_existing": { "description": "When true, take over an existing database with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a database that already exists on the branch under bundle management. Only takes effect when the database is created.", @@ -2057,7 +2252,8 @@ }, "role": { "description": "[Beta] The name of the role that owns the database.\nFormat: projects/{project_id}/branches/{branch_id}/roles/{role_id}\n\nTo change the owner, pass valid existing Role name when updating the Database\n\nA database always has an owner.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -2080,15 +2276,18 @@ "properties": { "autoscaling_limit_max_cu": { "description": "[Beta] The maximum number of Compute Units. The maximum value is 64.\nThe difference between the minimum and maximum Compute Units (max - min) must not exceed 16.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "autoscaling_limit_min_cu": { "description": "[Beta] The minimum number of Compute Units. Minimum value is 0.5.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "disabled": { "description": "[Beta] Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "endpoint_id": { "description": "The ID to use for the endpoint; becomes the final component of the endpoint's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `primary` becomes `projects/my-app/branches/development/endpoints/primary`.", @@ -2096,11 +2295,13 @@ }, "endpoint_type": { "description": "[Beta] The endpoint type. A branch can only have one READ_WRITE endpoint.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointType", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "group": { "description": "[Beta] Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults\nto non HA settings, with a single compute backing the endpoint (and no readable secondaries\nfor Read/Write endpoints).", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointGroupSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointGroupSpec", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2108,7 +2309,8 @@ }, "no_suspension": { "description": "[Beta] When set to true, explicitly disables automatic suspension (never suspend).\nShould be set to true when provided.\nMutually exclusive with `suspend_timeout_duration`. When updating, use `spec.suspension` in the update_mask.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "parent": { "description": "The branch containing this endpoint (API resource hierarchy). Format: projects/{project_id}/branches/{branch_id}", @@ -2120,11 +2322,13 @@ }, "settings": { "description": "[Beta] A collection of settings for a compute endpoint.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointSettings", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "suspend_timeout_duration": { "description": "[Beta] Duration of inactivity after which the compute endpoint is automatically suspended.\nIf specified should be between 60s and 604800s (1 minute to 1 week).\nMutually exclusive with `no_suspension`. When updating, use `spec.suspension` in the update_mask.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -2147,31 +2351,38 @@ "properties": { "budget_policy_id": { "description": "[Beta] The desired budget policy to associate with the project.\nSee status.budget_policy_id for the policy that is actually applied to the project.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "custom_tags": { "description": "[Beta] Custom tags to associate with the project. Forwarded to LBM for billing and cost tracking.\nTo update tags, provide the new tag list and include \"spec.custom_tags\" in the update_mask.\nTo clear all tags, provide an empty list and include \"spec.custom_tags\" in the update_mask.\nTo preserve existing tags, omit this field from the update_mask (or use wildcard \"*\" which auto-excludes empty tags).", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.ProjectCustomTag" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.ProjectCustomTag", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "default_branch": { "description": "[Beta] The full resource path for the default branch of the project\nFormat: projects/{project_id}/branches/{branch_id}", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "default_endpoint_settings": { "description": "[Beta] A collection of settings for a compute endpoint.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.ProjectDefaultEndpointSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.ProjectDefaultEndpointSettings", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "display_name": { "description": "[Beta] Human-readable project name. Length should be between 1 and 256 characters.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "enable_pg_native_login": { "description": "[Beta] Whether to enable PG native password login on all endpoints in this project. Defaults to false.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "history_retention_duration": { "description": "[Beta] The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days).", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2184,7 +2395,8 @@ }, "pg_version": { "description": "[Beta] The major Postgres version number. The set of supported versions may vary; consult the API documentation for currently accepted values.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "project_id": { "description": "The ID to use for the project; becomes the final component of the project's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `my-app` becomes `projects/my-app`.", @@ -2213,15 +2425,18 @@ "properties": { "attributes": { "description": "[Beta] The desired API-exposed Postgres role attributes to associate with the role.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleAttributes", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "auth_method": { "description": "[Beta] How the role is authenticated when connecting to Postgres. If left unspecified, a meaningful authentication method is derived from the identity_type.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleAuthMethod" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleAuthMethod", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "identity_type": { "description": "[Beta] The type of the Databricks managed identity that this Role represents. Leave empty to create a regular Postgres role not associated with a Databricks identity.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleIdentityType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleIdentityType", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2229,7 +2444,8 @@ }, "membership_roles": { "description": "[Beta] Standard roles that this role is a member of.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.RoleMembershipRole" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.RoleMembershipRole", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "parent": { "description": "The branch where this role is created. Format projects/{project_id}/branches/{branch_id}.", @@ -2237,7 +2453,8 @@ }, "postgres_role": { "description": "[Beta] The name of the Postgres role. Required when creating the role.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "replace_existing": { "description": "When true, take over an existing role with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a role that already exists on the branch (for example, one inherited from the parent branch) under bundle management. Only takes effect when the role is created.", @@ -2273,15 +2490,18 @@ }, "branch": { "description": "[Beta] The full resource name the branch associated with the table.\n\nFormat: \"projects/{project_id}/branches/{branch_id}\".", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "create_database_objects_if_missing": { "description": "[Beta] If true, the synced table's logical database and schema resources in PG\nwill be created if they do not already exist.\nThe request will fail if this is false and the database/schema do not exist.\n\nDefaults to true if omitted.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "existing_pipeline_id": { "description": "[Beta] ID of an existing pipeline to bin-pack this synced table into.\nAt most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nThe pipeline used for the synced table is returned via the top level pipeline_id attribute.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "extra_columns": { "description": "[Private Preview] Extra PostgreSQL-only columns to add to the synced table.", @@ -2295,23 +2515,28 @@ }, "new_pipeline_spec": { "description": "[Beta] Specification for creating a new pipeline.\nAt most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nThe pipeline used for the synced table is returned via the top level pipeline_id attribute.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.NewPipelineSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.NewPipelineSpec", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "postgres_database": { "description": "[Beta] The Postgres database name where the synced table will be created in.\n\nIf this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred\nfrom the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match.\n\nA value must be specified when creating a synced table inside a Standard Catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "primary_key_columns": { "description": "[Beta] Primary Key columns to be used for data insert/update in the destination.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "scheduling_policy": { "description": "[Beta] Scheduling policy of the underlying pipeline.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "source_table_full_name": { "description": "[Beta] Three-part (catalog, schema, table) name of the source Delta table.\n\nFor the corresponding destination table, use any of the two:\n\n* synced_table_id used at the creation of the SyncedTable\n* \"name\" consisting of \"synced_tables/\" prefix and the full name of the destination table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "synced_table_id": { "description": "The ID to use for the synced table; becomes the final component of the synced table's resource name. It is the synced table name, a `{catalog}.{schema}.{table}` tuple of Unity Catalog entity names.\n\nIt names both an online view in Unity Catalog, accessible through Lakehouse Federation, and a Postgres table named `{table}` in schema `{schema}` in the connected Postgres database.", @@ -2319,11 +2544,13 @@ }, "timeseries_key": { "description": "[Beta] Time series key to deduplicate (tie-break) rows with the same primary key.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "type_overrides": { "description": "[Beta] Override the default Delta-\u003ePG type mapping for specific columns.\nA TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecTypeOverride" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecTypeOverride", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -2344,15 +2571,18 @@ "properties": { "assets_dir": { "description": "[Create:REQ Update:IGN] Field for specifying the absolute path to a custom directory to store data-monitoring\nassets. Normally prepopulated to a default user location via UI and Python APIs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "baseline_table_name": { "description": "[Create:OPT Update:OPT] Baseline table name.\nBaseline data is used to compute drift from the data in the monitored `table_name`.\nThe baseline table and the monitored table shall have the same schema.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "custom_metrics": { "description": "[Create:OPT Update:OPT] Custom metrics.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetric" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetric", + "x-databricks-launch-stage": "GA" }, "data_classification_config": { "description": "[Private Preview] [Create:OPT Update:OPT] Data classification related config.", @@ -2361,11 +2591,13 @@ "doNotSuggest": true }, "inference_log": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLog" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLog", + "x-databricks-launch-stage": "GA" }, "latest_monitor_failure_msg": { "description": "[Create:ERR Update:IGN] The latest error message for a monitor failure.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2373,38 +2605,46 @@ }, "notifications": { "description": "[Create:OPT Update:OPT] Field for specifying notification settings.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorNotifications" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorNotifications", + "x-databricks-launch-stage": "GA" }, "output_schema_name": { "description": "[Create:REQ Update:REQ] Schema where output tables are created. Needs to be in 2-level format {catalog}.{schema}", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schedule": { "description": "[Create:OPT Update:OPT] The monitor schedule.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedule" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedule", + "x-databricks-launch-stage": "GA" }, "skip_builtin_dashboard": { "description": "Whether to skip creating a default dashboard summarizing data quality metrics.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "slicing_exprs": { "description": "[Create:OPT Update:OPT] List of column expressions to slice data with for targeted analysis. The data is grouped by\neach expression independently, resulting in a separate slice for each predicate and its\ncomplements. For example `slicing_exprs=[“col_1”, “col_2 \u003e 10”]` will generate the following\nslices: two slices for `col_2 \u003e 10` (True and False), and one slice per unique value in\n`col1`. For high-cardinality columns, only the top 100 unique values by frequency will\ngenerate slices.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "snapshot": { "description": "Configuration for monitoring snapshot tables.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorSnapshot" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorSnapshot", + "x-databricks-launch-stage": "GA" }, "table_name": { "$ref": "#/$defs/string" }, "time_series": { "description": "Configuration for monitoring time series tables.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorTimeSeries" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorTimeSeries", + "x-databricks-launch-stage": "GA" }, "warehouse_id": { "description": "Optional argument to specify the warehouse for dashboard creation. If not specified, the first running\nwarehouse will be used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2428,27 +2668,33 @@ "properties": { "aliases": { "description": "List of aliases associated with the registered model", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/catalog.RegisteredModelAlias" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/catalog.RegisteredModelAlias", + "x-databricks-launch-stage": "GA" }, "catalog_name": { "description": "The name of the catalog where the schema and the registered model reside", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "comment": { "description": "The comment attached to the registered model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "created_at": { "description": "Creation timestamp of the registered model in milliseconds since the Unix epoch", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "created_by": { "description": "The identifier of the user who created the registered model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "full_name": { "description": "The three-level (fully qualified) name of the registered model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "grants": { "description": "The Unity Catalog privileges to grant to principals on this securable.", @@ -2461,31 +2707,38 @@ }, "metastore_id": { "description": "The unique identifier of the metastore", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { "description": "The name of the registered model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "owner": { "description": "The identifier of the user who owns the registered model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schema_name": { "description": "The name of the schema where the registered model resides", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "storage_location": { "description": "The storage location on the cloud under which model version data files are stored", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "updated_at": { "description": "Last-update timestamp of the registered model in milliseconds since the Unix epoch", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "updated_by": { "description": "The identifier of the user who updated the registered model last time", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2504,15 +2757,18 @@ "properties": { "catalog_name": { "description": "Name of parent catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "comment": { "description": "User-provided free-form text description.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "custom_max_retention_hours": { "description": "[Public Preview] Custom maximum retention period in hours for the schema.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "grants": { "description": "The Unity Catalog privileges to grant to principals on this securable.", @@ -2525,15 +2781,18 @@ }, "name": { "description": "Name of schema, relative to parent catalog.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "properties": { "description": "A map of key-value properties attached to the securable.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "storage_root": { "description": "Storage root URL for managed tables within schema.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2557,15 +2816,18 @@ "properties": { "catalog_name": { "description": "The name of the catalog where the schema and the secret reside.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "comment": { "description": "User-provided free-form text description of the secret.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "expire_time": { "description": "User-provided expiration time of the secret. Purely informational; does not trigger automatic actions.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time", + "x-databricks-launch-stage": "GA" }, "grants": { "description": "The grants to apply on this secret.", @@ -2577,19 +2839,23 @@ }, "name": { "description": "The name of the secret, relative to its parent schema.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "owner": { "description": "The owner of the secret. Defaults to the creating principal on creation. Can be updated to\ntransfer ownership of the secret to another principal.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schema_name": { "description": "The name of the schema where the secret resides.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "The secret value to store. Must be a variable reference (e.g. ${var.my_secret}) to prevent plain-text secrets in configuration files.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2700,31 +2966,38 @@ "properties": { "auto_stop_mins": { "description": "The amount of time in minutes that a SQL warehouse must be idle (i.e., no\nRUNNING queries) before it is automatically stopped.\n\nSupported values:\n- Must be == 0 or \u003e= 10 mins\n- 0 indicates no autostop.\n\nDefaults to 120 mins", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "channel": { "description": "Channel Details", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.Channel" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.Channel", + "x-databricks-launch-stage": "GA" }, "cluster_size": { "description": "Size of the clusters allocated for this warehouse.\nIncreasing the size of a spark cluster allows you to run larger queries on\nit. If you want to increase the number of concurrent queries, please tune\nmax_num_clusters.\n\nSupported values:\n- 2X-Small\n- X-Small\n- Small\n- Medium\n- Large\n- X-Large\n- 2X-Large\n- 3X-Large\n- 4X-Large\n- 5X-Large", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "creator_name": { "description": "warehouse creator name", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enable_photon": { "description": "Configures whether the warehouse should use Photon optimized clusters.\n\nDefaults to true.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "enable_serverless_compute": { "description": "Configures whether the warehouse should use serverless compute", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "instance_profile_arn": { "description": "Deprecated. Instance profile used to pass IAM role to the cluster", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, @@ -2734,15 +3007,18 @@ }, "max_num_clusters": { "description": "Maximum number of clusters that the autoscaler will create to handle\nconcurrent queries.\n\nSupported values:\n- Must be \u003e= min_num_clusters\n- Must be \u003c= 40.\n\nDefaults to min_clusters if unset.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_num_clusters": { "description": "Minimum number of available clusters that will be maintained for this SQL\nwarehouse. Increasing this will ensure that a larger number of clusters are\nalways running and therefore may reduce the cold start time for new\nqueries. This is similar to reserved vs. revocable cores in a resource\nmanager.\n\nSupported values:\n- Must be \u003e 0\n- Must be \u003c= min(max_num_clusters, 30)\n\nDefaults to 1", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Logical name for the cluster.\n\nSupported values:\n- Must be unique within an org.\n- Must be less than 100 characters.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -2751,15 +3027,18 @@ }, "spot_instance_policy": { "description": "Configurations whether the endpoint should use spot instances.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.SpotInstancePolicy" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.SpotInstancePolicy", + "x-databricks-launch-stage": "GA" }, "tags": { "description": "A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes) associated\nwith this SQL warehouse.\n\nSupported values:\n- Number of tags \u003c 45.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.EndpointTags" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.EndpointTags", + "x-databricks-launch-stage": "GA" }, "warehouse_type": { "description": "Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute,\nyou must set to `PRO` and also set the field `enable_serverless_compute` to `true`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.CreateWarehouseRequestWarehouseType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.CreateWarehouseRequestWarehouseType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -2810,7 +3089,8 @@ "properties": { "database_instance_name": { "description": "[Public Preview] Name of the target database instance. This is required when creating synced database tables in standard catalogs.\nThis is optional when creating synced database tables in registered catalogs. If this field is specified\nwhen creating synced database tables in registered catalogs, the database instance name MUST\nmatch that of the registered catalog (or the request will be rejected).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2818,15 +3098,18 @@ }, "logical_database_name": { "description": "[Public Preview] Target Postgres database object (logical database) name for this table.\n\nWhen creating a synced table in a registered Postgres catalog, the\ntarget Postgres database name is inferred to be that of the registered catalog.\nIf this field is specified in this scenario, the Postgres database name MUST\nmatch that of the registered catalog (or the request will be rejected).\n\nWhen creating a synced table in a standard catalog, this field is required.\nIn this scenario, specifying this field will allow targeting an arbitrary postgres database.\nNote that this has implications for the `create_database_objects_is_missing` field in `spec`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "name": { "description": "[Public Preview] Full three-part (catalog, schema, table) name of the table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "spec": { "description": "[Public Preview] Specification of a synced database table.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -2847,11 +3130,13 @@ "properties": { "budget_policy_id": { "description": "[Public Preview] The budget policy id to be applied", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "endpoint_type": { "description": "Type of endpoint", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.EndpointType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.EndpointType", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2859,7 +3144,8 @@ }, "name": { "description": "Name of the AI Search endpoint", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permissions": { "description": "The permissions to apply to this resource.", @@ -2868,7 +3154,8 @@ }, "target_qps": { "description": "Target QPS for the endpoint. Mutually exclusive with num_replicas.\nThe actual replica count is calculated at index creation/sync time based on this value.\nBest-effort target; the system does not guarantee this QPS will be achieved.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "usage_policy_id": { "description": "[Private Preview] The usage policy id to be applied once we've migrated to usage policies", @@ -2925,15 +3212,18 @@ "properties": { "delta_sync_index_spec": { "description": "Specification for Delta Sync Index. Required if `index_type` is `DELTA_SYNC`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.DeltaSyncVectorIndexSpecRequest" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.DeltaSyncVectorIndexSpecRequest", + "x-databricks-launch-stage": "GA" }, "direct_access_index_spec": { "description": "Specification for Direct Vector Access Index. Required if `index_type` is `DIRECT_ACCESS`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.DirectAccessVectorIndexSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.DirectAccessVectorIndexSpec", + "x-databricks-launch-stage": "GA" }, "endpoint_name": { "description": "Name of the endpoint to be used for serving the index", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "grants": { "description": "The Unity Catalog privileges to grant to principals on this securable.", @@ -2942,11 +3232,13 @@ }, "index_subtype": { "description": "[Beta] The subtype of the index. Use `HYBRID` or `FULL_TEXT`. `VECTOR` is not supported.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.IndexSubtype" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.IndexSubtype", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "index_type": { "description": "There are 2 types of AI Search indexes:\n- `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes.\n- `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.VectorIndexType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.VectorIndexType", + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2954,11 +3246,13 @@ }, "name": { "description": "Name of the index", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "primary_key": { "description": "Primary key of the index", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2982,11 +3276,13 @@ "properties": { "catalog_name": { "description": "The name of the catalog where the schema and the volume are", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "comment": { "description": "The comment attached to the volume", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "grants": { "description": "The Unity Catalog privileges to grant to principals on this securable.", @@ -2999,19 +3295,23 @@ }, "name": { "description": "The name of the volume", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schema_name": { "description": "The name of the schema where the volume is", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "storage_location": { "description": "The storage location on the cloud", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "volume_type": { "description": "The type of the volume. An external volume is located in the specified external location.\nA managed volume is located in the default location which is specified by the parent schema, or the parent catalog, or the Metastore.\n[Learn more](https://docs.databricks.com/aws/en/volumes/managed-vs-external)", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.VolumeType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.VolumeType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -3909,27 +4209,33 @@ "properties": { "command": { "description": "The command with which to run the app. This will override the command specified in the app.yaml file.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "deployment_id": { "description": "The unique id of the deployment.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "env_vars": { "description": "The environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/apps.EnvVar" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/apps.EnvVar", + "x-databricks-launch-stage": "GA" }, "git_source": { "description": "Git repository to use as the source for the app deployment.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.GitSource" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.GitSource", + "x-databricks-launch-stage": "GA" }, "mode": { "description": "The mode of which the deployment will manage the source code.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppDeploymentMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppDeploymentMode", + "x-databricks-launch-stage": "GA" }, "source_code_path": { "description": "The workspace file system path of the source code used to create the app deployment. This is different from\n`deployment_artifacts.source_code_path`, which is the path used by the deployed app. The former refers\nto the original source code location of the app in the workspace during deployment creation, whereas\nthe latter provides a system generated stable snapshotted source code path used by the deployment.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -3947,7 +4253,8 @@ "properties": { "source_code_path": { "description": "The snapshotted workspace file system path of the source code loaded by the deployed app.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4024,42 +4331,54 @@ "type": "object", "properties": { "app": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceApp" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceApp", + "x-databricks-launch-stage": "GA" }, "database": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceDatabase" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceDatabase", + "x-databricks-launch-stage": "GA" }, "description": { "description": "Description of the App Resource.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "experiment": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceExperiment" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceExperiment", + "x-databricks-launch-stage": "GA" }, "genie_space": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceGenieSpace" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceGenieSpace", + "x-databricks-launch-stage": "GA" }, "job": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceJob" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceJob", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Name of the App Resource.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "postgres": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourcePostgres" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourcePostgres", + "x-databricks-launch-stage": "GA" }, "secret": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSecret" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSecret", + "x-databricks-launch-stage": "GA" }, "serving_endpoint": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceServingEndpoint" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceServingEndpoint", + "x-databricks-launch-stage": "GA" }, "sql_warehouse": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSqlWarehouse" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSqlWarehouse", + "x-databricks-launch-stage": "GA" }, "uc_securable": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceUcSecurable" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceUcSecurable", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4079,10 +4398,12 @@ "type": "object", "properties": { "name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceAppAppPermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceAppAppPermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4113,13 +4434,16 @@ "type": "object", "properties": { "database_name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "instance_name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceDatabaseDatabasePermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceDatabaseDatabasePermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4155,10 +4479,12 @@ "type": "object", "properties": { "experiment_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceExperimentExperimentPermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceExperimentExperimentPermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4195,13 +4521,16 @@ "type": "object", "properties": { "name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceGenieSpaceGenieSpacePermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceGenieSpaceGenieSpacePermission", + "x-databricks-launch-stage": "GA" }, "space_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4241,11 +4570,13 @@ "properties": { "id": { "description": "Id of the job to grant permission on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { "description": "Permissions to grant on the Job. Supported permissions are: \"CAN_MANAGE\", \"IS_OWNER\", \"CAN_MANAGE_RUN\", \"CAN_VIEW\".", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceJobJobPermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceJobJobPermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4283,13 +4614,16 @@ "type": "object", "properties": { "branch": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "database": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourcePostgresPostgresPermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourcePostgresPostgresPermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4321,15 +4655,18 @@ "properties": { "key": { "description": "Key of the secret to grant permission on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { "description": "Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: \"READ\", \"WRITE\", \"MANAGE\".", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSecretSecretPermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSecretSecretPermission", + "x-databricks-launch-stage": "GA" }, "scope": { "description": "Scope of the secret to grant permission on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4369,11 +4706,13 @@ "properties": { "name": { "description": "Name of the serving endpoint to grant permission on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { "description": "Permission to grant on the serving endpoint. Supported permissions are: \"CAN_MANAGE\", \"CAN_QUERY\", \"CAN_VIEW\".", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceServingEndpointServingEndpointPermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceServingEndpointServingEndpointPermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4411,11 +4750,13 @@ "properties": { "id": { "description": "Id of the SQL warehouse to grant permission on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "permission": { "description": "Permission to grant on the SQL warehouse. Supported permissions are: \"CAN_MANAGE\", \"CAN_USE\", \"IS_OWNER\".", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSqlWarehouseSqlWarehousePermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceSqlWarehouseSqlWarehousePermission", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4452,13 +4793,16 @@ "type": "object", "properties": { "permission": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceUcSecurableUcSecurablePermission" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceUcSecurableUcSecurablePermission", + "x-databricks-launch-stage": "GA" }, "securable_full_name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "securable_type": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceUcSecurableUcSecurableType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.AppResourceUcSecurableUcSecurableType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4594,15 +4938,18 @@ "properties": { "name": { "description": "The name of the environment variable.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "The value for the environment variable.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value_from": { "description": "The name of an external Databricks resource that contains the value, such as a secret or a database table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4621,19 +4968,23 @@ "properties": { "auto_deploy": { "description": "[Beta] When true, automatically deploys the app on push events to the branch configured in\nthe app's deployment_source.git_source.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "caller_credential_id": { "description": "[Beta] ID of a personal access token Git credential owned by the caller, used to\ngrant the app's service principal access to this repository.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "provider": { "description": "Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud,\nbitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "url": { "description": "URL of the Git repository.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4656,19 +5007,23 @@ "properties": { "branch": { "description": "Git branch to checkout.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "commit": { "description": "Git commit SHA to checkout.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "source_code_path": { "description": "Relative path to the app source code within the Git repository. If not specified, the root\nof the repository is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "tag": { "description": "Git tag to checkout.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4687,7 +5042,8 @@ "properties": { "unity_catalog": { "description": "[Public Preview] Unity Catalog Destinations for OTEL telemetry export.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.UnityCatalog" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/apps.UnityCatalog", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -4706,15 +5062,18 @@ "properties": { "logs_table": { "description": "[Public Preview] Unity Catalog table for OTEL logs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "metrics_table": { "description": "[Public Preview] Unity Catalog table for OTEL metrics.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "traces_table": { "description": "[Public Preview] Unity Catalog table for OTEL traces (spans).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -4737,7 +5096,8 @@ "properties": { "queue_url": { "description": "The AQS queue url in the format https://sqs.{region}.amazonaws.com/{account id}/{queue name}.\nOnly required for provided_sqs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4754,13 +5114,16 @@ "type": "object", "properties": { "azure_cmk_access_connector_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "azure_cmk_managed_identity_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "azure_tenant_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4781,15 +5144,18 @@ "properties": { "queue_url": { "description": "The AQS queue url in the format https://{storage account}.queue.core.windows.net/{queue name}\nOnly required for provided_aqs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "resource_group": { "description": "Optional resource group for the queue, event grid subscription, and external location storage\naccount.\nOnly required for locations with a service principal storage credential", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "subscription_id": { "description": "Optional subscription id for the queue, event grid subscription, and external location storage\naccount.\nRequired for locations with a service principal storage credential", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4808,7 +5174,8 @@ "properties": { "sse_encryption_details": { "description": "Server-Side Encryption properties for clients communicating with AWS s3.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.SseEncryptionDetails" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.SseEncryptionDetails", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4827,15 +5194,18 @@ "properties": { "azure_encryption_settings": { "description": "optional Azure settings - only required if an Azure CMK is used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AzureEncryptionSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AzureEncryptionSettings", + "x-databricks-launch-stage": "GA" }, "azure_key_vault_key_id": { "description": "the AKV URL in Azure, null otherwise.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "customer_managed_key_id": { "description": "the CMK uuid in AWS and GCP, null otherwise.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4852,22 +5222,28 @@ "type": "object", "properties": { "managed_aqs": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AzureQueueStorage" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AzureQueueStorage", + "x-databricks-launch-stage": "GA" }, "managed_pubsub": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.GcpPubsub" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.GcpPubsub", + "x-databricks-launch-stage": "GA" }, "managed_sqs": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AwsSqsQueue" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AwsSqsQueue", + "x-databricks-launch-stage": "GA" }, "provided_aqs": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AzureQueueStorage" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AzureQueueStorage", + "x-databricks-launch-stage": "GA" }, "provided_pubsub": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.GcpPubsub" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.GcpPubsub", + "x-databricks-launch-stage": "GA" }, "provided_sqs": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AwsSqsQueue" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.AwsSqsQueue", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4885,7 +5261,8 @@ "properties": { "subscription_name": { "description": "The Pub/Sub subscription name in the format projects/{project}/subscriptions/{subscription name}.\nOnly required for provided_pubsub.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4903,15 +5280,18 @@ "properties": { "pause_status": { "description": "Read only field that indicates whether a schedule is paused or not.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedulePauseStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedulePauseStatus", + "x-databricks-launch-stage": "GA" }, "quartz_cron_expression": { "description": "The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "timezone_id": { "description": "The timezone id (e.g., ``PST``) in which to evaluate the quartz expression.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -4971,7 +5351,8 @@ "properties": { "email_addresses": { "description": "The list of email addresses to send the notification to. A maximum of 5 email addresses is supported.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -4989,31 +5370,38 @@ "properties": { "granularities": { "description": "Granularities for aggregating data into time windows based on their timestamp. Valid values are 5 minutes, 30 minutes, 1 hour, 1 day, n weeks, 1 month, or 1 year.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "label_col": { "description": "Column for the label.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "model_id_col": { "description": "Column for the model identifier.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "prediction_col": { "description": "Column for the prediction.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "prediction_proba_col": { "description": "Column for prediction probabilities", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "problem_type": { "description": "Problem type the model aims to solve.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLogProblemType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLogProblemType", + "x-databricks-launch-stage": "GA" }, "timestamp_col": { "description": "Column for the timestamp.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -5054,23 +5442,28 @@ "properties": { "definition": { "description": "Jinja template for a SQL expression that specifies how to compute the metric. See [create metric definition](https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "input_columns": { "description": "A list of column names in the input table the metric should be computed for.\nCan use ``\":table\"`` to indicate that the metric needs information from multiple columns.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Name of the metric in the output tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "output_data_type": { "description": "The output type of the custom metric.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "type": { "description": "Can only be one of ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"``, ``\"CUSTOM_METRIC_TYPE_DERIVED\"``, or ``\"CUSTOM_METRIC_TYPE_DRIFT\"``.\nThe ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"`` and ``\"CUSTOM_METRIC_TYPE_DERIVED\"`` metrics\nare computed on a single table, whereas the ``\"CUSTOM_METRIC_TYPE_DRIFT\"`` compare metrics across\nbaseline and input table, or across the two consecutive time windows.\n- CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table\n- CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics\n- CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetricType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetricType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -5112,7 +5505,8 @@ "properties": { "on_failure": { "description": "Destinations to send notifications on failure/timeout.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorDestination" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.MonitorDestination", + "x-databricks-launch-stage": "GA" }, "on_new_classification_tag_detected": { "description": "[Private Preview] Destinations to send notifications on new classification tag detected.", @@ -5150,11 +5544,13 @@ "properties": { "granularities": { "description": "Granularities for aggregating data into time windows based on their timestamp. Valid values are 5 minutes, 30 minutes, 1 hour, 1 day, n weeks, 1 month, or 1 year.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "timestamp_col": { "description": "Column for the timestamp.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -5240,11 +5636,13 @@ "properties": { "principal": { "description": "The principal (user email address or group name).\nFor deleted principals, `principal` is empty while `principal_id` is populated.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "privileges": { "description": "The privileges assigned to the principal.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/catalog.Privilege" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/catalog.Privilege", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5262,27 +5660,33 @@ "properties": { "alias_name": { "description": "Name of the alias, e.g. 'champion' or 'latest_stable'", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "catalog_name": { "description": "The name of the catalog containing the model version", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "id": { "description": "The unique identifier of the alias", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "model_name": { "description": "The name of the parent registered model of the model version, relative to parent schema", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schema_name": { "description": "The name of the schema containing the model version, relative to parent catalog", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "version_num": { "description": "Integer version number of the model version to which this alias points.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5301,11 +5705,13 @@ "properties": { "algorithm": { "description": "Sets the value of the 'x-amz-server-side-encryption' header in S3 request.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.SseEncryptionDetailsAlgorithm" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/catalog.SseEncryptionDetailsAlgorithm", + "x-databricks-launch-stage": "GA" }, "aws_kms_key_arn": { "description": "Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = \"SSE-KMS\".\nSets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5355,7 +5761,8 @@ "properties": { "destination": { "description": "abfss destination, e.g. `abfss://\u003ccontainer-name\u003e@\u003cstorage-account-name\u003e.dfs.core.windows.net/\u003cdirectory-name\u003e`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -5376,11 +5783,13 @@ "properties": { "max_workers": { "description": "The maximum number of workers to which the cluster can scale up when overloaded.\nNote that `max_workers` must be strictly greater than `min_workers`.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_workers": { "description": "The minimum number of workers to which the cluster can scale down when underutilized.\nIt is also the initial number of workers the cluster will have after creation.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5399,43 +5808,53 @@ "properties": { "availability": { "description": "Availability type used for all subsequent nodes past the `first_on_demand` ones.\n\nNote: If `first_on_demand` is zero, this availability type will be used for the entire cluster.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAvailability" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAvailability", + "x-databricks-launch-stage": "GA" }, "ebs_volume_count": { "description": "The number of volumes launched for each instance. Users can choose up to 10 volumes.\nThis feature is only enabled for supported node types. Legacy node types cannot specify\ncustom EBS volumes.\nFor node types with no instance store, at least one EBS volume needs to be specified;\notherwise, cluster creation will fail.\n\nThese EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc.\nInstance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc.\n\nIf EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for\nscratch storage because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no EBS volumes are attached, Databricks will configure Spark to use instance\nstore volumes.\n\nPlease note that if EBS volumes are specified, then the Spark configuration `spark.local.dir`\nwill be overridden.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "ebs_volume_iops": { "description": "If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "ebs_volume_size": { "description": "The size of each EBS volume (in GiB) launched for each instance. For general purpose\nSSD, this value must be within the range 100 - 4096. For throughput optimized HDD,\nthis value must be within the range 500 - 4096.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "ebs_volume_throughput": { "description": "If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "ebs_volume_type": { "description": "The type of EBS volumes that will be launched with this cluster.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.EbsVolumeType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.EbsVolumeType", + "x-databricks-launch-stage": "GA" }, "first_on_demand": { "description": "The first `first_on_demand` nodes of the cluster will be placed on on-demand instances.\nIf this value is greater than 0, the cluster driver node in particular will be placed on an\non-demand instance. If this value is greater than or equal to the current cluster size, all\nnodes will be placed on on-demand instances. If this value is less than the current cluster\nsize, `first_on_demand` nodes will be placed on on-demand instances and the remainder will\nbe placed on `availability` instances. Note that this value does not affect\ncluster size and cannot currently be mutated over the lifetime of a cluster.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "instance_profile_arn": { "description": "Nodes for this cluster will only be placed on AWS instances with this instance profile. If\nommitted, nodes will be placed on instances without an IAM instance profile. The instance\nprofile must have previously been added to the Databricks environment by an account\nadministrator.\n\nThis feature may only be available to certain customer plans.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "spot_bid_price_percent": { "description": "The bid price for AWS spot instances, as a percentage of the corresponding instance type's\non-demand price.\nFor example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot\ninstance, then the bid price is half of the price of\non-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice\nthe price of on-demand `r3.xlarge` instances. If not specified, the default value is 100.\nWhen spot instances are requested for this cluster, only spot instances whose bid price\npercentage matches this field will be considered.\nNote that, for safety, we enforce this field to be no more than 10000.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "zone_id": { "description": "Identifier for the availability zone/datacenter in which the cluster resides.\nThis string will be of a form like \"us-west-2a\". The provided availability\nzone must be in the same region as the Databricks deployment. For example, \"us-west-2a\"\nis not a valid zone id if the Databricks deployment resides in the \"us-east-1\" region.\nThis is an optional field at cluster creation, and if not specified, the zone \"auto\" will be used.\nIf the zone specified is \"auto\", will try to place cluster in a zone with high availability,\nand will retry placement in a different AZ if there is not enough capacity.\n\nThe list of available zones as well as the default value can be found by using the\n`List Zones` method.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5471,23 +5890,28 @@ "properties": { "availability": { "description": "Availability type used for all subsequent nodes past the `first_on_demand` ones.\nNote: If `first_on_demand` is zero, this availability\ntype will be used for the entire cluster.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAvailability" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAvailability", + "x-databricks-launch-stage": "GA" }, "capacity_reservation_group": { "description": "The Azure capacity reservation group resource ID to use for launching VMs.\nWhen specified, VMs will be launched using the provided capacity reservation.\n\nCapacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not\nmanaged by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions:\n1. Microsoft.Compute/capacityReservationGroups/read\n2. Microsoft.Compute/capacityReservationGroups/deploy/action\n3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read\n4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action\n\nFormat: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "first_on_demand": { "description": "The first `first_on_demand` nodes of the cluster will be placed on on-demand instances.\nThis value should be greater than 0, to make sure the cluster driver node is placed on an\non-demand instance. If this value is greater than or equal to the current cluster size, all\nnodes will be placed on on-demand instances. If this value is less than the current cluster\nsize, `first_on_demand` nodes will be placed on on-demand instances and the remainder will\nbe placed on `availability` instances. Note that this value does not affect\ncluster size and cannot currently be mutated over the lifetime of a cluster.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "log_analytics_info": { "description": "Defines values necessary to configure and run Azure Log Analytics agent", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.LogAnalyticsInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.LogAnalyticsInfo", + "x-databricks-launch-stage": "GA" }, "spot_bid_max_price": { "description": "The max bid price to be used for Azure spot instances.\nThe Max price for the bid cannot be higher than the on-demand price of the instance.\nIf not specified, the default value is -1, which specifies that the instance cannot be evicted\non the basis of price, and only on the basis of availability. Further, the value should \u003e 0 or -1.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5522,11 +5946,13 @@ "properties": { "jobs": { "description": "With jobs set, the cluster can be used for jobs", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "notebooks": { "description": "With notebooks set, this cluster can be used for notebooks", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5545,15 +5971,18 @@ "properties": { "dbfs": { "description": "destination needs to be provided. e.g.\n`{ \"dbfs\" : { \"destination\" : \"dbfs:/home/cluster_log\" } }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DbfsStorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DbfsStorageInfo", + "x-databricks-launch-stage": "GA" }, "s3": { "description": "destination and either the region or endpoint need to be provided. e.g.\n`{ \"s3\": { \"destination\" : \"s3://cluster_log_bucket/prefix\", \"region\" : \"us-west-2\" } }`\nCluster iam role is used to access s3, please make sure the cluster iam role in\n`instance_profile_arn` has permission to write data to the s3 destination.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.S3StorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.S3StorageInfo", + "x-databricks-launch-stage": "GA" }, "volumes": { "description": "destination needs to be provided, e.g.\n`{ \"volumes\": { \"destination\": \"/Volumes/catalog/schema/volume/cluster_log\" } }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.VolumesStorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.VolumesStorageInfo", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5604,143 +6033,178 @@ "properties": { "apply_policy_default_values": { "description": "When set to true, fixed and default values from the policy will be used for fields that are omitted. When set to false, only fixed values from the policy will be applied.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "autoscale": { "description": "Parameters needed in order to automatically scale clusters up and down based on load.\nNote: autoscaling works best with DB runtime versions 3.0 or later.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AutoScale" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AutoScale", + "x-databricks-launch-stage": "GA" }, "autotermination_minutes": { "description": "Automatically terminates the cluster after it is inactive for this time in minutes. If not set,\nthis cluster will not be automatically terminated. If specified, the threshold must be between\n10 and 10000 minutes.\nUsers can also set this value to 0 to explicitly disable automatic termination.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "aws_attributes": { "description": "Attributes related to clusters running on Amazon Web Services.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes", + "x-databricks-launch-stage": "GA" }, "azure_attributes": { "description": "Attributes related to clusters running on Microsoft Azure.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes", + "x-databricks-launch-stage": "GA" }, "cluster_log_conf": { "description": "The configuration for delivering spark logs to a long-term storage destination.\nThree kinds of destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be specified\nfor one cluster. If the conf is given, the logs will be delivered to the destination every\n`5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while\nthe destination of executor logs is `$destination/$clusterId/executor`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf", + "x-databricks-launch-stage": "GA" }, "cluster_name": { "description": "Cluster name requested by the user. This doesn't have to be unique.\nIf not specified at creation, the cluster name will be an empty string.\nFor job clusters, the cluster name is automatically set based on the job and job run IDs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "custom_tags": { "description": "Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS\ninstances and EBS volumes) with these tags in addition to `default_tags`. Notes:\n\n- Currently, Databricks allows at most 45 custom tags\n\n- Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "data_security_mode": { "description": "Data security mode decides what data governance model to use when accessing data\nfrom a cluster.\n\n* `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate access mode depending on your compute configuration.\n* `DATA_SECURITY_MODE_STANDARD`: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other’s data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited.\n* `DATA_SECURITY_MODE_DEDICATED`: A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode.\n\nThe following modes are legacy aliases for the above modes:\n\n* `USER_ISOLATION`: Legacy alias for `DATA_SECURITY_MODE_STANDARD`.\n* `SINGLE_USER`: Legacy alias for `DATA_SECURITY_MODE_DEDICATED`.\n\nThe following modes are deprecated starting with Databricks Runtime 15.0 and\nwill be removed for future Databricks Runtime versions:\n\n* `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters.\n* `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high concurrency clusters.\n* `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy Passthrough on standard clusters.\n* `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have UC nor passthrough enabled.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DataSecurityMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DataSecurityMode", + "x-databricks-launch-stage": "GA" }, "dependency_mode": { "description": "[Beta] Controls dependency configuration for the cluster.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DependencyMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DependencyMode", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "docker_image": { "description": "Custom docker image BYOC", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DockerImage" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DockerImage", + "x-databricks-launch-stage": "GA" }, "driver_instance_pool_id": { "description": "The optional ID of the instance pool for the driver of the cluster belongs.\nThe pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not\nassigned.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "driver_node_type_flexibility": { "description": "Flexible node type configuration for the driver node.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility", + "x-databricks-launch-stage": "GA" }, "driver_node_type_id": { "description": "The node type of the Spark driver.\nNote that this field is optional; if unset, the driver node type will be set as the same value\nas `node_type_id` defined above.\n\nThis field, along with node_type_id, should not be set if virtual_cluster_size is set.\nIf both driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id and node_type_id take precedence.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enable_elastic_disk": { "description": "Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk\nspace when its Spark workers are running low on disk space.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "enable_local_disk_encryption": { "description": "Whether to enable LUKS on cluster VMs' local disks", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "gcp_attributes": { "description": "Attributes related to clusters running on Google Cloud Platform.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes", + "x-databricks-launch-stage": "GA" }, "init_scripts": { "description": "The configuration for storing init scripts. Any number of destinations can be specified.\nThe scripts are executed sequentially in the order provided.\nIf `cluster_log_conf` is specified, init script logs are sent to `\u003cdestination\u003e/\u003ccluster-ID\u003e/init_scripts`.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo", + "x-databricks-launch-stage": "GA" }, "instance_pool_id": { "description": "The optional ID of the instance pool to which the cluster belongs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "is_single_node": { "description": "This field can only be used when `kind = CLASSIC_PREVIEW`.\n\nWhen set to true, Databricks will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers`", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "kind": { "description": "The kind of compute described by this compute specification.\n\nDepending on `kind`, different validations and default values will be applied.\n\nClusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no specified `kind` do not.\n* [is_single_node](/api/workspace/clusters/create#is_single_node)\n* [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime)\n\nBy using the [simple form](https://docs.databricks.com/compute/simple-form.html), your clusters are automatically using `kind = CLASSIC_PREVIEW`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Kind" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Kind", + "x-databricks-launch-stage": "GA" }, "node_type_id": { "description": "This field encodes, through a single value, the resources available to each of\nthe Spark nodes in this cluster. For example, the Spark nodes can be provisioned\nand optimized for memory or compute intensive workloads. A list of available node\ntypes can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "num_workers": { "description": "Number of worker nodes that this cluster should have. A cluster has one Spark Driver\nand `num_workers` Executors for a total of `num_workers` + 1 Spark nodes.\n\nNote: When reading the properties of a cluster, this field reflects the desired number\nof workers rather than the actual current number of workers. For instance, if a cluster\nis resized from 5 to 10 workers, this field will immediately be updated to reflect\nthe target size of 10 workers, whereas the workers listed in `spark_info` will gradually\nincrease from 5 to 10 as the new nodes are provisioned.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "policy_id": { "description": "The ID of the cluster policy used to create the cluster if applicable.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "remote_disk_throughput": { "description": "If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "runtime_engine": { "description": "Determines the cluster's runtime engine, either standard or Photon.\n\nThis field is not compatible with legacy `spark_version` values that contain `-photon-`.\nRemove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`.\n\nIf left unspecified, the runtime engine defaults to standard unless the spark_version\ncontains -photon-, in which case Photon will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.RuntimeEngine" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.RuntimeEngine", + "x-databricks-launch-stage": "GA" }, "single_user_name": { "description": "Single user name if data_security_mode is `SINGLE_USER`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "spark_conf": { "description": "An object containing a set of optional, user-specified Spark configuration key-value pairs.\nUsers can also pass in a string of extra JVM options to the driver and the executors via\n`spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "spark_env_vars": { "description": "An object containing a set of optional, user-specified environment variable key-value pairs.\nPlease note that key-value pair of the form (X,Y) will be exported as is (i.e.,\n`export X='Y'`) while launching the driver and workers.\n\nIn order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending\nthem to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all\ndefault databricks managed environmental variables are included as well.\n\nExample Spark environment variables:\n`{\"SPARK_WORKER_MEMORY\": \"28000m\", \"SPARK_LOCAL_DIRS\": \"/local_disk0\"}` or\n`{\"SPARK_DAEMON_JAVA_OPTS\": \"$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true\"}`", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "spark_version": { "description": "The Spark version of the cluster, e.g. `3.3.x-scala2.11`.\nA list of available Spark versions can be retrieved by using\nthe [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "ssh_public_keys": { "description": "SSH public key contents that will be added to each Spark node in this cluster. The\ncorresponding private keys can be used to login with the user name `ubuntu` on port `2200`.\nUp to 10 keys can be specified.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "total_initial_remote_disk_size": { "description": "If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "use_ml_runtime": { "description": "This field can only be used when `kind = CLASSIC_PREVIEW`.\n\n`effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "worker_node_type_flexibility": { "description": "Flexible node type configuration for worker nodes.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.NodeTypeFlexibility", + "x-databricks-launch-stage": "GA" }, "workload_type": { "description": "Cluster Attributes showing for clusters workload types.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.WorkloadType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.WorkloadType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5815,7 +6279,8 @@ "properties": { "destination": { "description": "dbfs destination, e.g. `dbfs:/my/path`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -5859,23 +6324,28 @@ "properties": { "disk_count": { "description": "The number of disks launched for each instance:\n- This feature is only enabled for supported node types.\n- Users can choose up to the limit of the disks supported by the node type.\n- For node types with no OS disk, at least one disk must be specified;\notherwise, cluster creation will fail.\n\nIf disks are attached, Databricks will configure Spark to use only the disks for\nscratch storage, because heterogenously sized scratch devices can lead to inefficient disk\nutilization. If no disks are attached, Databricks will configure Spark to use\ninstance store disks.\n\nNote: If disks are specified, then the Spark configuration\n`spark.local.dir` will be overridden.\n\nDisks will be mounted at:\n- For AWS: `/ebs0`, `/ebs1`, and etc.\n- For Azure: `/remote_volume0`, `/remote_volume1`, and etc.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "disk_iops": { "description": "The number of IOPS to provision for each attached disk.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "disk_size": { "description": "The size of each disk (in GiB) launched for each instance.\nValues must fall into the supported range for a particular instance type.\n\nFor AWS:\n- General Purpose SSD: 100 - 4096 GiB\n- Throughput Optimized HDD: 500 - 4096 GiB\n\nFor Azure:\n- Premium LRS (SSD): 1 - 1023 GiB\n- Standard LRS (HDD): 1- 1023 GiB", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "disk_throughput": { "description": "The disk throughput to provision for each attached disk, in MB per second.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "disk_type": { "description": "The type of disks that will be launched with this cluster.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5894,11 +6364,13 @@ "properties": { "azure_disk_volume_type": { "description": "All Azure Disk types that Databricks supports.\nSee https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskTypeAzureDiskVolumeType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskTypeAzureDiskVolumeType", + "x-databricks-launch-stage": "GA" }, "ebs_volume_type": { "description": "All EBS volume types that Databricks supports.\nSee https://aws.amazon.com/ebs/details/ for details.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskTypeEbsVolumeType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DiskTypeEbsVolumeType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5948,11 +6420,13 @@ "properties": { "password": { "description": "Password of the user", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "username": { "description": "Name of the user", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -5970,11 +6444,13 @@ "properties": { "basic_auth": { "description": "Basic auth with username and password", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DockerBasicAuth" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DockerBasicAuth", + "x-databricks-launch-stage": "GA" }, "url": { "description": "URL of the docker image.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6009,25 +6485,30 @@ "properties": { "base_environment": { "description": "The base environment this environment is built on top of. A base environment defines the environment version and a\nlist of dependencies for serverless compute. The value can be a file path to a custom `env.yaml` file\n(e.g., `/Workspace/path/to/env.yaml`). Support for a Databricks-provided base environment ID\n(e.g., `workspace-base-environments/databricks_ai_v4`) and workspace base environment ID\n(e.g., `workspace-base-environments/dbe_b849b66e-b31a-4cb5-b161-1f2b10877fb7`) is in Beta.\nEither `environment_version` or `base_environment` can be provided.\nFor more information about Databricks-provided base environments, see the\n[list workspace base environments](:method:Environments/ListWorkspaceBaseEnvironments) API.\nFor more information, see", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "client": { "description": "Use `environment_version` instead.", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "dependencies": { "description": "List of pip dependencies, as supported by the version of pip in this environment.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "environment_version": { "description": "Either `environment_version` or `base_environment` needs to be provided. Environment version used by the environment.\nEach version comes with a specific Python version and a set of Python packages.\nThe version is a string, consisting of an integer.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "java_dependencies": { "description": "List of java dependencies. Each dependency is a string representing a java library path. For example: `/Volumes/path/to/test.jar`.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6046,11 +6527,13 @@ "properties": { "availability": { "description": "This field determines whether the spark executors will be scheduled to run on preemptible\nVMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAvailability" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAvailability", + "x-databricks-launch-stage": "GA" }, "boot_disk_size": { "description": "Boot disk size in GB", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "confidential_compute_type": { "description": "[Private Preview] The confidential computing technology for this cluster's instances.\nCurrently only SEV_SNP is supported, and only on N2D instance types.\nWhen not set, no confidential computing is applied.", @@ -6060,25 +6543,30 @@ }, "first_on_demand": { "description": "The first `first_on_demand` nodes of the cluster will be placed on on-demand instances.\nThis value should be greater than 0, to make sure the cluster driver node is placed on an\non-demand instance. If this value is greater than or equal to the current cluster size, all\nnodes will be placed on on-demand instances. If this value is less than the current cluster\nsize, `first_on_demand` nodes will be placed on on-demand instances and the remainder will\nbe placed on `availability` instances. Note that this value does not affect\ncluster size and cannot currently be mutated over the lifetime of a cluster.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "google_service_account": { "description": "If provided, the cluster will impersonate the google service account when accessing\ngcloud services (like GCS). The google service account\nmust have previously been added to the Databricks environment by an account\nadministrator.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "local_ssd_count": { "description": "If provided, each node (workers and driver) in the cluster will have this number of local SSDs attached.\nEach local SSD is 375GB in size.\nRefer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds)\nfor the supported number of local SSDs for each instance type.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "use_preemptible_executors": { "description": "This field determines whether the spark executors will be scheduled to run on preemptible\nVMs (when set to true) versus standard compute engine VMs (when set to false; default).\nNote: Soon to be deprecated, use the 'availability' field instead.", "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "zone_id": { "description": "Identifier for the availability zone in which the cluster resides.\nThis can be one of the following:\n- \"HA\" =\u003e High availability, spread nodes across availability zones for a Databricks deployment region [default].\n- \"AUTO\" =\u003e Databricks picks an availability zone to schedule the cluster on.\n- A GCP availability zone =\u003e Pick One of the available zones for (machine type + region) from\nhttps://cloud.google.com/compute/docs/regions-zones.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6114,7 +6602,8 @@ "properties": { "destination": { "description": "GCS destination/URI, e.g. `gs://my-bucket/some-prefix`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6156,33 +6645,40 @@ "properties": { "abfss": { "description": "Contains the Azure Data Lake Storage destination path", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Adlsgen2Info" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Adlsgen2Info", + "x-databricks-launch-stage": "GA" }, "dbfs": { "description": "destination needs to be provided. e.g.\n`{ \"dbfs\": { \"destination\" : \"dbfs:/home/cluster_log\" } }`", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.DbfsStorageInfo", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "file": { "description": "destination needs to be provided, e.g.\n`{ \"file\": { \"destination\": \"file:/my/local/file.sh\" } }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.LocalFileInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.LocalFileInfo", + "x-databricks-launch-stage": "GA" }, "gcs": { "description": "destination needs to be provided, e.g.\n`{ \"gcs\": { \"destination\": \"gs://my-bucket/file.sh\" } }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcsStorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcsStorageInfo", + "x-databricks-launch-stage": "GA" }, "s3": { "description": "destination and either the region or endpoint need to be provided. e.g.\n`{ \\\"s3\\\": { \\\"destination\\\": \\\"s3://cluster_log_bucket/prefix\\\", \\\"region\\\": \\\"us-west-2\\\" } }`\nCluster iam role is used to access s3, please make sure the cluster iam role in\n`instance_profile_arn` has permission to write data to the s3 destination.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.S3StorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.S3StorageInfo", + "x-databricks-launch-stage": "GA" }, "volumes": { "description": "destination needs to be provided. e.g.\n`{ \\\"volumes\\\" : { \\\"destination\\\" : \\\"/Volumes/my-init.sh\\\" } }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.VolumesStorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.VolumesStorageInfo", + "x-databricks-launch-stage": "GA" }, "workspace": { "description": "destination needs to be provided, e.g.\n`{ \"workspace\": { \"destination\": \"/cluster-init-scripts/setup-datadog.sh\" } }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.WorkspaceStorageInfo" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.WorkspaceStorageInfo", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6201,19 +6697,23 @@ "properties": { "availability": { "description": "Availability type used for the spot nodes.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAwsAttributesAvailability" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAwsAttributesAvailability", + "x-databricks-launch-stage": "GA" }, "instance_profile_arn": { "description": "[Beta] All AWS instances belonging to the instance pool will have this instance profile. If omitted, instances\nwill initially be launched with the workspace's default instance profile. If defined, clusters that use the\npool will inherit the instance profile, and must not specify their own instance profile on cluster creation or\nupdate. If the pool does not specify an instance profile, clusters using the pool may specify any instance profile.\nThe instance profile must have previously been added to the Databricks environment by an account administrator.\n\nThis feature may only be available to certain customer plans.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "spot_bid_price_percent": { "description": "Calculates the bid price for AWS spot instances, as a percentage of the corresponding instance type's\non-demand price.\nFor example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot\ninstance, then the bid price is half of the price of\non-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice\nthe price of on-demand `r3.xlarge` instances. If not specified, the default value is 100.\nWhen spot instances are requested for this cluster, only spot instances whose bid price\npercentage matches this field will be considered.\nNote that, for safety, we enforce this field to be no more than 10000.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "zone_id": { "description": "Identifier for the availability zone/datacenter in which the cluster resides.\nThis string will be of a form like \"us-west-2a\". The provided availability\nzone must be in the same region as the Databricks deployment. For example, \"us-west-2a\"\nis not a valid zone id if the Databricks deployment resides in the \"us-east-1\" region.\nThis is an optional field at cluster creation, and if not specified, a default zone will be used.\nThe list of available zones as well as the default value can be found by using the\n`List Zones` method.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6248,15 +6748,18 @@ "properties": { "availability": { "description": "Availability type used for the spot nodes.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAzureAttributesAvailability" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.InstancePoolAzureAttributesAvailability", + "x-databricks-launch-stage": "GA" }, "capacity_reservation_group": { "description": "The Azure capacity reservation group resource ID to use for launching VMs in this pool.\nWhen specified, VMs will be launched using the provided capacity reservation.\n\nNOTE: Omitting this field will clear any existing configured capacity reservation group on the pool.\n\nCapacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not\nmanaged by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions:\n1. Microsoft.Compute/capacityReservationGroups/read\n2. Microsoft.Compute/capacityReservationGroups/deploy/action\n3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read\n4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action\n\nFormat: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "spot_bid_max_price": { "description": "With variable pricing, you have option to set a max price, in US dollars (USD)\nFor example, the value 2 would be a max price of $2.00 USD per hour.\nIf you set the max price to be -1, the VM won't be evicted based on price.\nThe price for the VM will be the current price for spot or the price for a standard VM,\nwhich ever is less, as long as there is capacity and quota available.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6291,15 +6794,18 @@ "properties": { "gcp_availability": { "description": "This field determines whether the instance pool will contain preemptible\nVMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAvailability" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAvailability", + "x-databricks-launch-stage": "GA" }, "local_ssd_count": { "description": "If provided, each node in the instance pool will have this number of local SSDs attached.\nEach local SSD is 375GB in size. Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds)\nfor the supported number of local SSDs for each instance type.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "zone_id": { "description": "Identifier for the availability zone/datacenter in which the cluster resides.\nThis string will be of a form like \"us-west1-a\". The provided availability\nzone must be in the same region as the Databricks workspace. For example, \"us-west1-a\"\nis not a valid zone id if the Databricks workspace resides in the \"us-east1\" region.\nThis is an optional field at instance pool creation, and if not specified, a default zone will be used.\n\nThis field can be one of the following:\n- \"HA\" =\u003e High availability, spread nodes across availability zones for a Databricks deployment region\n- A GCP availability zone =\u003e Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones (e.g. \"us-west1-a\").\n\nIf empty, Databricks picks an availability zone to schedule the cluster on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6348,33 +6854,40 @@ "properties": { "cran": { "description": "Specification of a CRAN library to be installed as part of the library", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.RCranLibrary" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.RCranLibrary", + "x-databricks-launch-stage": "GA" }, "egg": { "description": "Deprecated. URI of the egg library to install. Installing Python egg files is deprecated and is not supported in Databricks Runtime 14.0 and above.", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "jar": { "description": "URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs.\nFor example: `{ \"jar\": \"/Workspace/path/to/library.jar\" }`, `{ \"jar\" : \"/Volumes/path/to/library.jar\" }` or\n`{ \"jar\": \"s3://my-bucket/library.jar\" }`.\nIf S3 is used, please make sure the cluster has read access on the library. You may need to\nlaunch the cluster with an IAM role to access the S3 URI.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "maven": { "description": "Specification of a maven library to be installed. For example:\n`{ \"coordinates\": \"org.jsoup:jsoup:1.7.2\" }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.MavenLibrary" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.MavenLibrary", + "x-databricks-launch-stage": "GA" }, "pypi": { "description": "Specification of a PyPi library to be installed. For example:\n`{ \"package\": \"simplejson\" }`", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.PythonPyPiLibrary" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.PythonPyPiLibrary", + "x-databricks-launch-stage": "GA" }, "requirements": { "description": "URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes paths are supported.\nFor example: `{ \"requirements\": \"/Workspace/path/to/requirements.txt\" }` or `{ \"requirements\" : \"/Volumes/path/to/requirements.txt\" }`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "whl": { "description": "URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs.\nFor example: `{ \"whl\": \"/Workspace/path/to/library.whl\" }`, `{ \"whl\" : \"/Volumes/path/to/library.whl\" }` or\n`{ \"whl\": \"s3://my-bucket/library.whl\" }`.\nIf S3 is used, please make sure the cluster has read access on the library. You may need to\nlaunch the cluster with an IAM role to access the S3 URI.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6392,7 +6905,8 @@ "properties": { "destination": { "description": "local file destination, e.g. `file:/my/local/file.sh`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6413,11 +6927,13 @@ "properties": { "log_analytics_primary_key": { "description": "The primary key for the Azure Log Analytics agent configuration", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "log_analytics_workspace_id": { "description": "The workspace ID for the Azure Log Analytics agent configuration", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6435,15 +6951,18 @@ "properties": { "coordinates": { "description": "Gradle-style maven coordinates. For example: \"org.jsoup:jsoup:1.7.2\".", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "exclusions": { "description": "List of dependences to exclude. For example: `[\"slf4j:slf4j\", \"*:hadoop-client\"]`.\n\nMaven dependency exclusions:\nhttps://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "repo": { "description": "Maven repo to install the Maven package from. If omitted, both Maven Central Repository\nand Spark Packages are searched.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6465,7 +6984,8 @@ "properties": { "alternate_node_type_ids": { "description": "A list of node type IDs to use as fallbacks when the primary node type is unavailable.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -6483,11 +7003,13 @@ "properties": { "package": { "description": "The name of the pypi package to install. An optional exact version specification is also\nsupported. Examples: \"simplejson\" and \"simplejson==3.8.0\".", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "repo": { "description": "The repository where the package can be found. If not specified, the default pip index is\nused.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6508,11 +7030,13 @@ "properties": { "package": { "description": "The name of the CRAN package to install.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "repo": { "description": "The repository where the package can be found. If not specified, the default CRAN repo is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6550,31 +7074,38 @@ "properties": { "canned_acl": { "description": "(Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`.\nIf `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on\nthe destination bucket and prefix. The full list of possible canned acl can be found at\nhttp://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl.\nPlease also note that by default only the object owner gets full controls. If you are using cross account\nrole for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to\nread the logs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "destination": { "description": "S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using\ncluster iam role, please make sure you set cluster iam role and the role has write access to the\ndestination. Please also note that you cannot use AWS keys to deliver logs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enable_encryption": { "description": "(Optional) Flag to enable server side encryption, `false` by default.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "encryption_type": { "description": "(Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when\nencryption is enabled and the default type is `sse-s3`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "endpoint": { "description": "S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be set.\nIf both are set, endpoint will be used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "kms_key": { "description": "(Optional) Kms key which will be used if encryption is enabled and encryption type is set to `sse-kms`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "region": { "description": "S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set,\nendpoint will be used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6596,7 +7127,8 @@ "properties": { "destination": { "description": "UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`\nor `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6618,7 +7150,8 @@ "properties": { "clients": { "description": "defined what type of clients can use the cluster. E.g. Notebooks, Jobs", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClientsTypes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClientsTypes", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6640,7 +7173,8 @@ "properties": { "destination": { "description": "wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -6676,11 +7210,13 @@ "properties": { "key": { "description": "[Beta] The key of the custom tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "value": { "description": "[Beta] The value of the custom tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -6699,15 +7235,18 @@ "properties": { "branch_time": { "description": "[Public Preview] Branch time of the ref database instance.\nFor a parent ref instance, this is the point in time on the parent instance from which the\ninstance was created.\nFor a child ref instance, this is the point in time on the instance from which the child\ninstance was created.\nInput: For specifying the point in time to create a child instance. Optional.\nOutput: Only populated if provided as input to create a child instance.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "lsn": { "description": "[Public Preview] User-specified WAL LSN of the ref database instance.\n\nInput: For specifying the WAL LSN to create a child instance. Optional.\nOutput: Only populated if provided as input to create a child instance.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "name": { "description": "[Public Preview] Name of the ref database instance.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -6765,15 +7304,18 @@ "properties": { "budget_policy_id": { "description": "[Beta] Budget policy to set on the newly created pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "storage_catalog": { "description": "[Public Preview] This field needs to be specified if the destination catalog is a managed postgres catalog.\n\nUC catalog for the pipeline to store intermediate files (checkpoints, event logs etc).\nThis needs to be a standard catalog where the user has permissions to create Delta tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "storage_schema": { "description": "[Public Preview] This field needs to be specified if the destination catalog is a managed postgres catalog.\n\nUC schema for the pipeline to store intermediate files (checkpoints, event logs etc).\nThis needs to be in the standard catalog where the user has permissions to create Delta tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -6931,31 +7473,38 @@ }, "create_database_objects_if_missing": { "description": "[Public Preview] If true, the synced table's logical database and schema resources in PG\nwill be created if they do not already exist.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "existing_pipeline_id": { "description": "[Public Preview] At most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nIf existing_pipeline_id is defined, the synced table will be bin packed into the existing pipeline\nreferenced. This avoids creating a new pipeline and allows sharing existing compute.\nIn this case, the scheduling_policy of this synced table must match the scheduling policy of the existing pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "new_pipeline_spec": { "description": "[Public Preview] At most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nIf new_pipeline_spec is defined, a new pipeline is created for this synced table. The location pointed to is used\nto store intermediate files (checkpoints, event logs etc). The caller must have write permissions to create Delta\ntables in the specified catalog and schema. Again, note this requires write permissions, whereas the source table\nonly requires read permissions.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.NewPipelineSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.NewPipelineSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "primary_key_columns": { "description": "[Public Preview] Primary Key columns to be used for data insert/update in the destination.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "scheduling_policy": { "description": "[Public Preview] Scheduling policy of the underlying pipeline.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableSchedulingPolicy" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableSchedulingPolicy", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_table_full_name": { "description": "[Public Preview] Three-part (catalog, schema, table) name of the source Delta table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "timeseries_key": { "description": "[Public Preview] Time series key to deduplicate (tie-break) rows with the same primary key.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "type_overrides": { "description": "[Private Preview] Override the default Delta-\u003ePG type mapping for specific columns.\nA TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set.", @@ -7077,19 +7626,23 @@ "properties": { "continuous_update_status": { "description": "[Public Preview] Detailed status of a synced table. Shown if the synced table is in the SYNCED_CONTINUOUS_UPDATE\nor the SYNCED_UPDATING_PIPELINE_RESOURCES state.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableContinuousUpdateStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableContinuousUpdateStatus", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "failed_status": { "description": "[Public Preview] Detailed status of a synced table. Shown if the synced table is in the OFFLINE_FAILED or the\nSYNCED_PIPELINE_FAILED state.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableFailedStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableFailedStatus", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "provisioning_status": { "description": "[Public Preview] Detailed status of a synced table. Shown if the synced table is in the\nPROVISIONING_PIPELINE_RESOURCES or the PROVISIONING_INITIAL_SNAPSHOT state.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableProvisioningStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableProvisioningStatus", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "triggered_update_status": { "description": "[Public Preview] Detailed status of a synced table. Shown if the synced table is in the SYNCED_TRIGGERED_UPDATE\nor the SYNCED_NO_PENDING_UPDATE state.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableTriggeredUpdateStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/database.SyncedTableTriggeredUpdateStatus", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -7183,15 +7736,18 @@ }, "deployments": { "description": "[Public Preview] Deployment specs for this task. Exactly one deployment is currently\nsupported (a single entry where every node runs the same command); this\nis a current-Preview constraint. Role-split workloads (driver + worker,\nparameter server, separate eval node, etc.) with multiple entries are the\neventual intent but not yet supported.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.DeploymentSpec" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.DeploymentSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "docker_image_url": { "description": "[Beta] Optional Docker image URL for a custom container image. When set,\nthe task runs on the specified container image instead of the default\nDatabricks client image. Format:\n`{organization}/{repository}:{tag}`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "experiment": { "description": "[Public Preview] MLflow experiment name for this run. If an experiment with this name\nalready exists under the calling user, the run is appended to it;\notherwise a new experiment is created. To target a specific MLflow\nstorage location (for example, when running as a service principal), set\n`mlflow_experiment_directory`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "mlflow_artifact_location": { "description": "[Private Preview] Optional root location for MLflow artifacts logged by the run.\nIf this field isn't specified the default artifact location will be in dbfs\ni.e. `dbfs:/databricks/mlflow-tracking/\u003cexperiment_id\u003e/...`\nIf dbfs access is restricted or UC is preferred this can be a custom location in UC:\n`dbfs:/Volumes/\u003ccatalog\u003e/\u003cschema\u003e/\u003cvolume\u003e/...`\nThe location should be unique for each experiment.", @@ -7201,11 +7757,13 @@ }, "mlflow_experiment_directory": { "description": "[Public Preview] Optional workspace directory under which the MLflow experiment named in\n`experiment` is created. Must start with `/Workspace`. Set this when\nrunning as a service principal that has no default user directory; for\nregular users the experiment defaults to the user's home directory.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "mlflow_run": { "description": "[Public Preview] Optional display name for the MLflow run created under `experiment`. If\nomitted, MLflow generates a default name.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -7227,19 +7785,23 @@ "properties": { "alert_id": { "description": "[Public Preview] The alert_id is the canonical identifier of the alert.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "subscribers": { "description": "[Public Preview] The subscribers receive alert evaluation result notifications after the alert task is completed.\nThe number of subscriptions is limited to 100.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.AlertTaskSubscriber" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.AlertTaskSubscriber", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "warehouse_id": { "description": "[Public Preview] The warehouse_id identifies the warehouse settings used by the alert task.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "workspace_path": { "description": "[Public Preview] The workspace_path is the path to the alert file in the workspace. The path:\n* must start with \"/Workspace\"\n* must be a normalized path.\nUser has to select only one of alert_id or workspace_path to identify the alert.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -7258,11 +7820,13 @@ "properties": { "destination_id": { "description": "[Public Preview]", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "user_name": { "description": "[Public Preview] A valid workspace email address.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -7300,19 +7864,23 @@ "properties": { "clean_room_name": { "description": "The clean room that the notebook belongs to.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "etag": { "description": "Checksum to validate the freshness of the notebook resource (i.e. the notebook being run is the latest version).\nIt can be fetched by calling the :method:cleanroomassets/get API.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "notebook_base_parameters": { "description": "Base parameters to be used for the clean room notebook job.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "notebook_name": { "description": "Name of the notebook being run.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7334,7 +7902,8 @@ "properties": { "hardware_accelerator": { "description": "[Beta] Hardware accelerator configuration for Serverless GPU workloads.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.HardwareAcceleratorType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.HardwareAcceleratorType", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -7388,11 +7957,13 @@ "properties": { "accelerator_count": { "description": "[Public Preview] Total number of accelerators across all nodes. Must be a positive\nmultiple of the per-node accelerator count encoded in `accelerator_type`.\nFor example, `GPU_8xH100` with `accelerator_count: 16` allocates 2 nodes\n(8 GPUs per node).", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "accelerator_type": { "description": "[Public Preview] Hardware accelerator type (for example, `GPU_1xA10` or `GPU_8xH100`).\nThe number of accelerators per node is encoded in the enum value —\n`GPU_8xH100` means 8 H100 GPUs per node.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ComputeSpecAcceleratorType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ComputeSpecAcceleratorType", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -7451,15 +8022,18 @@ "properties": { "left": { "description": "The left operand of the condition task. Can be either a string value or a job state or parameter reference.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "op": { "description": "* `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their operands. This means that `“12.0” == “12”` will evaluate to `false`.\n* `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL` operators perform numeric comparison of their operands. `“12.0” \u003e= “12”` will evaluate to `true`, `“10.0” \u003e= “12”` will evaluate to `false`.\n\nThe boolean comparison to task values can be implemented with operators `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it will be serialized to `“true”` or `“false”` for the comparison.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ConditionTaskOp" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ConditionTaskOp", + "x-databricks-launch-stage": "GA" }, "right": { "description": "The right operand of the condition task. Can be either a string value or a job state or parameter reference.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7502,11 +8076,13 @@ "properties": { "pause_status": { "description": "Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus", + "x-databricks-launch-stage": "GA" }, "task_retry_mode": { "description": "Indicate whether the continuous job is applying task level retries or not. Defaults to NEVER.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskRetryMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskRetryMode", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -7525,7 +8101,8 @@ "properties": { "task_retry_mode": { "description": "[Beta] Whether the continuous job applies task-level retries. Defaults to NEVER.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskRetryMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskRetryMode", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -7543,11 +8120,13 @@ "properties": { "pause_status": { "description": "Indicate whether this schedule is paused or not.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus", + "x-databricks-launch-stage": "GA" }, "quartz_cron_expression": { "description": "A Cron expression using Quartz syntax that describes the schedule for a job. See [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details. This field is required.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "sql_condition": { "description": "[Private Preview] SQL condition that must be satisfied before a scheduled run is triggered. The condition is evaluated\nafter the cron expression fires and must return a truthy result for the run to proceed.", @@ -7557,7 +8136,8 @@ }, "timezone_id": { "description": "A Java timezone ID. The schedule for a job is resolved with respect to this timezone. See [Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details. This field is required.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7580,11 +8160,13 @@ "properties": { "quartz_cron_expression": { "description": "[Beta] A Cron expression using Quartz syntax that describes the schedule for this trigger. See\n[Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "timezone_id": { "description": "[Beta] A Java timezone ID. The schedule is resolved with respect to this timezone. See\n[Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -7607,7 +8189,8 @@ "properties": { "dashboard_id": { "description": "The identifier of the dashboard to refresh.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "filters": { "description": "[Private Preview] Dashboard task parameters. Used to apply dashboard filter values during dashboard task execution. Parameter values get applied to any dashboard filters that have a matching URL identifier as the parameter key.\nThe parameter value format is dependent on the filter type:\n- For text and single-select filters, provide a single value (e.g. `\"value\"`)\n- For date and datetime filters, provide the value in ISO 8601 format (e.g. `\"2000-01-01T00:00:00\"`)\n- For multi-select filters, provide a JSON array of values (e.g. `\"[\\\"value1\\\",\\\"value2\\\"]\"`)\n- For range and date range filters, provide a JSON object with `start` and `end` (e.g. `\"{\\\"start\\\":\\\"1\\\",\\\"end\\\":\\\"10\\\"}\"`)", @@ -7617,11 +8200,13 @@ }, "subscription": { "description": "Optional: subscription configuration for sending the dashboard snapshot.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Subscription" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Subscription", + "x-databricks-launch-stage": "GA" }, "warehouse_id": { "description": "Optional: The warehouse id to execute the dashboard with for the schedule.\nIf not specified, the default warehouse of the dashboard will be used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -7692,31 +8277,38 @@ "properties": { "catalog": { "description": "Optional name of the catalog to use. The value is the top level in the 3-level namespace of Unity Catalog (catalog / schema / relation). The catalog value can only be specified if a warehouse_id is specified. Requires dbt-databricks \u003e= 1.1.1.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "commands": { "description": "A list of dbt commands to execute. All commands must start with `dbt`. This parameter must not be empty. A maximum of up to 10 commands can be provided.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "profiles_directory": { "description": "Optional (relative) path to the profiles directory. Can only be specified if no warehouse_id is specified. If no warehouse_id is specified and this folder is unset, the root directory is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "project_directory": { "description": "Path to the project directory. Optional for Git sourced tasks, in which\ncase if no value is provided, the root of the Git repository is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schema": { "description": "Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the `default` schema is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "source": { "description": "Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved\nfrom the local Databricks workspace. When set to `GIT`, the project will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: Project is located in Databricks workspace.\n* `GIT`: Project is located in cloud Git provider.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source", + "x-databricks-launch-stage": "GA" }, "warehouse_id": { "description": "ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the `--profiles-dir` command line argument.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7738,15 +8330,18 @@ "properties": { "command_path": { "description": "[Public Preview] Workspace path of the script to run on each node in this deployment.\nUpload the script to this path and supply the path here. When the task\nruns, the file at this path is run on each node; if it fails, the task\nfails with its exit code.\n\nExample script contents:\n\n# Plain Python:\npython train.py --epochs 10\n\n# Multi-GPU via accelerate:\naccelerate launch train.py --config config.yaml\n\n# Distributed via torchrun:\ntorchrun --nproc_per_node=8 train.py", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "compute": { "description": "[Public Preview] Compute resources allocated to each node in this deployment.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ComputeSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ComputeSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "name": { "description": "[Public Preview] Optional human-readable name for this deployment (for example, `driver`,\n`worker`, `param_server`). Used for log and UI display. Distinct names\nare recommended so deployments can be told apart, but uniqueness is not\nenforced.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -7768,15 +8363,18 @@ "properties": { "min_time_between_triggers_seconds": { "description": "If set, the trigger starts a run only after the specified amount of time passed since\nthe last time the trigger fired. The minimum allowed value is 60 seconds", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "url": { "description": "URL to be monitored for file arrivals. The path must point to the root or a subpath of the external location.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "wait_after_last_change_seconds": { "description": "If set, the trigger starts a run only after no file activity has occurred for the specified amount of time.\nThis makes it possible to wait for a batch of incoming files to arrive before triggering a run. The\nminimum allowed value is 60 seconds.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7797,15 +8395,18 @@ "properties": { "concurrency": { "description": "An optional maximum allowed number of concurrent runs of the task.\nSet this value if you want to be able to execute multiple runs of the task concurrently.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "inputs": { "description": "Array for task to iterate on. This can be a JSON string or a reference to\nan array parameter.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "task": { "description": "Configuration for the task that will be run for each element in the array", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Task" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Task", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7930,7 +8531,8 @@ "properties": { "used_commit": { "description": "Commit that was used to execute the run. If git_branch was specified, this points to the HEAD of the branch at the time of the run; if git_tag was specified, this points to the commit the tag points to.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -7949,26 +8551,32 @@ "properties": { "git_branch": { "description": "Name of the branch to be checked out and used by this job. This field cannot be specified in conjunction with git_tag or git_commit.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "git_commit": { "description": "Commit to be checked out and used by this job. This field cannot be specified in conjunction with git_branch or git_tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "git_provider": { "description": "Unique identifier of the service used to host the Git repository. The value is case insensitive.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.GitProvider" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.GitProvider", + "x-databricks-launch-stage": "GA" }, "git_tag": { "description": "Name of the tag to be checked out and used by this job. This field cannot be specified in conjunction with git_branch or git_commit.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "git_url": { "description": "URL of the repository to be cloned by this job.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "sparse_checkout": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparseCheckout" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparseCheckout", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -7990,11 +8598,13 @@ "properties": { "job_cluster_key": { "description": "A unique name for the job cluster. This field is required and must be unique within the job.\n`JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "new_cluster": { "description": "If new_cluster, a description of a cluster that is created for each task.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec", + "x-databricks-launch-stage": "GA" }, "serverless_compute_id": { "description": "[Private Preview] The ID of the serverless compute object to bind this cluster to. At most one\nJobCluster per job may set this field; the rate limit defined on the referenced\nserverless compute applies across all tasks bound to this cluster.", @@ -8021,11 +8631,13 @@ "properties": { "kind": { "description": "The kind of deployment that manages the job.\n\n* `BUNDLE`: The job is managed by Databricks Asset Bundle.\n* `SYSTEM_MANAGED`: The job is managed by Databricks and is read-only.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobDeploymentKind" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobDeploymentKind", + "x-databricks-launch-stage": "GA" }, "metadata_file_path": { "description": "Path of the file that contains deployment metadata.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8087,28 +8699,34 @@ "no_alert_for_skipped_runs": { "description": "If true, do not send email to recipients specified in `on_failure` if the run is skipped.\nThis field is `deprecated`. Please use the `notification_settings.no_alert_for_skipped_runs` field.", "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "on_duration_warning_threshold_exceeded": { "description": "A list of email addresses to be notified when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is specified in the `health` field for the job, notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_failure": { "description": "A list of email addresses to be notified when a run unsuccessfully completes. A run is considered to have completed unsuccessfully if it ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or `TIMED_OUT` result_state. If this is not specified on job creation, reset, or update the list is empty, and notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_start": { "description": "A list of email addresses to be notified when a run begins. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_streaming_backlog_exceeded": { "description": "[Public Preview] A list of email addresses to notify when any streaming backlog thresholds are exceeded for any stream.\nStreaming backlog thresholds can be set in the `health` field using the following metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`.\nAlerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "on_success": { "description": "A list of email addresses to be notified when a run successfully completes. A run is considered to have completed successfully if it ends with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -8126,11 +8744,13 @@ "properties": { "environment_key": { "description": "The key of an environment. It has to be unique within a job.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "spec": { "description": "The environment entity used to preserve serverless environment side panel, jobs' environment for non-notebook task, and SDP's environment for classic and serverless pipelines.\nIn this minimal environment spec, only pip and java dependencies are supported.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Environment" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.Environment", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8151,11 +8771,13 @@ "properties": { "no_alert_for_canceled_runs": { "description": "If true, do not send notifications to recipients specified in `on_failure` if the run is canceled.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "no_alert_for_skipped_runs": { "description": "If true, do not send notifications to recipients specified in `on_failure` if the run is skipped.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -8173,11 +8795,13 @@ "properties": { "default": { "description": "Default value of the parameter.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { "description": "The name of the defined parameter. May only contain alphanumeric characters, `_`, `-`, and `.`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8224,11 +8848,13 @@ }, "service_principal_name": { "description": "The application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "user_name": { "description": "The email of an active workspace user. Non-admin users can only set this field to their own email.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -8344,15 +8970,18 @@ "properties": { "metric": { "description": "Specifies the health metric that is being evaluated for a particular health rule.\n\n* `RUN_DURATION_SECONDS`: Expected total time for a run in seconds.\n* `STREAMING_BACKLOG_BYTES`: An estimate of the maximum bytes of data waiting to be consumed across all streams. This metric is in Public Preview.\n* `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset lag across all streams. This metric is in Public Preview.\n* `STREAMING_BACKLOG_SECONDS`: An estimate of the maximum consumer delay across all streams. This metric is in Public Preview.\n* `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of outstanding files across all streams. This metric is in Public Preview.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthMetric" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthMetric", + "x-databricks-launch-stage": "GA" }, "op": { "description": "Specifies the operator used to compare the health metric value with the specified threshold.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthOperator" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthOperator", + "x-databricks-launch-stage": "GA" }, "value": { "description": "Specifies the threshold value that the health metric should obey to satisfy the health rule.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8375,7 +9004,8 @@ "description": "An optional set of health rules that can be defined for this job.", "properties": { "rules": { - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRule" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRule", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -8461,19 +9091,23 @@ "properties": { "base_parameters": { "description": "Base parameters to be used for each run of this job. If the run is initiated by a call to :method:jobs/run\nNow with parameters specified, the two parameters maps are merged. If the same key is specified in\n`base_parameters` and in `run-now`, the value from `run-now` is used.\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.\n\nIf the notebook takes a parameter that is not specified in the job’s `base_parameters` or the `run-now` override parameters,\nthe default value from the notebook is used.\n\nRetrieve these parameters in a notebook using [dbutils.widgets.get](https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-widgets).\n\nThe JSON representation of this field cannot exceed 1MB.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "notebook_path": { "description": "The path of the notebook to be run in the Databricks workspace or remote repository.\nFor notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash.\nFor notebooks stored in a remote repository, the path must be relative. This field is required.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "source": { "description": "Optional location type of the notebook. When set to `WORKSPACE`, the notebook will be retrieved from the local Databricks workspace. When set to `GIT`, the notebook will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n* `WORKSPACE`: Notebook is located in Databricks workspace.\n* `GIT`: Notebook is located in cloud Git provider.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source", + "x-databricks-launch-stage": "GA" }, "warehouse_id": { "description": "Optional `warehouse_id` to run the notebook on a SQL warehouse. Classic SQL warehouses are NOT supported, please use serverless or pro SQL warehouses.\n\nNote that SQL warehouses only support SQL cells; if the notebook contains non-SQL cells, the run will fail.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8525,11 +9159,13 @@ "properties": { "interval": { "description": "The interval at which the trigger should run.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "unit": { "description": "The unit of time for the interval.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfigurationTimeUnit" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfigurationTimeUnit", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8568,23 +9204,28 @@ "properties": { "full_refresh": { "description": "If true, triggers a full refresh on the spark declarative pipeline.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "full_refresh_selection": { "description": "[Beta] A list of tables to update with fullRefresh.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "refresh_flow_selection": { "description": "[Beta] Flow names to selectively refresh. These are unioned with other selective refresh\noptions (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "refresh_selection": { "description": "[Beta] A list of tables to update without fullRefresh.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "reset_checkpoint_selection": { "description": "[Beta] A list of streaming flows to reset checkpoints without clearing data.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -8602,31 +9243,38 @@ "properties": { "full_refresh": { "description": "If true, triggers a full refresh on the spark declarative pipeline.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "full_refresh_selection": { "description": "[Beta] A list of tables to update with fullRefresh.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "parameters": { "description": "[Beta] Key/value-map of parameters passed to the pipeline execution.\nLimited to 10k characters in total.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "pipeline_id": { "description": "The full name of the pipeline task to execute.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "refresh_flow_selection": { "description": "[Beta] Flow names to selectively refresh. These are unioned with other selective refresh\noptions (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "refresh_selection": { "description": "[Beta] A list of tables to update without fullRefresh.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "reset_checkpoint_selection": { "description": "[Beta] A list of streaming flows to reset checkpoints without clearing data.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false, @@ -8647,23 +9295,28 @@ "properties": { "authentication_method": { "description": "[Public Preview] How the published Power BI model authenticates to Databricks", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.AuthenticationMethod" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.AuthenticationMethod", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "model_name": { "description": "[Public Preview] The name of the Power BI model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "overwrite_existing": { "description": "[Public Preview] Whether to overwrite existing Power BI models", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "storage_mode": { "description": "[Public Preview] The default storage mode of the Power BI model", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.StorageMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.StorageMode", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "workspace_name": { "description": "[Public Preview] The name of the Power BI workspace of the model", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -8681,19 +9334,23 @@ "properties": { "catalog": { "description": "[Public Preview] The catalog name in Databricks", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "name": { "description": "[Public Preview] The table name in Databricks", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "schema": { "description": "[Public Preview] The schema name in Databricks", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "storage_mode": { "description": "[Public Preview] The Power BI storage mode of the table", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.StorageMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.StorageMode", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -8711,23 +9368,28 @@ "properties": { "connection_resource_name": { "description": "[Public Preview] The resource name of the UC connection to authenticate from Databricks to Power BI", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "power_bi_model": { "description": "[Public Preview] The semantic model to update", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PowerBiModel" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PowerBiModel", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "refresh_after_update": { "description": "[Public Preview] Whether the model should be refreshed after the update", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "tables": { "description": "[Public Preview] The tables to be exported to Power BI", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.PowerBiTable" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.PowerBiTable", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "warehouse_id": { "description": "[Public Preview] The SQL warehouse ID to use as the Power BI data source", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -8797,19 +9459,23 @@ "properties": { "entry_point": { "description": "Named entry point to use, if it does not exist in the metadata of the package it executes the function from the package directly using `$packageName.$entryPoint()`", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "named_parameters": { "description": "Command-line parameters passed to Python wheel task in the form of `[\"--name=task\", \"--data=dbfs:/path/to/data.json\"]`. Leave it empty if `parameters` is not null.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "package_name": { "description": "Name of the package to execute", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "parameters": { "description": "Command-line parameters passed to Python wheel task. Leave it empty if `named_parameters` is not null.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8831,7 +9497,8 @@ "properties": { "enabled": { "description": "If true, enable queueing for the job. This is a required field.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -8896,11 +9563,13 @@ }, "job_id": { "description": "ID of the job to trigger.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "job_parameters": { "description": "Job-level parameters used to trigger the job.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "notebook_params": { "description": "[Private Preview] A map from keys to values for jobs with notebook task, for example `\"notebook_params\": {\"name\": \"john doe\", \"age\": \"35\"}`.\nThe map is passed to the notebook and is accessible through the [dbutils.widgets.get](https://docs.databricks.com/dev-tools/databricks-utils.html) function.\n\nIf not specified upon `run-now`, the triggered run uses the job’s base parameters.\n\nnotebook_params cannot be specified in conjunction with jar_params.\n\n⚠ **Deprecation note** Use [job parameters](https://docs.databricks.com/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks.\n\nThe JSON representation of this field (for example `{\"notebook_params\":{\"name\":\"john doe\",\"age\":\"35\"}}`) cannot exceed 10,000 bytes.", @@ -8912,7 +9581,8 @@ }, "pipeline_params": { "description": "Controls whether the pipeline should perform a full refresh", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineParams" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineParams", + "x-databricks-launch-stage": "GA" }, "python_named_params": { "description": "[Private Preview]", @@ -8986,20 +9656,24 @@ "jar_uri": { "description": "Deprecated since 04/2016. For classic compute, provide a `jar` through the `libraries` field instead. For serverless compute, provide a `jar` though the `java_dependencies` field inside the `environments` list.\n\nSee the examples of classic and serverless compute usage at the top of the page.", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "main_class_name": { "description": "The full name of the class containing the main method to be executed. This class must be contained in a JAR provided as a library.\n\nThe code must use `SparkContext.getOrCreate` to obtain a Spark context; otherwise, runs of the job fail.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "parameters": { "description": "Parameters passed to the main method.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "run_as_repl": { "description": "Deprecated. A value of `false` is no longer supported.", "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true } @@ -9019,15 +9693,18 @@ "properties": { "parameters": { "description": "Command line parameters passed to the Python file.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "python_file": { "description": "The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the Databricks workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "source": { "description": "Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved from the local\nDatabricks workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`,\nthe Python file will be retrieved from a Git repository defined in `git_source`.\n\n* `WORKSPACE`: The Python file is located in a Databricks workspace or at a cloud filesystem URI.\n* `GIT`: The Python file is located in a remote Git repository.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9048,7 +9725,8 @@ "properties": { "parameters": { "description": "Command-line parameters passed to spark submit.\n\nUse [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9066,7 +9744,8 @@ "properties": { "patterns": { "description": "List of patterns to include for sparse checkout.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9140,27 +9819,33 @@ "properties": { "alert": { "description": "If alert, indicates that this job must refresh a SQL alert.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskAlert" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskAlert", + "x-databricks-launch-stage": "GA" }, "dashboard": { "description": "If dashboard, indicates that this job must refresh a SQL dashboard.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskDashboard" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskDashboard", + "x-databricks-launch-stage": "GA" }, "file": { "description": "If file, indicates that this job runs a SQL file in a remote Git repository.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskFile" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskFile", + "x-databricks-launch-stage": "GA" }, "parameters": { "description": "Parameters to be used for each run of this job. The SQL alert task does not support custom parameters.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "query": { "description": "If query, indicates that this job must execute a SQL query.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskQuery" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskQuery", + "x-databricks-launch-stage": "GA" }, "warehouse_id": { "description": "The canonical identifier of the SQL warehouse. Recommended to use with serverless or pro SQL warehouses. Classic SQL warehouses are only supported for SQL alert, dashboard and query tasks and are limited to scheduled single-task jobs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9181,15 +9866,18 @@ "properties": { "alert_id": { "description": "The canonical identifier of the SQL alert.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "pause_subscriptions": { "description": "If true, the alert notifications are not sent to subscribers.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "subscriptions": { "description": "If specified, alert notifications are sent to subscribers.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskSubscription" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskSubscription", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9210,19 +9898,23 @@ "properties": { "custom_subject": { "description": "Subject of the email sent to subscribers of this task.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "dashboard_id": { "description": "The canonical identifier of the SQL dashboard.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "pause_subscriptions": { "description": "If true, the dashboard snapshot is not taken, and emails are not sent to subscribers.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "subscriptions": { "description": "If specified, dashboard snapshots are sent to subscriptions.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskSubscription" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskSubscription", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9243,11 +9935,13 @@ "properties": { "path": { "description": "Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "source": { "description": "Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\nfrom the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository\ndefined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.\n\n* `WORKSPACE`: SQL file is located in Databricks workspace.\n* `GIT`: SQL file is located in cloud Git provider.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Source", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9268,7 +9962,8 @@ "properties": { "query_id": { "description": "The canonical identifier of the SQL query.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9289,11 +9984,13 @@ "properties": { "destination_id": { "description": "The canonical identifier of the destination to receive email notification. This parameter is mutually exclusive with user_name. You cannot set both destination_id and user_name for subscription notifications.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "user_name": { "description": "The user name to receive the subscription email. This parameter is mutually exclusive with destination_id. You cannot set both destination_id and user_name for subscription notifications.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9332,15 +10029,18 @@ "properties": { "custom_subject": { "description": "Optional: Allows users to specify a custom subject line on the email sent\nto subscribers.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "paused": { "description": "When true, the subscription will not send emails.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "subscribers": { "description": "The list of subscribers to send the snapshot of the dashboard to.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.SubscriptionSubscriber" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.SubscriptionSubscriber", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9358,11 +10058,13 @@ "properties": { "destination_id": { "description": "A snapshot of the dashboard will be sent to the destination when the `destination_id` field is present.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "user_name": { "description": "A snapshot of the dashboard will be sent to the user's email when the `user_name` field is present.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9380,19 +10082,23 @@ "properties": { "condition": { "description": "The table(s) condition based on which to trigger a job run.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Condition" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Condition", + "x-databricks-launch-stage": "GA" }, "min_time_between_triggers_seconds": { "description": "If set, the trigger starts a run only after the specified amount of time has passed since\nthe last time the trigger fired. The minimum allowed value is 60 seconds.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "table_names": { "description": "A list of tables to monitor for changes. The table name must be in the format `catalog_name.schema_name.table_name`.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "wait_after_last_change_seconds": { "description": "If set, the trigger starts a run only after no table updates have occurred for the specified time\nand can be used to wait for a series of table updates before triggering a run. The\nminimum allowed value is 60 seconds.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9413,27 +10119,33 @@ "properties": { "ai_runtime_task": { "description": "[Public Preview] The task runs a multi-gpu compute workload on Databricks AI Runtime. Specify\nthe accelerator type and count, the command to run, and where the workload's\ncode and MLflow output are stored.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.AiRuntimeTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.AiRuntimeTask", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "alert_task": { "description": "[Public Preview] The task evaluates a Databricks alert and sends notifications to subscribers\nwhen the `alert_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.AlertTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.AlertTask", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "clean_rooms_notebook_task": { "description": "The task runs a [clean rooms](https://docs.databricks.com/clean-rooms/index.html) notebook\nwhen the `clean_rooms_notebook_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.CleanRoomsNotebookTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.CleanRoomsNotebookTask", + "x-databricks-launch-stage": "GA" }, "compute": { "description": "[Beta] Task level compute configuration.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Compute" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.Compute", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "condition_task": { "description": "The task evaluates a condition that can be used to control the execution of other tasks when the `condition_task` field is present.\nThe condition task does not require a cluster to execute and does not support retries or notifications.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ConditionTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ConditionTask", + "x-databricks-launch-stage": "GA" }, "dashboard_task": { "description": "The task refreshes a dashboard and sends a snapshot to subscribers.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.DashboardTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.DashboardTask", + "x-databricks-launch-stage": "GA" }, "dbt_cloud_task": { "description": "[Private Preview] Task type for dbt cloud, deprecated in favor of the new name dbt_platform_task", @@ -9451,39 +10163,48 @@ }, "dbt_task": { "description": "The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.DbtTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.DbtTask", + "x-databricks-launch-stage": "GA" }, "depends_on": { "description": "An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete before executing this task. The task will run only if the `run_if` condition is true.\nThe key is `task_key`, and the value is the name assigned to the dependent task.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.TaskDependency" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.TaskDependency", + "x-databricks-launch-stage": "GA" }, "description": { "description": "An optional description for this task.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "disable_auto_optimization": { "description": "An option to disable auto optimization in serverless", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "disabled": { "description": "An optional flag to disable the task. If set to true, the task will not run even if it is part of a job.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "email_notifications": { "description": "An optional set of email addresses that is notified when runs of this task begin or complete as well as when this task is deleted. The default behavior is to not send any emails.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskEmailNotifications" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskEmailNotifications", + "x-databricks-launch-stage": "GA" }, "environment_key": { "description": "The key that references an environment spec in a job. This field is required for Python script, Python wheel and dbt tasks when using serverless compute.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "existing_cluster_id": { "description": "If existing_cluster_id, the ID of an existing cluster that is used for all runs.\nWhen running jobs or tasks on an existing cluster, you may need to manually restart\nthe cluster if it stops responding. We suggest running jobs and tasks on new clusters for\ngreater reliability", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "for_each_task": { "description": "The task executes a nested task for every input provided when the `for_each_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ForEachTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ForEachTask", + "x-databricks-launch-stage": "GA" }, "gen_ai_compute_task": { "description": "[Private Preview] DEPRECATED — use `AiRuntimeTask` for all new BYOT multi-node GPU\nworkloads (see ai_runtime_task.proto). `AiRuntimeTask` is the only\nsupported BYOT task type for new workloads; this proto is retained only\nfor AIR CLI (fka SGCLI) pywheel backwards compatibility and will be\nremoved once the pywheel → databricks-cli migration completes (post-\nPuPr).", @@ -9493,43 +10214,53 @@ }, "health": { "description": "An optional set of health rules that can be defined for this job.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRules" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRules", + "x-databricks-launch-stage": "GA" }, "job_cluster_key": { "description": "If job_cluster_key, this task is executed reusing the cluster specified in `job.settings.job_clusters`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "libraries": { "description": "An optional list of libraries to be installed on the cluster.\nThe default value is an empty list.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.Library" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.Library", + "x-databricks-launch-stage": "GA" }, "max_retries": { "description": "An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the `FAILED` result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means to retry indefinitely and the value `0` means to never retry.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_retry_interval_millis": { "description": "An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "new_cluster": { "description": "If new_cluster, a description of a new cluster that is created for each run.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec", + "x-databricks-launch-stage": "GA" }, "notebook_task": { "description": "The task runs a notebook when the `notebook_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.NotebookTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.NotebookTask", + "x-databricks-launch-stage": "GA" }, "notification_settings": { "description": "Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this task.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskNotificationSettings" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TaskNotificationSettings", + "x-databricks-launch-stage": "GA" }, "pipeline_task": { "description": "The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PipelineTask", + "x-databricks-launch-stage": "GA" }, "power_bi_task": { "description": "[Public Preview] The task triggers a Power BI semantic model update when the `power_bi_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PowerBiTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PowerBiTask", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "python_operator_task": { "description": "[Private Preview] The task runs a Python operator task.", @@ -9539,49 +10270,60 @@ }, "python_wheel_task": { "description": "The task runs a Python wheel when the `python_wheel_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PythonWheelTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PythonWheelTask", + "x-databricks-launch-stage": "GA" }, "retry_on_timeout": { "description": "An optional policy to specify whether to retry a job when it times out. The default behavior\nis to not retry on timeout.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "run_if": { "description": "An optional value specifying the condition determining whether the task is run once its dependencies have been completed.\n\n* `ALL_SUCCESS`: All dependencies have executed and succeeded\n* `AT_LEAST_ONE_SUCCESS`: At least one dependency has succeeded\n* `NONE_FAILED`: None of the dependencies have failed and at least one was executed\n* `ALL_DONE`: All dependencies have been completed\n* `AT_LEAST_ONE_FAILED`: At least one dependency failed\n* `ALL_FAILED`: ALl dependencies have failed", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunIf" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunIf", + "x-databricks-launch-stage": "GA" }, "run_job_task": { "description": "The task triggers another job when the `run_job_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask", + "x-databricks-launch-stage": "GA" }, "spark_jar_task": { "description": "The task runs a JAR when the `spark_jar_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkJarTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkJarTask", + "x-databricks-launch-stage": "GA" }, "spark_python_task": { "description": "The task runs a Python file when the `spark_python_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkPythonTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkPythonTask", + "x-databricks-launch-stage": "GA" }, "spark_submit_task": { "description": "(Legacy) The task runs the spark-submit script when the spark_submit_task field is present. Databricks recommends using the spark_jar_task instead; see [Spark Submit task for jobs](/jobs/spark-submit).", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SparkSubmitTask", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "sql_task": { "description": "The task runs a SQL query or file, or it refreshes a SQL alert or a legacy SQL dashboard when the `sql_task` field is present.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTask" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.SqlTask", + "x-databricks-launch-stage": "GA" }, "task_key": { "description": "A unique name for the task. This field is used to refer to this task from other tasks.\nThis field is required and must be unique within its parent job.\nOn Update or Reset, this field is used to reference the tasks to be updated or reset.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "timeout_seconds": { "description": "An optional timeout applied to each run of this job task. A value of `0` means no timeout.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "webhook_notifications": { "description": "A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.WebhookNotifications" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.WebhookNotifications", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9602,11 +10344,13 @@ "properties": { "outcome": { "description": "Can only be specified on condition task dependencies. The outcome of the dependent task that must be met for this task to run.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "task_key": { "description": "The name of the task this task depends on.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9628,28 +10372,34 @@ "no_alert_for_skipped_runs": { "description": "If true, do not send email to recipients specified in `on_failure` if the run is skipped.\nThis field is `deprecated`. Please use the `notification_settings.no_alert_for_skipped_runs` field.", "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "on_duration_warning_threshold_exceeded": { "description": "A list of email addresses to be notified when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is specified in the `health` field for the job, notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_failure": { "description": "A list of email addresses to be notified when a run unsuccessfully completes. A run is considered to have completed unsuccessfully if it ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or `TIMED_OUT` result_state. If this is not specified on job creation, reset, or update the list is empty, and notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_start": { "description": "A list of email addresses to be notified when a run begins. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_streaming_backlog_exceeded": { "description": "[Public Preview] A list of email addresses to notify when any streaming backlog thresholds are exceeded for any stream.\nStreaming backlog thresholds can be set in the `health` field using the following metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`.\nAlerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "on_success": { "description": "A list of email addresses to be notified when a run successfully completes. A run is considered to have completed successfully if it ends with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9667,15 +10417,18 @@ "properties": { "alert_on_last_attempt": { "description": "If true, do not send notifications to recipients specified in `on_start` for the retried runs and do not send notifications to recipients specified in `on_failure` until the last retry of the run.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "no_alert_for_canceled_runs": { "description": "If true, do not send notifications to recipients specified in `on_failure` if the run is canceled.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "no_alert_for_skipped_runs": { "description": "If true, do not send notifications to recipients specified in `on_failure` if the run is skipped.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9710,11 +10463,13 @@ "properties": { "continuous": { "description": "[Beta] Continuous trigger configuration.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ContinuousTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.ContinuousTriggerConfiguration", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "file_arrival": { "description": "[Beta] File arrival trigger configuration.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.FileArrivalTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.FileArrivalTriggerConfiguration", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "model": { "description": "[Private Preview] Model trigger configuration.", @@ -9724,15 +10479,18 @@ }, "pause_status": { "description": "[Beta] Whether this trigger is paused. Defaults to UNPAUSED when unset; the server always returns an explicit value on read.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "periodic": { "description": "[Beta] Trigger type: exactly one must be set; mutual exclusivity is enforced in the API handler\nPeriodic trigger configuration.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfiguration", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "schedule": { "description": "[Beta] Cron schedule trigger configuration.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.CronTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.CronTriggerConfiguration", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "sql_condition": { "description": "[Private Preview] Optional SQL condition that gates whether this trigger fires.", @@ -9742,7 +10500,8 @@ }, "table_update": { "description": "[Beta] Table update trigger configuration.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -9760,7 +10519,8 @@ "properties": { "file_arrival": { "description": "File arrival trigger settings.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.FileArrivalTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.FileArrivalTriggerConfiguration", + "x-databricks-launch-stage": "GA" }, "model": { "description": "[Private Preview]", @@ -9770,11 +10530,13 @@ }, "pause_status": { "description": "Whether this trigger is paused or not.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus", + "x-databricks-launch-stage": "GA" }, "periodic": { "description": "Periodic trigger settings.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfiguration", + "x-databricks-launch-stage": "GA" }, "sql_condition": { "description": "[Private Preview] SQL condition that must be satisfied for the trigger to fire. Can be used in combination with other trigger types and\nruns *after* other trigger types conditions are evaluated.", @@ -9783,7 +10545,8 @@ "doNotSuggest": true }, "table_update": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9800,7 +10563,8 @@ "type": "object", "properties": { "id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -9821,23 +10585,28 @@ "properties": { "on_duration_warning_threshold_exceeded": { "description": "An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook", + "x-databricks-launch-stage": "GA" }, "on_failure": { "description": "An optional list of system notification IDs to call when the run fails. A maximum of 3 destinations can be specified for the `on_failure` property.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook", + "x-databricks-launch-stage": "GA" }, "on_start": { "description": "An optional list of system notification IDs to call when the run starts. A maximum of 3 destinations can be specified for the `on_start` property.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook", + "x-databricks-launch-stage": "GA" }, "on_streaming_backlog_exceeded": { "description": "[Public Preview] An optional list of system notification IDs to call when any streaming backlog thresholds are exceeded for any stream.\nStreaming backlog thresholds can be set in the `health` field using the following metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`.\nAlerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes.\nA maximum of 3 destinations can be specified for the `on_streaming_backlog_exceeded` property.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "on_success": { "description": "An optional list of system notification IDs to call when the run completes successfully. A maximum of 3 destinations can be specified for the `on_success` property.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/jobs.Webhook", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9873,11 +10642,13 @@ "properties": { "key": { "description": "The tag key.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "The tag value.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -9917,11 +10688,13 @@ "properties": { "key": { "description": "The tag key.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "The tag value.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -10038,11 +10811,13 @@ "properties": { "enabled": { "description": "[Public Preview] (Required, Mutable) Whether to enable auto full refresh or not.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "min_interval_hours": { "description": "[Public Preview] (Optional, Mutable) Specify the minimum interval in hours between the timestamp\nat which a table was last full refreshed and the current timestamp for triggering auto full\nIf unspecified and autoFullRefresh is enabled then by default min_interval_hours is 24 hours.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -10064,7 +10839,8 @@ "properties": { "include_confluence_spaces": { "description": "[Public Preview] (Optional) Spaces to filter Confluence data on", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -10109,7 +10885,8 @@ }, "confluence_options": { "description": "[Public Preview] Confluence specific options for ingestion", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConfluenceConnectorOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConfluenceConnectorOptions", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "gdrive_options": { "description": "[Private Preview]", @@ -10125,11 +10902,13 @@ }, "jira_options": { "description": "[Beta] Jira specific options for ingestion", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.JiraConnectorOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.JiraConnectorOptions", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "kafka_options": { "description": "[Beta]", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.KafkaOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.KafkaOptions", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "linkedin_ads_options": { "description": "[Private Preview] LinkedIn Ads specific options for ingestion.\nsync_start_date and lookback_window_days apply to both the prebuilt analytics\ntables and custom reports. custom_report_options defines a custom (user-defined)\nadAnalytics report and is only valid on a table object.", @@ -10145,7 +10924,8 @@ }, "meta_ads_options": { "description": "[Beta] Meta Marketing (Meta Ads) specific options for ingestion", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.MetaMarketingOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.MetaMarketingOptions", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "outlook_options": { "description": "[Private Preview] Outlook specific options for ingestion", @@ -10179,7 +10959,8 @@ }, "zendesk_support_options": { "description": "[Public Preview] Zendesk Support specific options for ingestion", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ZendeskSupportOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ZendeskSupportOptions", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -10216,10 +10997,12 @@ "type": "object", "properties": { "quartz_cron_schedule": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "timezone_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -10238,15 +11021,18 @@ "properties": { "catalog_name": { "description": "[Public Preview] (Required, Immutable) The name of the catalog for the connector's staging storage location.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "schema_name": { "description": "[Public Preview] (Required, Immutable) The name of the schema for the connector's staging storage location.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "volume_name": { "description": "[Public Preview] (Optional) The Unity Catalog-compatible name for the storage location.\nThis is the volume to use for the data that is extracted by the connector.\nSpark Declarative Pipelines system will automatically create the volume under the catalog and schema.\nFor Combined Cdc Managed Ingestion pipelines default name for the volume would be :\n__databricks_ingestion_gateway_staging_data-$pipelineId", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -10314,15 +11100,18 @@ "properties": { "catalog": { "description": "The UC catalog the event log is published under.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { "description": "The name the event log is published to in UC.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "schema": { "description": "The UC schema the event log is published under.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -10509,7 +11298,8 @@ "properties": { "path": { "description": "The absolute path of the source code.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -10527,11 +11317,13 @@ "properties": { "exclude": { "description": "Paths to exclude.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "include": { "description": "Paths to include.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -10706,15 +11498,18 @@ "properties": { "report": { "description": "[Public Preview] Select a specific source report.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ReportSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ReportSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "schema": { "description": "[Public Preview] Select all tables from a specific source schema.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.SchemaSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.SchemaSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "table": { "description": "[Public Preview] Select a specific source table.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpec" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpec", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -10789,27 +11584,33 @@ "properties": { "connection_name": { "description": "[Public Preview] The Unity Catalog connection that this ingestion pipeline uses to communicate with the source. This is used with\nboth connectors for applications like Salesforce, Workday, and so on, and also database connectors like Oracle,\n(connector_type = QUERY_BASED OR connector_type = CDC).\nIf connection name corresponds to database connectors like Oracle, and connector_type is not provided then\nconnector_type defaults to QUERY_BASED. If connector_type is passed as CDC we use Combined Cdc Managed Ingestion\npipeline.\nUnder certain conditions, this can be replaced with ingestion_gateway_id to change the connector to Cdc Managed\nIngestion Pipeline with Gateway pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "connector_type": { "description": "[Public Preview] (Optional) Connector Type for sources. Ex: CDC, Query Based.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConnectorType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConnectorType", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "data_staging_options": { "description": "[Public Preview] (Optional) Location of staged data storage. This is required for migration from Cdc Managed Ingestion Pipeline\nwith Gateway pipeline to Combined Cdc Managed Ingestion Pipeline.\nIf not specified, the volume for staged data will be created in catalog and schema/target specified in the\ntop level pipeline definition.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.DataStagingOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.DataStagingOptions", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "full_refresh_window": { "description": "[Public Preview] (Optional) A window that specifies a set of time ranges for snapshot queries in CDC.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.OperationTimeWindow" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.OperationTimeWindow", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "ingest_from_uc_foreign_catalog": { "description": "[Public Preview] Immutable. If set to true, the pipeline will ingest tables from the\nUC foreign catalogs directly without the need to specify a UC connection or ingestion gateway.\nThe `source_catalog` fields in objects of IngestionConfig are interpreted as\nthe UC foreign catalogs to ingest from.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "ingestion_gateway_id": { "description": "[Public Preview] Identifier for the gateway that is used by this ingestion pipeline to communicate with the source database.\nThis is used with CDC connectors to databases like SQL Server using a gateway pipeline (connector_type = CDC).\nUnder certain conditions, this can be replaced with connection_name to change the connector to Combined Cdc\nManaged Ingestion Pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "netsuite_jar_path": { "description": "[Private Preview] Netsuite only configuration. When the field is set for a netsuite connector,\nthe jar stored in the field will be validated and added to the classpath of\npipeline's cluster.", @@ -10819,15 +11620,18 @@ }, "objects": { "description": "[Public Preview] Required. Settings specifying tables to replicate and the destination for the replicated tables.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionConfig" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_configurations": { "description": "[Public Preview] Top-level source configurations", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.SourceConfig" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.SourceConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "table_configuration": { "description": "[Public Preview] Configuration settings to control the ingestion of tables. These settings are applied to all tables in the pipeline.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -10846,11 +11650,13 @@ "properties": { "fanout_by": { "description": "[Beta] Column path or SQL expression whose value determines the destination table.\nSupports dotted paths (e.g. \"value.event_name\") and expressions\n(e.g. \"value:event_name::string\").", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "transforms": { "description": "[Beta] Optional transforms applied to each route's DataFrame before writing\nto the destination table.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.Transformer" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.Transformer", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -10869,15 +11675,18 @@ "properties": { "cursor_columns": { "description": "[Public Preview] The names of the monotonically increasing columns in the source table that are used to enable\nthe table to be read and ingested incrementally through structured streaming.\nThe columns are allowed to have repeated values but have to be non-decreasing.\nIf the source data is merged into the destination (e.g., using SCD Type 1 or Type 2), these\ncolumns will implicitly define the `sequence_by` behavior. You can still explicitly set\n`sequence_by` to override this default.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "deletion_condition": { "description": "[Public Preview] Specifies a SQL WHERE condition that specifies that the source row has been deleted.\nThis is sometimes referred to as \"soft-deletes\".\nFor example: \"Operation = 'DELETE'\" or \"is_deleted = true\".\nThis field is orthogonal to `hard_deletion_sync_interval_in_seconds`,\none for soft-deletes and the other for hard-deletes.\nSee also the hard_deletion_sync_min_interval_in_seconds field for\nhandling of \"hard deletes\" where the source rows are physically removed from the table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "hard_deletion_sync_min_interval_in_seconds": { "description": "[Beta] Specifies the minimum interval (in seconds) between snapshots on primary keys\nfor detecting and synchronizing hard deletions—i.e., rows that have been\nphysically removed from the source table.\nThis interval acts as a lower bound. If ingestion runs less frequently than\nthis value, hard deletion synchronization will align with the actual ingestion\nfrequency instead of happening more often.\nIf not set, hard deletion synchronization via snapshots is disabled.\nThis field is mutable and can be updated without triggering a full snapshot.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -11013,7 +11822,8 @@ "properties": { "include_jira_spaces": { "description": "[Beta] (Optional) Projects to filter Jira data on", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -11031,23 +11841,28 @@ "properties": { "as_variant": { "description": "[Beta] Parse the entire value as a single Variant column.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "schema": { "description": "[Beta] Inline schema string for JSON parsing (Spark DDL format).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "schema_evolution_mode": { "description": "[Beta] (Optional) Schema evolution mode for schema inference.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.FileIngestionOptionsSchemaEvolutionMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.FileIngestionOptionsSchemaEvolutionMode", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "schema_file_path": { "description": "[Beta] Path to a schema file (.ddl).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "schema_hints": { "description": "[Beta] (Optional) Schema hints as a comma-separated string of \"column_name type\" pairs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -11071,7 +11886,8 @@ }, "key_transformer": { "description": "[Beta] (Optional) Transformer for the message key.\nIf not specified, the key is left as raw bytes.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Transformer" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Transformer", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "max_offsets_per_trigger": { "description": "[Private Preview] Internal option to control the maximum number of offsets to process per trigger.", @@ -11081,19 +11897,23 @@ }, "starting_offset": { "description": "[Beta] (Optional) Where to begin reading when no checkpoint exists.\nValid values: \"latest\" and \"earliest\". Defaults to \"latest\".", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "topic_pattern": { "description": "[Beta] Java regex pattern to subscribe to matching topics.\nOnly one of topics or topic_pattern must be specified.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "topics": { "description": "[Beta] Topics to subscribe to.\nOnly one of topics or topic_pattern must be specified.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "value_transformer": { "description": "[Beta] (Optional) Transformer for the message value.\nIf not specified, the value is left as raw bytes.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Transformer" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.Transformer", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -11289,30 +12109,35 @@ "action_attribution_windows": { "description": "[Beta] (Optional, DEPRECATED — use custom_report_options.action_attribution_windows) Action attribution\nwindows for insights reporting (e.g. \"28d_click\", \"1d_view\")", "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "action_breakdowns": { "description": "[Beta] (Optional, DEPRECATED — use custom_report_options.action_breakdowns) Action breakdowns", "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "action_report_time": { "description": "[Beta] (Optional, DEPRECATED — use custom_report_options.action_report_time) Timing used to report\naction statistics (impression, conversion, mixed, or lifetime)", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "breakdowns": { "description": "[Beta] (Optional, DEPRECATED — use custom_report_options.breakdowns) Breakdowns to configure", "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "custom_insights_lookback_window": { "description": "[Beta] (Optional) Window in days to revisit data during sync to capture\nupdated conversion data from the API, shared by prebuilt and custom reports.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "custom_report_options": { "description": "[Private Preview] (Optional) Per-table custom report definition. When set, defines the shape of the insights\ncall for this table (level/fields/breakdowns/action_breakdowns/etc.). Supersedes the deprecated\nflat report-shape fields above.", @@ -11323,16 +12148,19 @@ "level": { "description": "[Beta] (Optional, DEPRECATED — use custom_report_options.level) Granularity of data to pull\n(account, ad, adset, campaign)", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "start_date": { "description": "[Beta] (Optional) Start date in yyyy-MM-dd format (e.g. 2025-01-15). Data added\nafter this date will be ingested, shared by prebuilt and custom reports.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "time_increment": { "description": "[Beta] (Optional, DEPRECATED — use custom_report_options.time_increment) Value in string by which to\naggregate statistics (can take all_days, monthly or number of days)", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA", "deprecationMessage": "This field is deprecated", "deprecated": true } @@ -11403,7 +12231,8 @@ "properties": { "path": { "description": "The absolute path of the source code.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -11421,11 +12250,13 @@ "properties": { "alerts": { "description": "A list of alerts that trigger the sending of notifications to the configured\ndestinations. The supported alerts are:\n\n* `on-update-success`: A pipeline update completes successfully.\n* `on-update-failure`: Each time a pipeline update fails.\n* `on-update-fatal-failure`: A pipeline update fails with a non-retryable (fatal) error.\n* `on-flow-failure`: A single data flow fails.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "email_recipients": { "description": "A list of email addresses notified when a configured alert is triggered.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -11444,15 +12275,18 @@ "properties": { "days_of_week": { "description": "[Public Preview] Days of week in which the window is allowed to happen\nIf not specified all days of the week will be used.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.DayOfWeek" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/pipelines.DayOfWeek", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "start_hour": { "description": "[Public Preview] An integer between 0 and 23 denoting the start hour for the window in the 24-hour day.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "time_zone_id": { "description": "[Public Preview] Time zone id of window. See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details.\nIf not specified, UTC will be used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -11598,7 +12432,8 @@ "properties": { "include": { "description": "[Public Preview] The source code to include for pipelines", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -11616,79 +12451,98 @@ "properties": { "apply_policy_default_values": { "description": "Note: This field won't be persisted. Only API users will check this field.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "autoscale": { "description": "Parameters needed in order to automatically scale clusters up and down based on load.\nNote: autoscaling works best with DB runtime versions 3.0 or later.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscale" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscale", + "x-databricks-launch-stage": "GA" }, "aws_attributes": { "description": "Attributes related to clusters running on Amazon Web Services.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes", + "x-databricks-launch-stage": "GA" }, "azure_attributes": { "description": "Attributes related to clusters running on Microsoft Azure.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes", + "x-databricks-launch-stage": "GA" }, "cluster_log_conf": { "description": "The configuration for delivering spark logs to a long-term storage destination.\nOnly dbfs destinations are supported. Only one destination can be specified\nfor one cluster. If the conf is given, the logs will be delivered to the destination every\n`5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while\nthe destination of executor logs is `$destination/$clusterId/executor`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf", + "x-databricks-launch-stage": "GA" }, "custom_tags": { "description": "Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS\ninstances and EBS volumes) with these tags in addition to `default_tags`. Notes:\n\n- Currently, Databricks allows at most 45 custom tags\n\n- Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "driver_instance_pool_id": { "description": "The optional ID of the instance pool for the driver of the cluster belongs.\nThe pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not\nassigned.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "driver_node_type_id": { "description": "The node type of the Spark driver.\nNote that this field is optional; if unset, the driver node type will be set as the same value\nas `node_type_id` defined above.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enable_local_disk_encryption": { "description": "Whether to enable local disk encryption for the cluster.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "gcp_attributes": { "description": "Attributes related to clusters running on Google Cloud Platform.\nIf not specified at cluster creation, a set of default values will be used.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes", + "x-databricks-launch-stage": "GA" }, "init_scripts": { "description": "The configuration for storing init scripts. Any number of destinations can be specified. The scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, init script logs are sent to `\u003cdestination\u003e/\u003ccluster-ID\u003e/init_scripts`.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo", + "x-databricks-launch-stage": "GA" }, "instance_pool_id": { "description": "The optional ID of the instance pool to which the cluster belongs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "label": { "description": "A label for the cluster specification, either `default` to configure the default cluster, or `maintenance` to configure the maintenance cluster. This field is optional. The default value is `default`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "node_type_id": { "description": "This field encodes, through a single value, the resources available to each of\nthe Spark nodes in this cluster. For example, the Spark nodes can be provisioned\nand optimized for memory or compute intensive workloads. A list of available node\ntypes can be retrieved by using the :method:clusters/listNodeTypes API call.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "num_workers": { "description": "Number of worker nodes that this cluster should have. A cluster has one Spark Driver\nand `num_workers` Executors for a total of `num_workers` + 1 Spark nodes.\n\nNote: When reading the properties of a cluster, this field reflects the desired number\nof workers rather than the actual current number of workers. For instance, if a cluster\nis resized from 5 to 10 workers, this field will immediately be updated to reflect\nthe target size of 10 workers, whereas the workers listed in `spark_info` will gradually\nincrease from 5 to 10 as the new nodes are provisioned.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "policy_id": { "description": "The ID of the cluster policy used to create the cluster if applicable.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "spark_conf": { "description": "An object containing a set of optional, user-specified Spark configuration key-value pairs.\nSee :method:clusters/create for more details.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "spark_env_vars": { "description": "An object containing a set of optional, user-specified environment variable key-value pairs.\nPlease note that key-value pair of the form (X,Y) will be exported as is (i.e.,\n`export X='Y'`) while launching the driver and workers.\n\nIn order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending\nthem to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all\ndefault databricks managed environmental variables are included as well.\n\nExample Spark environment variables:\n`{\"SPARK_WORKER_MEMORY\": \"28000m\", \"SPARK_LOCAL_DIRS\": \"/local_disk0\"}` or\n`{\"SPARK_DAEMON_JAVA_OPTS\": \"$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true\"}`", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "ssh_public_keys": { "description": "SSH public key contents that will be added to each Spark node in this cluster. The\ncorresponding private keys can be used to login with the user name `ubuntu` on port `2200`.\nUp to 10 keys can be specified.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -11706,15 +12560,18 @@ "properties": { "max_workers": { "description": "The maximum number of workers to which the cluster can scale up when overloaded. `max_workers` must be strictly greater than `min_workers`.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_workers": { "description": "The minimum number of workers the cluster can scale down to when underutilized.\nIt is also the initial number of workers the cluster will have after creation.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "mode": { "description": "Databricks Enhanced Autoscaling optimizes cluster utilization by automatically\nallocating cluster resources based on workload volume, with minimal impact to\nthe data processing latency of your pipelines. Enhanced Autoscaling is available\nfor `updates` clusters only. The legacy autoscaling feature is used for `maintenance`\nclusters.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscaleMode" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscaleMode", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -11752,11 +12609,13 @@ "properties": { "kind": { "description": "The deployment method that manages the pipeline.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.DeploymentKind" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.DeploymentKind", + "x-databricks-launch-stage": "GA" }, "metadata_file_path": { "description": "The path to the file containing metadata about the deployment.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -11777,11 +12636,13 @@ "properties": { "file": { "description": "The path to a file that defines a pipeline and is stored in the Databricks Repos.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.FileLibrary" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.FileLibrary", + "x-databricks-launch-stage": "GA" }, "glob": { "description": "[Public Preview] The unified field to include source codes.\nEach entry can be a notebook path, a file path, or a folder path that ends `/**`.\nThis field cannot be used together with `notebook` or `file`.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PathPattern" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PathPattern", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "jar": { "description": "[Private Preview] URI of the jar to be installed. Currently only DBFS is supported.", @@ -11797,11 +12658,13 @@ }, "notebook": { "description": "The path to a notebook that defines a pipeline and is stored in the Databricks workspace.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.NotebookLibrary" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.NotebookLibrary", + "x-databricks-launch-stage": "GA" }, "whl": { "description": "URI of the whl to be installed.", "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true } @@ -11838,10 +12701,12 @@ "type": "object", "properties": { "cron": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger", + "x-databricks-launch-stage": "GA" }, "manual": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ManualTrigger" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ManualTrigger", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -11860,11 +12725,13 @@ "properties": { "dependencies": { "description": "[Public Preview] List of pip dependencies, as supported by the version of pip in this environment.\nEach dependency is a pip requirement file line https://pip.pypa.io/en/stable/reference/requirements-file-format/\nAllowed dependency could be \u003crequirement specifier\u003e, \u003carchive url/path\u003e, \u003clocal project path\u003e(WSFS or Volumes in Databricks), \u003cvcs project url\u003e", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "environment_version": { "description": "[Beta] The environment version of the serverless Python environment used to execute\ncustomer Python code. Each environment version includes a specific Python\nversion and a curated set of pre-installed libraries with defined versions,\nproviding a stable and reproducible execution environment.\n\nDatabricks supports a three-year lifecycle for each environment version.\nFor available versions and their included packages, see\nhttps://docs.databricks.com/aws/en/release-notes/serverless/environment-version/\n\nThe value should be a string representing the environment version number, for example: `\"4\"`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" } }, "additionalProperties": false @@ -11883,7 +12750,8 @@ "properties": { "slot_config": { "description": "[Public Preview] Optional. The Postgres slot configuration to use for logical replication", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PostgresSlotConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PostgresSlotConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -11902,11 +12770,13 @@ "properties": { "publication_name": { "description": "[Public Preview] The name of the publication to use for the Postgres source", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "slot_name": { "description": "[Public Preview] The name of the logical replication slot to use for the Postgres source", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -11984,23 +12854,28 @@ "properties": { "destination_catalog": { "description": "[Public Preview] Required. Destination catalog to store table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_schema": { "description": "[Public Preview] Required. Destination schema to store table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_table": { "description": "[Public Preview] Required. Destination table name. The pipeline fails if a table with that name already exists.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_url": { "description": "[Public Preview] Required. Report URL in the source system.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "table_configuration": { "description": "[Public Preview] Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -12059,11 +12934,13 @@ "properties": { "service_principal_name": { "description": "Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "user_name": { "description": "The email of an active workspace user. Users can only set this field to their own email.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -12081,31 +12958,38 @@ "properties": { "connector_options": { "description": "[Public Preview] (Optional) Source Specific Connector Options", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConnectorOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConnectorOptions", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_catalog": { "description": "[Public Preview] Required. Destination catalog to store tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_schema": { "description": "[Public Preview] Required. Destination schema to store tables in. Tables with the same name as the source tables are created in this destination schema. The pipeline fails If a table with the same name already exists.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "fanout_options": { "description": "[Beta] Fanout options for multi-table routing from streaming sources.\nWhen set, records are routed to destination tables based on a\nper-record routing key. The key value becomes the table name:\n{destination_catalog}.{destination_schema}.{key_value}.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinitionFanoutOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinitionFanoutOptions", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "source_catalog": { "description": "[Public Preview] The source catalog name. Might be optional depending on the type of source.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_schema": { "description": "[Public Preview] Schema name in the source database. Currently required; this field will become optional in\nan upcoming release, since some source types (for example streaming / message-bus connectors)\ndo not use it. When that change ships, this field's type in the generated SDKs and CLI will\nchange from required to optional (nullable); clients that assume it is always present should\nhandle its absence.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "table_configuration": { "description": "[Public Preview] Configuration settings to control the ingestion of tables. These settings are applied to all tables in this schema and override the table_configuration defined in the IngestionPipelineDefinition object.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -12205,11 +13089,13 @@ "properties": { "postgres": { "description": "[Public Preview] Postgres-specific catalog-level configuration parameters", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PostgresCatalogConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.PostgresCatalogConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_catalog": { "description": "[Public Preview] Source catalog name", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -12233,7 +13119,8 @@ }, "catalog": { "description": "[Public Preview] Catalog-level source configuration parameters", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.SourceCatalogConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.SourceCatalogConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "google_ads_config": { "description": "[Private Preview]", @@ -12257,35 +13144,43 @@ "properties": { "connector_options": { "description": "[Public Preview] (Optional) Source Specific Connector Options", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConnectorOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.ConnectorOptions", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_catalog": { "description": "[Public Preview] Required. Destination catalog to store table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_schema": { "description": "[Public Preview] Required. Destination schema to store table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "destination_table": { "description": "[Public Preview] Optional. Destination table name. The pipeline fails if a table with that name already exists. If not set, the source table name is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_catalog": { "description": "[Public Preview] Source catalog name. Might be optional depending on the type of source.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_schema": { "description": "[Public Preview] Schema name in the source database. Might be optional depending on the type of source.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_table": { "description": "[Public Preview] Table name in the source database. Currently required; this field will become optional in\nan upcoming release, since some source types (for example streaming / message-bus connectors)\ndo not use it. When that change ships, this field's type in the generated SDKs and CLI will\nchange from required to optional (nullable); clients that assume it is always present should\nhandle its absence.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "table_configuration": { "description": "[Public Preview] Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object and the SchemaSpec.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false, @@ -12308,35 +13203,43 @@ "properties": { "auto_full_refresh_policy": { "description": "[Public Preview] (Optional, Mutable) Policy for auto full refresh, if enabled pipeline will automatically try\nto fix issues by doing a full refresh on the table in the retry run. auto_full_refresh_policy\nin table configuration will override the above level auto_full_refresh_policy.\nFor example,\n{\n\"auto_full_refresh_policy\": {\n\"enabled\": true,\n\"min_interval_hours\": 23,\n}\n}\nIf unspecified, auto full refresh is disabled.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.AutoFullRefreshPolicy" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.AutoFullRefreshPolicy", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "clustering_columns": { "description": "[Beta] List of column names to use for clustering the destination table.\nWhen specified, the destination Delta table will be clustered by these columns.\nThis can improve query performance when filtering on these columns.\nNote: clustering_columns in table specific configuration will override the pipeline definition.\nNote: we can only provide enable_auto_clustering or clustering_columns,\nadded as separate fields as we cannot have repeated field in oneof.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "enable_auto_clustering": { "description": "[Beta] Whether to enable auto clustering on the destination table.\nWhen enabled, Delta will automatically optimize the data layout\nbased on the clustering columns for improved query performance.\nNote: enable_auto_clustering in table specific configuration will override the pipeline definition.\nNote: we can only provide enable_auto_clustering or clustering_columns,\nadded as separate fields as we cannot have repeated field in oneof.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "exclude_columns": { "description": "[Public Preview] A list of column names to be excluded for the ingestion.\nWhen not specified, include_columns fully controls what columns to be ingested.\nWhen specified, all other columns including future ones will be automatically included for ingestion.\nThis field in mutually exclusive with `include_columns`.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "include_columns": { "description": "[Public Preview] A list of column names to be included for the ingestion.\nWhen not specified, all columns except ones in exclude_columns will be included. Future\ncolumns will be automatically included.\nWhen specified, all other future columns will be automatically excluded from ingestion.\nThis field in mutually exclusive with `exclude_columns`.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "primary_keys": { "description": "[Public Preview] The primary key of the table used to apply changes.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "query_based_connector_config": { "description": "[Public Preview] Configurations that are only applicable for query-based ingestion connectors.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "row_filter": { "description": "[Public Preview] (Optional, Immutable) The row filter condition to be applied to the table.\nIt must not contain the WHERE keyword, only the actual filter condition.\nIt must be in DBSQL format.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "salesforce_include_formula_fields": { "description": "[Private Preview] If true, formula fields defined in the table are included in the ingestion. This setting is only valid for the Salesforce connector", @@ -12346,19 +13249,23 @@ }, "scd_type": { "description": "[Public Preview] The SCD type to use to ingest the table.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfigScdType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfigScdType", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "sequence_by": { "description": "[Public Preview] The column names specifying the logical order of events in the source data. Spark Declarative Pipelines uses this sequencing to handle change events that arrive out of order.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "source_metadata_column": { "description": "[Beta] (Optional) Name of the struct column added to each ingested record to hold per row source\nmetadata.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "table_properties": { "description": "[Beta] Table properties to set on the destination table.\nThese are key-value pairs that configure various Delta table behaviors or any user defined properties.\nExample: {\"delta.feature.variantType\": \"supported\", \"delta.enableTypeWidening\": \"true\"}\nNote: table_properties in table specific configuration will override the table_properties of the pipeline definition.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "workday_report_parameters": { "description": "[Private Preview] (Optional) Additional custom parameters for Workday Report", @@ -12575,7 +13482,8 @@ "properties": { "format": { "description": "[Beta] Required: the wire format of the data.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TransformerFormat" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.TransformerFormat", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "input_column": { "description": "[Private Preview] Optional input column to transform. When set, the transformer reads\nfrom this column instead of the default source column.", @@ -12585,7 +13493,8 @@ }, "json_options": { "description": "[Beta]", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.JsonTransformerOptions" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/pipelines.JsonTransformerOptions", + "x-databricks-launch-stage": "PUBLIC_BETA" }, "output_column": { "description": "[Private Preview] Optional output column name. When set, the transformed result is\nwritten to this column instead of replacing the input column.", @@ -12629,7 +13538,8 @@ "properties": { "start_date": { "description": "[Public Preview] (Optional) Start date in YYYY-MM-DD format for the initial sync.\nThis determines the earliest date from which to sync historical data.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -12647,15 +13557,18 @@ "properties": { "enable_readable_secondaries": { "description": "Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where\nsize.max \u003e 1.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "max": { "description": "The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single\ncompute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to\ntrue on the EndpointSpec.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min": { "description": "The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater\nthan or equal to 1.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -12678,7 +13591,8 @@ "properties": { "pg_settings": { "description": "A raw representation of Postgres settings.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -12712,7 +13626,8 @@ "properties": { "budget_policy_id": { "description": "Budget policy to set on the newly created pipeline.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "pipeline_channel": { "description": "[Private Preview] Release channel of the underlying pipeline's runtime.\nSome source table configurations (e.g., read-time CDF) require PREVIEW.\nDefaults to CURRENT if not specified.", @@ -12722,11 +13637,13 @@ }, "storage_catalog": { "description": "UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc).\nThis needs to be a standard catalog where the user has permissions to create Delta tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "storage_schema": { "description": "UC schema for the pipeline to store intermediate files (checkpoints, event logs etc).\nThis needs to be in the standard catalog where the user has permissions to create Delta tables.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -12764,11 +13681,13 @@ "properties": { "key": { "description": "The key of the custom tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "The value of the custom tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -12787,23 +13706,28 @@ "properties": { "autoscaling_limit_max_cu": { "description": "The maximum number of Compute Units. Minimum value is 0.5.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "GA" }, "autoscaling_limit_min_cu": { "description": "The minimum number of Compute Units. Minimum value is 0.5.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "GA" }, "no_suspension": { "description": "When set to true, explicitly disables automatic suspension (never suspend).\nShould be set to true when provided.\nMutually exclusive with `suspend_timeout_duration`. When updating, use `spec.project_default_settings.suspension` in the update_mask.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "pg_settings": { "description": "A raw representation of Postgres settings.", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "suspend_timeout_duration": { "description": "Duration of inactivity after which the compute endpoint is automatically suspended.\nIf specified should be between 60s and 604800s (1 minute to 1 week).\nMutually exclusive with `no_suspension`. When updating, use `spec.project_default_settings.suspension` in the update_mask.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -12822,15 +13746,18 @@ "properties": { "bypassrls": { "description": "Grants the Postgres `BYPASSRLS` attribute, which lets the role bypass every row-level security policy.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "createdb": { "description": "Grants the Postgres `CREATEDB` attribute, which lets the role create databases.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "createrole": { "description": "Grants the Postgres `CREATEROLE` attribute, which lets the role create, alter, and drop other roles.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -12993,15 +13920,18 @@ "properties": { "column_name": { "description": "Name of the source column whose target PostgreSQL type should be overridden.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "pg_type": { "description": "PostgreSQL-specific target type to use for the column.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecPgSpecificType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecPgSpecificType", + "x-databricks-launch-stage": "GA" }, "size": { "description": "Size parameter for the target type, for types that take one (e.g. vector\ndimension, varchar length). Required when the chosen pg_type needs a size.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13023,11 +13953,13 @@ "properties": { "ai21labs_api_key": { "description": "The Databricks secret key reference for an AI21 Labs API key. If you\nprefer to paste your API key directly, see `ai21labs_api_key_plaintext`.\nYou must provide an API key using one of the following fields:\n`ai21labs_api_key` or `ai21labs_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "ai21labs_api_key_plaintext": { "description": "An AI21 Labs API key provided as a plaintext string. If you prefer to\nreference your key using Databricks Secrets, see `ai21labs_api_key`. You\nmust provide an API key using one of the following fields:\n`ai21labs_api_key` or `ai21labs_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13045,23 +13977,28 @@ "properties": { "fallback_config": { "description": "Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served\nentity fails with certain error codes, to increase availability.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.FallbackConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.FallbackConfig", + "x-databricks-launch-stage": "GA" }, "guardrails": { "description": "[Public Preview] Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrails" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrails", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "inference_table_config": { "description": "Configuration for payload logging using inference tables.\nUse these tables to monitor and audit data being sent to and received from model APIs and to improve model quality.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayInferenceTableConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayInferenceTableConfig", + "x-databricks-launch-stage": "GA" }, "rate_limits": { "description": "Configuration for rate limits which can be set to limit endpoint traffic.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimit" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimit", + "x-databricks-launch-stage": "GA" }, "usage_tracking_config": { "description": "Configuration to enable usage tracking using system tables.\nThese tables allow you to monitor operational usage on endpoints and their associated costs.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayUsageTrackingConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayUsageTrackingConfig", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13080,20 +14017,24 @@ "invalid_keywords": { "description": "[Public Preview] List of invalid keywords.\nAI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content.", "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW", "deprecationMessage": "This field is deprecated", "deprecated": true }, "pii": { "description": "[Public Preview] Configuration for guardrail PII filter.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehavior" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehavior", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "safety": { "description": "[Public Preview] Indicates whether the safety filter is enabled.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "valid_topics": { "description": "[Public Preview] The list of allowed topics.\nGiven a chat request, this guardrail flags the request if its topic is not in the allowed topics.", "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW", "deprecationMessage": "This field is deprecated", "deprecated": true } @@ -13113,7 +14054,8 @@ "properties": { "behavior": { "description": "[Public Preview] Configuration for input guardrail filters.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehaviorBehavior" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehaviorBehavior", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -13152,11 +14094,13 @@ "properties": { "input": { "description": "[Public Preview] Configuration for input guardrail filters.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailParameters" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailParameters", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "output": { "description": "[Public Preview] Configuration for output guardrail filters.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailParameters" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailParameters", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -13174,19 +14118,23 @@ "properties": { "catalog_name": { "description": "The name of the catalog in Unity Catalog. Required when enabling inference tables.\nNOTE: On update, you have to disable inference table first in order to change the catalog name.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enabled": { "description": "Indicates whether the inference table is enabled.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "schema_name": { "description": "The name of the schema in Unity Catalog. Required when enabling inference tables.\nNOTE: On update, you have to disable inference table first in order to change the schema name.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "table_name_prefix": { "description": "The prefix of the table in Unity Catalog.\nNOTE: On update, you have to disable inference table first in order to change the prefix name.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13204,23 +14152,28 @@ "properties": { "calls": { "description": "Used to specify how many calls are allowed for a key within the renewal_period.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "key": { "description": "Key field for a rate limit. Currently, 'user', 'user_group, 'service_principal', and 'endpoint' are supported,\nwith 'endpoint' being the default if not specified.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitKey" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitKey", + "x-databricks-launch-stage": "GA" }, "principal": { "description": "Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "renewal_period": { "description": "Renewal period field for a rate limit. Currently, only 'minute' is supported.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitRenewalPeriod" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitRenewalPeriod", + "x-databricks-launch-stage": "GA" }, "tokens": { "description": "Used to specify how many tokens are allowed for a key within the renewal_period.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13281,7 +14234,8 @@ "properties": { "enabled": { "description": "Whether to enable usage tracking.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13299,31 +14253,38 @@ "properties": { "aws_access_key_id": { "description": "The Databricks secret key reference for an AWS access key ID with\npermissions to interact with Bedrock services. If you prefer to paste\nyour API key directly, see `aws_access_key_id_plaintext`. You must provide an API\nkey using one of the following fields: `aws_access_key_id` or\n`aws_access_key_id_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "aws_access_key_id_plaintext": { "description": "An AWS access key ID with permissions to interact with Bedrock services\nprovided as a plaintext string. If you prefer to reference your key using\nDatabricks Secrets, see `aws_access_key_id`. You must provide an API key\nusing one of the following fields: `aws_access_key_id` or\n`aws_access_key_id_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "aws_region": { "description": "The AWS region to use. Bedrock has to be enabled there.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "aws_secret_access_key": { "description": "The Databricks secret key reference for an AWS secret access key paired\nwith the access key ID, with permissions to interact with Bedrock\nservices. If you prefer to paste your API key directly, see\n`aws_secret_access_key_plaintext`. You must provide an API key using one\nof the following fields: `aws_secret_access_key` or\n`aws_secret_access_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "aws_secret_access_key_plaintext": { "description": "An AWS secret access key paired with the access key ID, with permissions\nto interact with Bedrock services provided as a plaintext string. If you\nprefer to reference your key using Databricks Secrets, see\n`aws_secret_access_key`. You must provide an API key using one of the\nfollowing fields: `aws_secret_access_key` or\n`aws_secret_access_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "bedrock_provider": { "description": "The underlying provider in Amazon Bedrock. Supported values (case\ninsensitive) include: Anthropic, Cohere, AI21Labs, Amazon.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfigBedrockProvider" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfigBedrockProvider", + "x-databricks-launch-stage": "GA" }, "instance_profile_arn": { "description": "ARN of the instance profile that the external model will use to access AWS resources.\nYou must authenticate using an instance profile or access keys.\nIf you prefer to authenticate using access keys, see `aws_access_key_id`,\n`aws_access_key_id_plaintext`, `aws_secret_access_key` and `aws_secret_access_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13368,11 +14329,13 @@ "properties": { "anthropic_api_key": { "description": "The Databricks secret key reference for an Anthropic API key. If you\nprefer to paste your API key directly, see `anthropic_api_key_plaintext`.\nYou must provide an API key using one of the following fields:\n`anthropic_api_key` or `anthropic_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "anthropic_api_key_plaintext": { "description": "The Anthropic API key provided as a plaintext string. If you prefer to\nreference your key using Databricks Secrets, see `anthropic_api_key`. You\nmust provide an API key using one of the following fields:\n`anthropic_api_key` or `anthropic_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13390,15 +14353,18 @@ "properties": { "key": { "description": "The name of the API key parameter used for authentication.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "The Databricks secret key reference for an API Key.\nIf you prefer to paste your token directly, see `value_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value_plaintext": { "description": "The API Key provided as a plaintext string. If you prefer to reference your\ntoken using Databricks Secrets, see `value`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13420,19 +14386,23 @@ "properties": { "catalog_name": { "description": "The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if the inference table is already enabled.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "enabled": { "description": "Indicates whether the inference table is enabled.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "schema_name": { "description": "The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if the inference table is already enabled.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "table_name_prefix": { "description": "The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if the inference table is already enabled.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13450,11 +14420,13 @@ "properties": { "token": { "description": "The Databricks secret key reference for a token.\nIf you prefer to paste your token directly, see `token_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "token_plaintext": { "description": "The token provided as a plaintext string. If you prefer to reference your\ntoken using Databricks Secrets, see `token`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13472,15 +14444,18 @@ "properties": { "cohere_api_base": { "description": "This is an optional field to provide a customized base URL for the Cohere\nAPI. If left unspecified, the standard Cohere base URL is used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "cohere_api_key": { "description": "The Databricks secret key reference for a Cohere API key. If you prefer\nto paste your API key directly, see `cohere_api_key_plaintext`. You must\nprovide an API key using one of the following fields: `cohere_api_key` or\n`cohere_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "cohere_api_key_plaintext": { "description": "The Cohere API key provided as a plaintext string. If you prefer to\nreference your key using Databricks Secrets, see `cohere_api_key`. You\nmust provide an API key using one of the following fields:\n`cohere_api_key` or `cohere_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13499,15 +14474,18 @@ "properties": { "api_key_auth": { "description": "This is a field to provide API key authentication for the custom provider API.\nYou can only specify one authentication method.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ApiKeyAuth" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ApiKeyAuth", + "x-databricks-launch-stage": "GA" }, "bearer_token_auth": { "description": "This is a field to provide bearer token authentication for the custom provider API.\nYou can only specify one authentication method.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.BearerTokenAuth" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.BearerTokenAuth", + "x-databricks-launch-stage": "GA" }, "custom_provider_url": { "description": "This is a field to provide the URL of the custom provider API.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13528,15 +14506,18 @@ "properties": { "databricks_api_token": { "description": "The Databricks secret key reference for a Databricks API token that\ncorresponds to a user or service principal with Can Query access to the\nmodel serving endpoint pointed to by this external model. If you prefer\nto paste your API key directly, see `databricks_api_token_plaintext`. You\nmust provide an API key using one of the following fields:\n`databricks_api_token` or `databricks_api_token_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "databricks_api_token_plaintext": { "description": "The Databricks API token that corresponds to a user or service principal\nwith Can Query access to the model serving endpoint pointed to by this\nexternal model provided as a plaintext string. If you prefer to reference\nyour key using Databricks Secrets, see `databricks_api_token`. You must\nprovide an API key using one of the following fields:\n`databricks_api_token` or `databricks_api_token_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "databricks_workspace_url": { "description": "The URL of the Databricks workspace containing the model serving endpoint\npointed to by this external model.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13557,11 +14538,13 @@ "properties": { "on_update_failure": { "description": "A list of email addresses to be notified when an endpoint fails to update its configuration or state.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "on_update_success": { "description": "A list of email addresses to be notified when an endpoint successfully updates its configuration or state.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13580,20 +14563,24 @@ "auto_capture_config": { "description": "Configuration for legacy Inference Tables which automatically log requests and responses to Unity\nCatalog.\nDeprecated: please use AI Gateway inference tables instead. See\nhttps://docs.databricks.com/aws/en/ai-gateway/inference-tables.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AutoCaptureConfigInput", + "x-databricks-launch-stage": "GA", "deprecationMessage": "This field is deprecated", "deprecated": true }, "served_entities": { "description": "The list of served entities under the serving endpoint config.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.ServedEntityInput" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.ServedEntityInput", + "x-databricks-launch-stage": "GA" }, "served_models": { "description": "(Deprecated, use served_entities instead) The list of served models under the serving endpoint config.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInput" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInput", + "x-databricks-launch-stage": "GA" }, "traffic_config": { "description": "The traffic configuration associated with the serving endpoint config.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.TrafficConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.TrafficConfig", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13611,11 +14598,13 @@ "properties": { "key": { "description": "Key field for a serving endpoint tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { "description": "Optional value field for a serving endpoint tag.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13636,51 +14625,63 @@ "properties": { "ai21labs_config": { "description": "AI21Labs Config. Only required if the provider is 'ai21labs'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.Ai21LabsConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.Ai21LabsConfig", + "x-databricks-launch-stage": "GA" }, "amazon_bedrock_config": { "description": "Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfig", + "x-databricks-launch-stage": "GA" }, "anthropic_config": { "description": "Anthropic Config. Only required if the provider is 'anthropic'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AnthropicConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.AnthropicConfig", + "x-databricks-launch-stage": "GA" }, "cohere_config": { "description": "Cohere Config. Only required if the provider is 'cohere'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.CohereConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.CohereConfig", + "x-databricks-launch-stage": "GA" }, "custom_provider_config": { "description": "Custom Provider Config. Only required if the provider is 'custom'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.CustomProviderConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.CustomProviderConfig", + "x-databricks-launch-stage": "GA" }, "databricks_model_serving_config": { "description": "Databricks Model Serving Config. Only required if the provider is 'databricks-model-serving'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.DatabricksModelServingConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.DatabricksModelServingConfig", + "x-databricks-launch-stage": "GA" }, "google_cloud_vertex_ai_config": { "description": "Google Cloud Vertex AI Config. Only required if the provider is 'google-cloud-vertex-ai'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.GoogleCloudVertexAiConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.GoogleCloudVertexAiConfig", + "x-databricks-launch-stage": "GA" }, "name": { "description": "The name of the external model.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_config": { "description": "OpenAI Config. Only required if the provider is 'openai'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.OpenAiConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.OpenAiConfig", + "x-databricks-launch-stage": "GA" }, "palm_config": { "description": "PaLM Config. Only required if the provider is 'palm'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.PaLmConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.PaLmConfig", + "x-databricks-launch-stage": "GA" }, "provider": { "description": "The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', 'palm', and 'custom'.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ExternalModelProvider" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ExternalModelProvider", + "x-databricks-launch-stage": "GA" }, "task": { "description": "The task type of the external model.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13736,7 +14737,8 @@ "properties": { "enabled": { "description": "Whether to enable traffic fallback. When a served entity in the serving endpoint returns specific error\ncodes (e.g. 500), the request will automatically be round-robin attempted with other served entities in the same\nendpoint, following the order of served entity list, until a successful response is returned.\nIf all attempts fail, return the last response with the error code.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13757,19 +14759,23 @@ "properties": { "private_key": { "description": "The Databricks secret key reference for a private key for the service\naccount which has access to the Google Cloud Vertex AI Service. See [Best\npractices for managing service account keys]. If you prefer to paste your\nAPI key directly, see `private_key_plaintext`. You must provide an API\nkey using one of the following fields: `private_key` or\n`private_key_plaintext`\n\n[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "private_key_plaintext": { "description": "The private key for the service account which has access to the Google\nCloud Vertex AI Service provided as a plaintext secret. See [Best\npractices for managing service account keys]. If you prefer to reference\nyour key using Databricks Secrets, see `private_key`. You must provide an\nAPI key using one of the following fields: `private_key` or\n`private_key_plaintext`.\n\n[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "project_id": { "description": "This is the Google Cloud project id that the service account is\nassociated with.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "region": { "description": "This is the region for the Google Cloud Vertex AI Service. See [supported\nregions] for more details. Some models are only available in specific\nregions.\n\n[supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13792,47 +14798,58 @@ "properties": { "microsoft_entra_client_id": { "description": "This field is only required for Azure AD OpenAI and is the Microsoft\nEntra Client ID.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "microsoft_entra_client_secret": { "description": "The Databricks secret key reference for a client secret used for\nMicrosoft Entra ID authentication. If you prefer to paste your client\nsecret directly, see `microsoft_entra_client_secret_plaintext`. You must\nprovide an API key using one of the following fields:\n`microsoft_entra_client_secret` or\n`microsoft_entra_client_secret_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "microsoft_entra_client_secret_plaintext": { "description": "The client secret used for Microsoft Entra ID authentication provided as\na plaintext string. If you prefer to reference your key using Databricks\nSecrets, see `microsoft_entra_client_secret`. You must provide an API key\nusing one of the following fields: `microsoft_entra_client_secret` or\n`microsoft_entra_client_secret_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "microsoft_entra_tenant_id": { "description": "This field is only required for Azure AD OpenAI and is the Microsoft\nEntra Tenant ID.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_api_base": { "description": "This is a field to provide a customized base URl for the OpenAI API. For\nAzure OpenAI, this field is required, and is the base URL for the Azure\nOpenAI API service provided by Azure. For other OpenAI API types, this\nfield is optional, and if left unspecified, the standard OpenAI base URL\nis used.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_api_key": { "description": "The Databricks secret key reference for an OpenAI API key using the\nOpenAI or Azure service. If you prefer to paste your API key directly,\nsee `openai_api_key_plaintext`. You must provide an API key using one of\nthe following fields: `openai_api_key` or `openai_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_api_key_plaintext": { "description": "The OpenAI API key using the OpenAI or Azure service provided as a\nplaintext string. If you prefer to reference your key using Databricks\nSecrets, see `openai_api_key`. You must provide an API key using one of\nthe following fields: `openai_api_key` or `openai_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_api_type": { "description": "This is an optional field to specify the type of OpenAI API to use. For\nAzure OpenAI, this field is required, and adjust this parameter to\nrepresent the preferred security access validation protocol. For access\ntoken validation, use azure. For authentication using Azure Active\nDirectory (Azure AD) use, azuread.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_api_version": { "description": "This is an optional field to specify the OpenAI API version. For Azure\nOpenAI, this field is required, and is the version of the Azure OpenAI\nservice to utilize, specified by a date.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_deployment_name": { "description": "This field is only required for Azure OpenAI and is the name of the\ndeployment resource for the Azure OpenAI service.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "openai_organization": { "description": "This is an optional field to specify the organization in OpenAI or Azure\nOpenAI.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13850,11 +14867,13 @@ "properties": { "palm_api_key": { "description": "The Databricks secret key reference for a PaLM API key. If you prefer to\npaste your API key directly, see `palm_api_key_plaintext`. You must\nprovide an API key using one of the following fields: `palm_api_key` or\n`palm_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "palm_api_key_plaintext": { "description": "The PaLM API key provided as a plaintext string. If you prefer to\nreference your key using Databricks Secrets, see `palm_api_key`. You must\nprovide an API key using one of the following fields: `palm_api_key` or\n`palm_api_key_plaintext`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -13872,15 +14891,18 @@ "properties": { "calls": { "description": "Used to specify how many calls are allowed for a key within the renewal_period.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "GA" }, "key": { "description": "Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitKey" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitKey", + "x-databricks-launch-stage": "GA" }, "renewal_period": { "description": "Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitRenewalPeriod" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.RateLimitRenewalPeriod", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13937,15 +14959,18 @@ "type": "object", "properties": { "served_entity_name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "served_model_name": { "description": "The name of the served model this route configures traffic for.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "traffic_percentage": { "description": "The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -13966,62 +14991,77 @@ "properties": { "burst_scaling_enabled": { "description": "[Public Preview] Whether burst scaling is enabled. When enabled (default), the endpoint can automatically\nscale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint\nmaintains fixed capacity at provisioned_model_units.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "entity_name": { "description": "The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "entity_version": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "environment_vars": { "description": "An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to Databricks secrets: `{\"OPENAI_API_KEY\": \"{{secrets/my_scope/my_key}}\", \"DATABRICKS_TOKEN\": \"{{secrets/my_scope2/my_key2}}\"}`", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "external_model": { "description": "The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with the latter set being used for custom model serving for a Databricks registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ExternalModel" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ExternalModel", + "x-databricks-launch-stage": "GA" }, "instance_profile_arn": { "description": "[Public Preview] ARN of the instance profile that the served entity uses to access AWS resources.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "max_provisioned_concurrency": { "description": "The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "max_provisioned_throughput": { "description": "The maximum tokens per second that the endpoint can scale up to.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_provisioned_concurrency": { "description": "The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_provisioned_throughput": { "description": "The minimum tokens per second that the endpoint can scale down to.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "name": { "description": "The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "provisioned_model_units": { "description": "[Public Preview] The number of model units provisioned.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "scale_to_zero_enabled": { "description": "Whether the compute resources for the served entity should scale down to zero.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "workload_size": { "description": "The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are \"Small\" (4 - 4 provisioned concurrency), \"Medium\" (8 - 16 provisioned concurrency), and \"Large\" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "workload_type": { "description": "The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is \"CPU\". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types](https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types).", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServingModelWorkloadType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServingModelWorkloadType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14039,57 +15079,71 @@ "properties": { "burst_scaling_enabled": { "description": "[Public Preview] Whether burst scaling is enabled. When enabled (default), the endpoint can automatically\nscale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint\nmaintains fixed capacity at provisioned_model_units.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "environment_vars": { "description": "An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to Databricks secrets: `{\"OPENAI_API_KEY\": \"{{secrets/my_scope/my_key}}\", \"DATABRICKS_TOKEN\": \"{{secrets/my_scope2/my_key2}}\"}`", - "$ref": "#/$defs/map/string" + "$ref": "#/$defs/map/string", + "x-databricks-launch-stage": "GA" }, "instance_profile_arn": { "description": "[Public Preview] ARN of the instance profile that the served entity uses to access AWS resources.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "max_provisioned_concurrency": { "description": "The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "max_provisioned_throughput": { "description": "The maximum tokens per second that the endpoint can scale up to.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_provisioned_concurrency": { "description": "The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "min_provisioned_throughput": { "description": "The minimum tokens per second that the endpoint can scale down to.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "model_name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "model_version": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { "description": "The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "provisioned_model_units": { "description": "[Public Preview] The number of model units provisioned.", - "$ref": "#/$defs/int64" + "$ref": "#/$defs/int64", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "scale_to_zero_enabled": { "description": "Whether the compute resources for the served entity should scale down to zero.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "workload_size": { "description": "The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are \"Small\" (4 - 4 provisioned concurrency), \"Medium\" (8 - 16 provisioned concurrency), and \"Large\" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "workload_type": { "description": "The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is \"CPU\". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types](https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types).", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadType", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -14197,19 +15251,23 @@ "properties": { "enabled_telemetry_features": { "description": "[Public Preview] The telemetry signals to enable for this endpoint. If empty or omitted, all signals are\nenabled; otherwise only the listed signals are enabled.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.TelemetryFeature" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.TelemetryFeature", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "inference_table_config": { "description": "[Public Preview] Configuration for inference table payload logging, including sampling.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.TelemetryInferenceTableConfig" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.TelemetryInferenceTableConfig", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "table_names": { "description": "[Public Preview] The Unity Catalog tables to which endpoint telemetry (logs, traces, and metrics) is exported.\nProvide this to create a new telemetry profile for the endpoint from the given tables.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.UnityCatalogTableNames" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/serving.UnityCatalogTableNames", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "telemetry_profile_id": { "description": "[Public Preview] The ID of an existing telemetry profile to apply to this endpoint. Provide this to reuse a\ntelemetry profile that has already been created, instead of specifying table_names.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -14252,7 +15310,8 @@ "properties": { "sampling_fraction": { "description": "[Public Preview] Fraction of requests sampled for payload logging, in the range [0.0, 1.0], where 1.0 logs all requests.", - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -14270,7 +15329,8 @@ "properties": { "routes": { "description": "The list of routes that define traffic to each served entity.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.Route" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/serving.Route", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14288,19 +15348,23 @@ "properties": { "annotations_table": { "description": "[Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives\nexported annotations.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "logs_table": { "description": "[Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives\nexported logs.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "metrics_table": { "description": "[Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives\nexported metrics.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" }, "traces_table": { "description": "[Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives\nexported traces (spans).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "PUBLIC_PREVIEW" } }, "additionalProperties": false @@ -14408,23 +15472,28 @@ "properties": { "comparison_operator": { "description": "Operator used for comparison in alert evaluation.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.ComparisonOperator" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.ComparisonOperator", + "x-databricks-launch-stage": "GA" }, "empty_result_state": { "description": "Alert state if result is empty. Please avoid setting this field to be `UNKNOWN` because `UNKNOWN` state is planned to be deprecated.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertEvaluationState" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertEvaluationState", + "x-databricks-launch-stage": "GA" }, "notification": { "description": "User or Notification Destination to notify when alert is triggered.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Notification" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Notification", + "x-databricks-launch-stage": "GA" }, "source": { "description": "Source column from result to use to evaluate alert", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2OperandColumn" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2OperandColumn", + "x-databricks-launch-stage": "GA" }, "threshold": { "description": "Threshold to user for alert evaluation, can be a column or a value.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Operand" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Operand", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -14446,14 +15515,17 @@ "properties": { "notify_on_ok": { "description": "Whether to notify alert subscribers when alert returns back to normal.", - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "retrigger_seconds": { "description": "Number of seconds an alert waits after being triggered before it is allowed to send another notification.\nIf set to 0 or omitted, the alert will not send any further notifications after the first trigger\nSetting this value to 1 allows the alert to send a notification on every evaluation where the condition is met, effectively making it always retrigger for notification purposes.", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "subscriptions": { - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Subscription" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/sql.AlertV2Subscription", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14470,10 +15542,12 @@ "type": "object", "properties": { "column": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2OperandColumn" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2OperandColumn", + "x-databricks-launch-stage": "GA" }, "value": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2OperandValue" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.AlertV2OperandValue", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14491,13 +15565,16 @@ "properties": { "aggregation": { "description": "If not set, the behavior is equivalent to using `First row` in the UI.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.Aggregation" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.Aggregation", + "x-databricks-launch-stage": "GA" }, "display": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -14517,13 +15594,16 @@ "type": "object", "properties": { "bool_value": { - "$ref": "#/$defs/bool" + "$ref": "#/$defs/bool", + "x-databricks-launch-stage": "GA" }, "double_value": { - "$ref": "#/$defs/float64" + "$ref": "#/$defs/float64", + "x-databricks-launch-stage": "GA" }, "string_value": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14541,11 +15621,13 @@ "properties": { "service_principal_name": { "description": "Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "user_name": { "description": "The email of an active workspace user. Can only set this field to their own email.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14562,10 +15644,12 @@ "type": "object", "properties": { "destination_id": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "user_email": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14583,10 +15667,12 @@ "description": "Configures the channel name and DBSQL version of the warehouse. CHANNEL_NAME_CUSTOM should be chosen only when `dbsql_version` is specified.", "properties": { "dbsql_version": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.ChannelName" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.ChannelName", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14658,15 +15744,18 @@ "properties": { "pause_status": { "description": "Indicate whether this schedule is paused or not.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.SchedulePauseStatus" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/sql.SchedulePauseStatus", + "x-databricks-launch-stage": "GA" }, "quartz_cron_schedule": { "description": "A cron expression using quartz syntax that specifies the schedule for this pipeline.\nShould use the quartz format described here: http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "timezone_id": { "description": "A Java timezone id. The schedule will be resolved using this timezone.\nThis will be combined with the quartz_cron_schedule to determine the schedule.\nSee https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -14687,10 +15776,12 @@ "type": "object", "properties": { "key": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "value": { - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14707,7 +15798,8 @@ "type": "object", "properties": { "custom_tags": { - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/sql.EndpointTagPair" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/sql.EndpointTagPair", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14776,31 +15868,38 @@ "properties": { "columns_to_index": { "description": "[Optional] Alias for columns_to_sync. Select the columns to include in the vector index.\nIf you leave this field blank, all columns from the source table are included.\nThe primary key column and embedding source column or embedding vector column are always included.\nOnly one of columns_to_sync or columns_to_index may be specified.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "columns_to_sync": { "description": "[Optional] Select the columns to sync with the vector index. If you leave this field blank, all columns\nfrom the source table are synced with the index. The primary key column and embedding source column or\nembedding vector column are always synced.", - "$ref": "#/$defs/slice/string" + "$ref": "#/$defs/slice/string", + "x-databricks-launch-stage": "GA" }, "embedding_source_columns": { "description": "The columns that contain the embedding source.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingSourceColumn" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingSourceColumn", + "x-databricks-launch-stage": "GA" }, "embedding_vector_columns": { "description": "The columns that contain the embedding vectors.", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingVectorColumn" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingVectorColumn", + "x-databricks-launch-stage": "GA" }, "embedding_writeback_table": { "description": "[Optional] Name of the Delta table to sync the vector index contents and computed embeddings to.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "pipeline_type": { "description": "Pipeline execution mode.\n- `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started.\n- `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh.", - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.PipelineType" + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/vectorsearch.PipelineType", + "x-databricks-launch-stage": "GA" }, "source_table": { "description": "The name of the source table.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14818,15 +15917,18 @@ "properties": { "embedding_source_columns": { "description": "The columns that contain the embedding source. The format should be array[double].", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingSourceColumn" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingSourceColumn", + "x-databricks-launch-stage": "GA" }, "embedding_vector_columns": { "description": "The columns that contain the embedding vectors. The format should be array[double].", - "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingVectorColumn" + "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/vectorsearch.EmbeddingVectorColumn", + "x-databricks-launch-stage": "GA" }, "schema_json": { "description": "The schema of the index in JSON format.\nSupported types are `integer`, `long`, `float`, `double`, `boolean`, `string`, `date`, `timestamp`.\nSupported types for vector column: `array\u003cfloat\u003e`, `array\u003cdouble\u003e`,`.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14844,15 +15946,18 @@ "properties": { "embedding_model_endpoint_name": { "description": "Name of the embedding model endpoint, used by default for both ingestion and querying.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "model_endpoint_name_for_query": { "description": "Name of the embedding model endpoint which, if specified, is used for querying (not ingestion).", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Name of the column", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14870,11 +15975,13 @@ "properties": { "embedding_dimension": { "description": "Dimension of the embedding vector", - "$ref": "#/$defs/int" + "$ref": "#/$defs/int", + "x-databricks-launch-stage": "GA" }, "name": { "description": "Name of the column", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false @@ -14988,11 +16095,13 @@ "properties": { "dns_name": { "description": "The DNS of the KeyVault", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" }, "resource_id": { "description": "The resource id of the azure KeyVault that user wants to associate the scope with.", - "$ref": "#/$defs/string" + "$ref": "#/$defs/string", + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, From de7834e48c7aab03286ac6a958eaff2c020d10e5 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 13:34:58 +0000 Subject: [PATCH 06/52] beautify comment --- bundle/internal/schema/annotations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/internal/schema/annotations.go b/bundle/internal/schema/annotations.go index 8f5568b8249..548cf5ae95f 100644 --- a/bundle/internal/schema/annotations.go +++ b/bundle/internal/schema/annotations.go @@ -158,7 +158,7 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) { s.DeprecationMessage = a.DeprecationMessage } - // Private-preview fields are also hidden from editor completions. + // Private-preview fields are hidden from completions. if a.LaunchStage == clijson.LaunchStagePrivatePreview { s.DoNotSuggest = true } From bb7421fcd62fbccae59d40fb49cd60f94ee772f0 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 13:35:05 +0000 Subject: [PATCH 07/52] reorder tests --- bundle/internal/schema/annotations_test.go | 53 ++++++++++++---------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/bundle/internal/schema/annotations_test.go b/bundle/internal/schema/annotations_test.go index fde827de5ce..bf63ec2222f 100644 --- a/bundle/internal/schema/annotations_test.go +++ b/bundle/internal/schema/annotations_test.go @@ -151,28 +151,40 @@ func TestStalePlaceholderDoesNotShadowMergedDescription(t *testing.T) { } func TestAssignAnnotationLaunchStage(t *testing.T) { - t.Run("public preview prefixes description, emits stage, stays suggestible", func(t *testing.T) { + t.Run("private preview prefixes description, emits stage, and hides from autocomplete", func(t *testing.T) { s := &jsonschema.Schema{} assignAnnotation(s, annotation.Descriptor{ - Description: "Target QPS for the endpoint.", - LaunchStage: "PUBLIC_PREVIEW", + Description: "Internal field.", + LaunchStage: "PRIVATE_PREVIEW", }) - assert.Equal(t, "[Public Preview] Target QPS for the endpoint.", s.Description) - assert.False(t, s.DoNotSuggest) - assert.Equal(t, "PUBLIC_PREVIEW", s.LaunchStage) + assert.Equal(t, "[Private Preview] Internal field.", s.Description) + assert.True(t, s.DoNotSuggest) + assert.Equal(t, "PRIVATE_PREVIEW", s.LaunchStage) }) - t.Run("public beta prefixes description and emits stage", func(t *testing.T) { + t.Run("public beta prefixes description, emits stage, and stays suggestible", func(t *testing.T) { s := &jsonschema.Schema{} assignAnnotation(s, annotation.Descriptor{ Description: "A field.", LaunchStage: "PUBLIC_BETA", }) assert.Equal(t, "[Beta] A field.", s.Description) + assert.False(t, s.DoNotSuggest) assert.Equal(t, "PUBLIC_BETA", s.LaunchStage) }) - t.Run("GA emits the stage without a description prefix", func(t *testing.T) { + t.Run("public preview prefixes description, emits stage, and stays suggestible", func(t *testing.T) { + s := &jsonschema.Schema{} + assignAnnotation(s, annotation.Descriptor{ + Description: "Target QPS for the endpoint.", + LaunchStage: "PUBLIC_PREVIEW", + }) + assert.Equal(t, "[Public Preview] Target QPS for the endpoint.", s.Description) + assert.False(t, s.DoNotSuggest) + assert.Equal(t, "PUBLIC_PREVIEW", s.LaunchStage) + }) + + t.Run("GA emits the stage without a description prefix and stays suggestible", func(t *testing.T) { s := &jsonschema.Schema{} assignAnnotation(s, annotation.Descriptor{ Description: "A field.", @@ -190,19 +202,6 @@ func TestAssignAnnotationLaunchStage(t *testing.T) { assert.Empty(t, s.LaunchStage) }) - t.Run("private preview also hides from autocomplete", func(t *testing.T) { - s := &jsonschema.Schema{} - // The private-preview stage both prefixes the description and hides the - // field; it is also emitted as x-databricks-launch-stage for pydabs. - assignAnnotation(s, annotation.Descriptor{ - Description: "Internal field.", - LaunchStage: "PRIVATE_PREVIEW", - }) - assert.Equal(t, "[Private Preview] Internal field.", s.Description) - assert.True(t, s.DoNotSuggest) - assert.Equal(t, "PRIVATE_PREVIEW", s.LaunchStage) - }) - t.Run("per-enum-value launch stages do not leak into description", func(t *testing.T) { s := &jsonschema.Schema{} assignAnnotation(s, annotation.Descriptor{ @@ -241,7 +240,8 @@ func TestBuildEnumDescriptions(t *testing.T) { enum := []any{"STORAGE_OPTIMIZED", "STANDARD"} t.Run("combines launch stage and description per value", func(t *testing.T) { - got := buildEnumDescriptions(enum, + got := buildEnumDescriptions( + enum, map[string]clijson.LaunchStage{"STORAGE_OPTIMIZED": "PUBLIC_PREVIEW"}, map[string]string{ "STORAGE_OPTIMIZED": "Storage-optimized endpoint.", @@ -255,7 +255,8 @@ func TestBuildEnumDescriptions(t *testing.T) { }) t.Run("launch stage only emits bracketed label", func(t *testing.T) { - got := buildEnumDescriptions(enum, + got := buildEnumDescriptions( + enum, map[string]clijson.LaunchStage{"STORAGE_OPTIMIZED": "PUBLIC_BETA"}, nil, ) @@ -263,7 +264,8 @@ func TestBuildEnumDescriptions(t *testing.T) { }) t.Run("description only is preserved verbatim", func(t *testing.T) { - got := buildEnumDescriptions(enum, + got := buildEnumDescriptions( + enum, nil, map[string]string{"STORAGE_OPTIMIZED": "Storage-optimized endpoint."}, ) @@ -272,7 +274,8 @@ func TestBuildEnumDescriptions(t *testing.T) { t.Run("returns nil when neither stage nor description has content", func(t *testing.T) { assert.Nil(t, buildEnumDescriptions(enum, nil, nil)) - assert.Nil(t, buildEnumDescriptions(enum, + assert.Nil(t, buildEnumDescriptions( + enum, map[string]clijson.LaunchStage{"STORAGE_OPTIMIZED": "GA"}, nil, )) From 48cc78559626f920ed515c285eedcca2e490c61d Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 14:49:03 +0000 Subject: [PATCH 08/52] Stamp launch stage on resource types, not just fields launchStageOverrides maps whole resource Go-types to a launch stage (the Postgres* resources at Public Beta), but OverrideLaunchStage was only applied to fields, so the type's own (self) schema stayed unstamped. Apply the override to the type descriptor too: the contract carries no type-level stage, so passing GA ("") returns the override when one is set, else "". The self descriptor already flows through assignAnnotation, so the type-level x-databricks-launch-stage now lands in jsonschema.json. This makes launchStageOverrides a per-resource stability registry that tags both the type and its fields. Regenerated jsonschema.json: the 7 Postgres* resource types gain the type-level PUBLIC_BETA marker (and the [Beta] description prefix, matching how their fields already render). pydabs codegen is unaffected. Co-authored-by: Isaac --- bundle/internal/schema/parser.go | 12 +++++++---- bundle/internal/schema/parser_test.go | 16 +++++++++++++++ bundle/schema/jsonschema.json | 29 +++++++++++++++++++-------- 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index 7b29451244d..491231aff33 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -192,17 +192,21 @@ func (p *annotationParser) extractAnnotations(typ reflect.Type) (annotation.File } basePath := getPath(typ) - // The contract carries no schema-level launch stage, so a type is - // never itself marked private-preview — only its fields are (below). - // Enum schemas do carry per-value launch stages and descriptions. + // The contract carries no schema-level launch stage, so a type's stage + // comes only from the override map (launchStageOverrides), which stamps + // whole resources — e.g. Postgres* at Public Beta. Passing "" (GA, the + // least restrictive stage) returns the override when one is set for the + // type, else "". Enum schemas do carry per-value launch stages below. + typeStage := annotation.OverrideLaunchStage(basePath, "") enumLaunchStages, enumErr := notableEnumLaunchStages(ref.EnumLaunchStages) if enumErr != nil { stageErr = errors.Join(stageErr, fmt.Errorf("%s: %w", basePath, enumErr)) } enumDescriptions := nonEmptyEnumDescriptions(ref.EnumDescriptions) - if ref.Description != "" || ref.Enum != nil || enumLaunchStages != nil || enumDescriptions != nil { + if ref.Description != "" || ref.Enum != nil || enumLaunchStages != nil || enumDescriptions != nil || typeStage != "" { annotations.SetSelf(basePath, annotation.Descriptor{ Description: ref.Description, + LaunchStage: typeStage, Enum: enumValues(ref.Enum), EnumLaunchStages: enumLaunchStages, EnumDescriptions: enumDescriptions, diff --git a/bundle/internal/schema/parser_test.go b/bundle/internal/schema/parser_test.go index 1e42591e53c..aeafea785c2 100644 --- a/bundle/internal/schema/parser_test.go +++ b/bundle/internal/schema/parser_test.go @@ -146,6 +146,22 @@ func TestExtractAnnotationsOverridesLaunchStage(t *testing.T) { assert.Equal(t, clijson.LaunchStagePublicBeta, got.LaunchStage) } +// TestExtractAnnotationsStampsTypeLaunchStage asserts a resource type in the +// override map carries the override stage on its own (self) descriptor, so the +// type-level x-databricks-launch-stage is emitted, not just its fields'. The +// contract carries no type-level stage, so the override map is the only source. +func TestExtractAnnotationsStampsTypeLaunchStage(t *testing.T) { + p := newParser(map[string]*clijson.SchemaJSON{ + "postgres.RoleRoleSpec": {Fields: map[string]*clijson.SchemaFieldJSON{}}, + }) + + annotations, err := p.extractAnnotations(reflect.TypeFor[resources.PostgresRole]()) + require.NoError(t, err) + + self := annotations[getPath(reflect.TypeFor[resources.PostgresRole]())].Self + assert.Equal(t, clijson.LaunchStagePublicBeta, self.LaunchStage) +} + func TestNormalizeLaunchStage(t *testing.T) { tests := []struct { input string diff --git a/bundle/schema/jsonschema.json b/bundle/schema/jsonschema.json index 318d9a5d51d..d7c8b988e71 100644 --- a/bundle/schema/jsonschema.json +++ b/bundle/schema/jsonschema.json @@ -2113,6 +2113,7 @@ "oneOf": [ { "type": "object", + "description": "[Beta]", "properties": { "branch_id": { "description": "The ID to use for the branch; becomes the final component of the branch's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `development` becomes `projects/my-app/branches/development`.", @@ -2174,7 +2175,8 @@ "required": [ "branch_id", "parent" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", @@ -2186,7 +2188,7 @@ "oneOf": [ { "type": "object", - "description": "The desired state of the Catalog.", + "description": "[Beta] The desired state of the Catalog.", "properties": { "branch": { "description": "[Beta] The resource path of the branch associated with the catalog.\n\nFormat: projects/{project_id}/branches/{branch_id}.", @@ -2216,7 +2218,8 @@ "required": [ "catalog_id", "postgres_database" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", @@ -2228,6 +2231,7 @@ "oneOf": [ { "type": "object", + "description": "[Beta]", "properties": { "database_id": { "description": "The ID to use for the database; becomes the final component of the database's resource name and the database name in Postgres. Must be 4-63 characters and use only characters available in DNS names, as defined by RFC 1123. If not specified, it is generated automatically.", @@ -2261,7 +2265,8 @@ "database_id", "parent", "role" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", @@ -2273,6 +2278,7 @@ "oneOf": [ { "type": "object", + "description": "[Beta]", "properties": { "autoscaling_limit_max_cu": { "description": "[Beta] The maximum number of Compute Units. The maximum value is 64.\nThe difference between the minimum and maximum Compute Units (max - min) must not exceed 16.", @@ -2336,7 +2342,8 @@ "endpoint_id", "parent", "endpoint_type" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", @@ -2348,6 +2355,7 @@ "oneOf": [ { "type": "object", + "description": "[Beta]", "properties": { "budget_policy_id": { "description": "[Beta] The desired budget policy to associate with the project.\nSee status.budget_policy_id for the policy that is actually applied to the project.", @@ -2410,7 +2418,8 @@ "additionalProperties": false, "required": [ "project_id" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", @@ -2422,6 +2431,7 @@ "oneOf": [ { "type": "object", + "description": "[Beta]", "properties": { "attributes": { "description": "[Beta] The desired API-exposed Postgres role attributes to associate with the role.", @@ -2469,7 +2479,8 @@ "required": [ "role_id", "parent" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", @@ -2481,6 +2492,7 @@ "oneOf": [ { "type": "object", + "description": "[Beta]", "properties": { "accelerated_sync": { "description": "[Private Preview] When true, enables accelerated sync mode for the initial data load.\nThis significantly improves performance for large tables.\nRequires workspace-level enablement through Lakebase Accelerated Sync preview.", @@ -2556,7 +2568,8 @@ "additionalProperties": false, "required": [ "synced_table_id" - ] + ], + "x-databricks-launch-stage": "PUBLIC_BETA" }, { "type": "string", From 130dc9c9d1d41161707eabc4f3b21e24e1ff30f4 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 15:04:11 +0000 Subject: [PATCH 09/52] Filter generated test-case fields by launch-stage maturity Skip optional top-level fields ranked below public preview (public-beta and private-preview), not just private-preview. Mirror the launch-stage rank from internal/clijson/launchstage.go (absent stage = GA) so the comparison uses maturity order rather than a string comparison. Drops jobs.triggers and pipelines.parameters from the generated examples. Co-authored-by: Isaac --- python/codegen/codegen/generated_test_cases.py | 16 +++++++++++++++- python/databricks_tests/core/_generated/jobs.py | 3 --- .../core/_generated/pipelines.py | 2 -- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index c3984879c46..8da404c8f0f 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -34,6 +34,16 @@ (Path(__file__).parent / "test_case.py.tmpl").read_text() ) +# Launch-stage maturity, mirroring internal/clijson/launchstage.go: +# GA < PUBLIC_PREVIEW < PUBLIC_BETA < PRIVATE_PREVIEW; absent stage = GA. +_STAGE_RANK = { + None: 0, + openapi.LaunchStage.GA: 0, + openapi.LaunchStage.PUBLIC_PREVIEW: 1, + openapi.LaunchStage.PUBLIC_BETA: 2, + openapi.LaunchStage.PRIVATE_PREVIEW: 3, +} + # Synthesized value tree. Each node renders both as a dict literal (dict_example) # and as a constructor expression (dataclass_example). @@ -190,7 +200,11 @@ def _synth_object( continue if not _is_composite(prop.ref): continue - if prop.deprecated or prop.stage == openapi.LaunchStage.PRIVATE_PREVIEW: + if ( + prop.deprecated + or _STAGE_RANK[prop.stage] + > _STAGE_RANK[openapi.LaunchStage.PUBLIC_PREVIEW] + ): continue value = _synth_ref(namespace, prop.ref, field_name, schemas, visiting) diff --git a/python/databricks_tests/core/_generated/jobs.py b/python/databricks_tests/core/_generated/jobs.py index 3a9dd6cec6d..878e916cd69 100644 --- a/python/databricks_tests/core/_generated/jobs.py +++ b/python/databricks_tests/core/_generated/jobs.py @@ -26,7 +26,6 @@ from databricks.bundles.jobs._models.performance_target import PerformanceTarget from databricks.bundles.jobs._models.queue_settings import QueueSettings from databricks.bundles.jobs._models.task import Task -from databricks.bundles.jobs._models.trigger_configuration import TriggerConfiguration from databricks.bundles.jobs._models.trigger_settings import TriggerSettings from databricks.bundles.jobs._models.webhook_notifications import WebhookNotifications from databricks_tests.core._resource_test_case import TestCase @@ -57,7 +56,6 @@ def _test_case(): "tags": {"key": "value"}, "tasks": [{"task_key": "task_key"}], "trigger": {}, - "triggers": [{}], "webhook_notifications": {}, }, dataclass_example=Job( @@ -83,7 +81,6 @@ def _test_case(): tags={"key": "value"}, tasks=[Task(task_key="task_key")], trigger=TriggerSettings(), - triggers=[TriggerConfiguration()], webhook_notifications=WebhookNotifications(), ), mutator=job_mutator, diff --git a/python/databricks_tests/core/_generated/pipelines.py b/python/databricks_tests/core/_generated/pipelines.py index a4e65573317..096a05e6012 100644 --- a/python/databricks_tests/core/_generated/pipelines.py +++ b/python/databricks_tests/core/_generated/pipelines.py @@ -37,7 +37,6 @@ def _test_case(): "libraries": [{}], "lifecycle": {}, "notifications": [{}], - "parameters": {"key": "value"}, "permissions": [{"level": "CAN_MANAGE"}], "run_as": {}, "tags": {"key": "value"}, @@ -52,7 +51,6 @@ def _test_case(): libraries=[PipelineLibrary()], lifecycle=Lifecycle(), notifications=[Notifications()], - parameters={"key": "value"}, permissions=[ PipelinePermission(level=PipelinePermissionLevel.CAN_MANAGE) ], From e11e6a4f4c0c8307b9de686e89e957d3f573d1d4 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 08:55:51 +0000 Subject: [PATCH 10/52] convert to table test --- bundle/internal/schema/annotations_test.go | 64 ++++++++-------------- 1 file changed, 22 insertions(+), 42 deletions(-) diff --git a/bundle/internal/schema/annotations_test.go b/bundle/internal/schema/annotations_test.go index bf63ec2222f..3ad9bae6fd6 100644 --- a/bundle/internal/schema/annotations_test.go +++ b/bundle/internal/schema/annotations_test.go @@ -151,49 +151,29 @@ func TestStalePlaceholderDoesNotShadowMergedDescription(t *testing.T) { } func TestAssignAnnotationLaunchStage(t *testing.T) { - t.Run("private preview prefixes description, emits stage, and hides from autocomplete", func(t *testing.T) { - s := &jsonschema.Schema{} - assignAnnotation(s, annotation.Descriptor{ - Description: "Internal field.", - LaunchStage: "PRIVATE_PREVIEW", - }) - assert.Equal(t, "[Private Preview] Internal field.", s.Description) - assert.True(t, s.DoNotSuggest) - assert.Equal(t, "PRIVATE_PREVIEW", s.LaunchStage) - }) - - t.Run("public beta prefixes description, emits stage, and stays suggestible", func(t *testing.T) { - s := &jsonschema.Schema{} - assignAnnotation(s, annotation.Descriptor{ - Description: "A field.", - LaunchStage: "PUBLIC_BETA", - }) - assert.Equal(t, "[Beta] A field.", s.Description) - assert.False(t, s.DoNotSuggest) - assert.Equal(t, "PUBLIC_BETA", s.LaunchStage) - }) - - t.Run("public preview prefixes description, emits stage, and stays suggestible", func(t *testing.T) { - s := &jsonschema.Schema{} - assignAnnotation(s, annotation.Descriptor{ - Description: "Target QPS for the endpoint.", - LaunchStage: "PUBLIC_PREVIEW", - }) - assert.Equal(t, "[Public Preview] Target QPS for the endpoint.", s.Description) - assert.False(t, s.DoNotSuggest) - assert.Equal(t, "PUBLIC_PREVIEW", s.LaunchStage) - }) - - t.Run("GA emits the stage without a description prefix and stays suggestible", func(t *testing.T) { - s := &jsonschema.Schema{} - assignAnnotation(s, annotation.Descriptor{ - Description: "A field.", - LaunchStage: "GA", + // Each stamped stage emits x-databricks-launch-stage and prefixes the + // description with its tag (GA renders no tag); only private preview also + // hides the field from autocomplete. + tests := []struct { + name string + stage clijson.LaunchStage + wantDesc string + wantSuppress bool + }{ + {"private preview", clijson.LaunchStagePrivatePreview, "[Private Preview] A field.", true}, + {"public beta", clijson.LaunchStagePublicBeta, "[Beta] A field.", false}, + {"public preview", clijson.LaunchStagePublicPreview, "[Public Preview] A field.", false}, + {"GA", clijson.LaunchStageGA, "A field.", false}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + s := &jsonschema.Schema{} + assignAnnotation(s, annotation.Descriptor{Description: "A field.", LaunchStage: tc.stage}) + assert.Equal(t, tc.wantDesc, s.Description) + assert.Equal(t, tc.wantSuppress, s.DoNotSuggest) + assert.Equal(t, string(tc.stage), s.LaunchStage) }) - assert.Equal(t, "A field.", s.Description) - assert.False(t, s.DoNotSuggest) - assert.Equal(t, "GA", s.LaunchStage) - }) + } t.Run("unstamped field emits no stage", func(t *testing.T) { s := &jsonschema.Schema{} From 994851a9896249e3544eab43ce7e75971d6673bd Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 09:06:45 +0000 Subject: [PATCH 11/52] shorten comments --- bundle/internal/schema/parser.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index 491231aff33..0457fcb03c3 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -110,10 +110,7 @@ func normalizeLaunchStage(launchStage string) (clijson.LaunchStage, error) { } // parseFieldLaunchStage validates a field's contract launch stage, keeping every -// explicit stage (GA included) so the generated schema records each field's -// stability, not just previews. An empty stage means the contract assigns none; -// it stays empty (unmarked) instead of defaulting to GA, so only fields the -// contract actually stamps carry a stage. +// explicit stage. An empty stage means the contract assigns none; func parseFieldLaunchStage(launchStage string) (clijson.LaunchStage, error) { if launchStage == "" { return "", nil From 69ad76960da1c045fce7a288cb12d879ca9202c5 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 09:48:26 +0000 Subject: [PATCH 12/52] change variable name and simplify comments --- bundle/internal/schema/parser.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index 0457fcb03c3..c0190923b48 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -189,21 +189,17 @@ func (p *annotationParser) extractAnnotations(typ reflect.Type) (annotation.File } basePath := getPath(typ) - // The contract carries no schema-level launch stage, so a type's stage - // comes only from the override map (launchStageOverrides), which stamps - // whole resources — e.g. Postgres* at Public Beta. Passing "" (GA, the - // least restrictive stage) returns the override when one is set for the - // type, else "". Enum schemas do carry per-value launch stages below. - typeStage := annotation.OverrideLaunchStage(basePath, "") + // A type carries no launch stage by default, so we set to GA, unless overridden. + typeLaunchStage := annotation.OverrideLaunchStage(basePath, "") enumLaunchStages, enumErr := notableEnumLaunchStages(ref.EnumLaunchStages) if enumErr != nil { stageErr = errors.Join(stageErr, fmt.Errorf("%s: %w", basePath, enumErr)) } enumDescriptions := nonEmptyEnumDescriptions(ref.EnumDescriptions) - if ref.Description != "" || ref.Enum != nil || enumLaunchStages != nil || enumDescriptions != nil || typeStage != "" { + if ref.Description != "" || ref.Enum != nil || enumLaunchStages != nil || enumDescriptions != nil || typeLaunchStage != "" { annotations.SetSelf(basePath, annotation.Descriptor{ Description: ref.Description, - LaunchStage: typeStage, + LaunchStage: typeLaunchStage, Enum: enumValues(ref.Enum), EnumLaunchStages: enumLaunchStages, EnumDescriptions: enumDescriptions, From 5510c9a67a19306202f1a5d51858619500638e2f Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 10:46:56 +0000 Subject: [PATCH 13/52] inline function --- bundle/internal/schema/parser.go | 21 +++++++++------------ bundle/internal/schema/parser_test.go | 23 ----------------------- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index c0190923b48..20b52298a0e 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -109,15 +109,6 @@ func normalizeLaunchStage(launchStage string) (clijson.LaunchStage, error) { return stage, nil } -// parseFieldLaunchStage validates a field's contract launch stage, keeping every -// explicit stage. An empty stage means the contract assigns none; -func parseFieldLaunchStage(launchStage string) (clijson.LaunchStage, error) { - if launchStage == "" { - return "", nil - } - return clijson.ParseLaunchStage(launchStage) -} - // notableEnumLaunchStages keeps only the enum values whose launch stage is // worth surfacing (i.e. not GA), so the annotation file isn't polluted with a // stage for every value of a GA enum. Returns nil when nothing remains. @@ -208,9 +199,15 @@ func (p *annotationParser) extractAnnotations(typ reflect.Type) (annotation.File for k := range s.Properties { if refProp, ok := ref.Fields[k]; ok { - launchStage, fieldErr := parseFieldLaunchStage(refProp.LaunchStage) - if fieldErr != nil { - stageErr = errors.Join(stageErr, fmt.Errorf("%s.%s: %w", basePath, k, fieldErr)) + // An empty stage means the contract assigns none; keep it + // unmarked rather than letting ParseLaunchStage default it to GA. + var launchStage clijson.LaunchStage + if refProp.LaunchStage != "" { + stage, fieldErr := clijson.ParseLaunchStage(refProp.LaunchStage) + if fieldErr != nil { + stageErr = errors.Join(stageErr, fmt.Errorf("%s.%s: %w", basePath, k, fieldErr)) + } + launchStage = stage } // Apply custom launch stage override (e.g. keep resource in Beta despite API being GA) launchStage = annotation.OverrideLaunchStage(basePath, launchStage) diff --git a/bundle/internal/schema/parser_test.go b/bundle/internal/schema/parser_test.go index aeafea785c2..49f511a46e7 100644 --- a/bundle/internal/schema/parser_test.go +++ b/bundle/internal/schema/parser_test.go @@ -185,29 +185,6 @@ func TestNormalizeLaunchStageUnknown(t *testing.T) { assert.Error(t, err) } -func TestParseFieldLaunchStage(t *testing.T) { - tests := []struct { - input string - want clijson.LaunchStage - }{ - {"", ""}, // unstamped stays unstamped rather than defaulting to GA - {"GA", clijson.LaunchStageGA}, - {"PUBLIC_PREVIEW", clijson.LaunchStagePublicPreview}, - {"PUBLIC_BETA", clijson.LaunchStagePublicBeta}, - {"PRIVATE_PREVIEW", clijson.LaunchStagePrivatePreview}, - } - for _, tc := range tests { - got, err := parseFieldLaunchStage(tc.input) - require.NoError(t, err) - assert.Equal(t, tc.want, got) - } -} - -func TestParseFieldLaunchStageUnknown(t *testing.T) { - _, err := parseFieldLaunchStage("SOMETHING_ELSE") - assert.Error(t, err) -} - func TestNotableEnumLaunchStages(t *testing.T) { t.Run("drops GA, keeps preview values", func(t *testing.T) { got, err := notableEnumLaunchStages(map[string]string{ From 675ed2bc66bd7e594bacdeef4fa2d902017bf4c2 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:19:38 +0000 Subject: [PATCH 14/52] add unit tests for the codegen to assert behaviour --- .../test_generated_test_cases.py | 350 ++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 python/codegen/codegen_tests/test_generated_test_cases.py diff --git a/python/codegen/codegen_tests/test_generated_test_cases.py b/python/codegen/codegen_tests/test_generated_test_cases.py new file mode 100644 index 00000000000..047749b5035 --- /dev/null +++ b/python/codegen/codegen_tests/test_generated_test_cases.py @@ -0,0 +1,350 @@ +"""Tests for generated_test_cases.py, the codegen that builds example resource +values for the generated pydabs test suite. + +For the unfamiliar: the generator reads a resource's JSON schema and synthesizes +one placeholder "value tree", then renders it two ways -- as a Python dict literal +and as a dataclass constructor call. Downstream tests use the pair to check that +converting the dict form yields the dataclass form. These tests cover the pieces +of that pipeline: parsing schema refs, synthesizing the value tree (and the rules +for which fields it includes), the two renderers, collecting the imports the +rendered code needs, and the source of the collector module that gathers it all. +""" + +import codegen.jsonschema as openapi +import pytest +from codegen.generated_test_cases import ( + _collect_imports, + _collector_code, + _Enum, + _is_composite, + _List, + _Map, + _Object, + _ref_name, + _render_dataclass, + _render_dict, + _Scalar, + _synth_object, + _synth_ref, + _synth_scalar, +) +from codegen.generated_wiring import _WiredResource +from codegen.jsonschema import Property, Schema, SchemaType + +# Full $refs as they appear in jsonschema.json; only the last segment is +# significant to the code under test, but keeping the SDK prefix makes the +# fixtures read like the real spec. +_SDK = "#/$defs/github.com/databricks/databricks-sdk-go/service" +_COND_REF = f"{_SDK}/sql.AlertCondition" +_OP_REF = f"{_SDK}/sql.ComparisonOperator" + + +# _ref_name pulls the type name (the last path segment) out of a schema $ref. +def test_ref_name(): + assert _ref_name(_COND_REF) == "sql.AlertCondition" + assert _ref_name("#/$defs/string") == "string" + + +# _is_composite separates refs that need recursive synthesis (list/map/object/enum) +# from plain scalar refs (string, int, ...). +def test_is_composite(): + assert _is_composite("#/$defs/slice/string") + assert _is_composite("#/$defs/map/string") + assert _is_composite(_COND_REF) + assert not _is_composite("#/$defs/string") + assert not _is_composite("#/$defs/int64") + + +# Each primitive type maps to a fixed placeholder value (a string uses the field +# name; numbers/bools use 0 / 0.0 / True). +@pytest.mark.parametrize( + "name,expected", + [ + ("string", _Scalar('"hint"', '"hint"')), + ("integer", _Scalar("0", "0")), + ("int", _Scalar("0", "0")), + ("int64", _Scalar("0", "0")), + ("number", _Scalar("0.0", "0.0")), + ("float64", _Scalar("0.0", "0.0")), + ("boolean", _Scalar("True", "True")), + ("bool", _Scalar("True", "True")), + ], +) +def test_synth_scalar(name, expected): + assert _synth_scalar(name, "hint") == expected + + +# An unrecognized primitive means the schema has a type the generator doesn't +# model, so it fails loudly rather than emitting a bad value. +def test_synth_scalar_unknown_raises(): + with pytest.raises(ValueError, match="Unknown primitive: duration"): + _synth_scalar("duration", "hint") + + +# A scalar ref uses the enclosing field's name as its string placeholder, so the +# generated example reads like "name" rather than a generic token. +def test_synth_ref_scalar_uses_field_name_as_hint(): + assert _synth_ref("jobs", "#/$defs/string", "name", {}, set()) == _Scalar( + '"name"', '"name"' + ) + + +# A list ref becomes a one-element list whose single item is synthesized from the +# element type. +def test_synth_ref_list_recurses_on_element(): + assert _synth_ref("jobs", "#/$defs/slice/string", "tags", {}, set()) == _List( + _Scalar('"tags"', '"tags"') + ) + + +# A map ref becomes one {"key": "value"} entry -- the generator only ever emits +# string-keyed, string-valued maps. +def test_synth_ref_map_is_always_string_keyed(): + assert _synth_ref("jobs", "#/$defs/map/string", "labels", {}, set()) == _Map( + "key", _Scalar('"value"', '"value"') + ) + + +# Any other kind of map is never produced, so hitting one fails loudly. +def test_synth_ref_non_string_map_raises(): + with pytest.raises(ValueError, match="Unsupported map ref"): + _synth_ref("jobs", "#/$defs/map/integer", "labels", {}, set()) + + +# An enum ref becomes an _Enum node carrying the chosen value plus the class name, +# module, and member the generated code will reference. +def test_synth_ref_enum(): + schemas = { + "sql.ComparisonOperator": Schema(type=SchemaType.STRING, enum=["greaterThan"]), + } + + assert _synth_ref("alerts", _OP_REF, "op", schemas, set()) == _Enum( + value="greaterThan", + class_name="ComparisonOperator", + module="databricks.bundles.alerts._models.comparison_operator", + member="GREATER_THAN", + ) + + +# A type that (transitively) requires itself has no finite example, so synthesis +# must detect the cycle and stop instead of recursing forever. +def test_synth_ref_required_cycle_raises(): + schemas = {"sql.AlertCondition": Schema(type=SchemaType.OBJECT)} + + # The referenced object is already on the current path: a required cycle has + # no finite value, so synthesis must fail rather than recurse forever. + with pytest.raises( + ValueError, match=r"Required-field cycle through 'sql.AlertCondition'" + ): + _synth_ref("alerts", _COND_REF, "condition", schemas, {"sql.AlertCondition"}) + + +# Which properties land in a resource's example: the field-selection policy. +def test_synth_object_field_policy(): + # A top-level resource keeps: all required fields (scalar + composite), and + # stable optional composite fields. It drops optional scalars. + schemas = { + "resources.Alert": Schema( + type=SchemaType.OBJECT, + properties={ + "display_name": Property(ref="#/$defs/string"), + "condition": Property(ref=_COND_REF), + "seconds_to_retrigger": Property(ref="#/$defs/int"), + "tags": Property(ref="#/$defs/slice/string"), + }, + required=["display_name", "condition"], + ), + "sql.AlertCondition": Schema( + type=SchemaType.OBJECT, + properties={ + "op": Property(ref="#/$defs/string"), + "threshold": Property(ref="#/$defs/slice/string"), + }, + required=["op"], + ), + } + + example = _synth_object( + "alerts", + "resources.Alert", + schemas["resources.Alert"], + schemas, + set(), + top_level=True, + ) + + assert example == _Object( + class_name="Alert", + module="databricks.bundles.alerts._models.alert", + fields=[ + ("display_name", _Scalar('"display_name"', '"display_name"')), + # Nested object contributes only its required field (op); the nested + # optional composite (threshold) is dropped because top_level is False. + ( + "condition", + _Object( + class_name="AlertCondition", + module="databricks.bundles.alerts._models.alert_condition", + fields=[("op", _Scalar('"op"', '"op"'))], + ), + ), + # seconds_to_retrigger (optional scalar) is dropped. + ("tags", _List(_Scalar('"tags"', '"tags"'))), + ], + ) + + +# An optional field is only included if it is "stable": deprecated fields and +# ones still in beta / private preview are left out (absent stage counts as GA). +@pytest.mark.parametrize( + "deprecated,stage,kept", + [ + (None, None, True), + (None, openapi.LaunchStage.PUBLIC_PREVIEW, True), + (True, None, False), + (None, openapi.LaunchStage.PUBLIC_BETA, False), + (None, openapi.LaunchStage.PRIVATE_PREVIEW, False), + ], +) +def test_synth_object_optional_composite_stability(deprecated, stage, kept): + schemas = { + "resources.Alert": Schema( + type=SchemaType.OBJECT, + properties={ + "tags": Property( + ref="#/$defs/slice/string", deprecated=deprecated, stage=stage + ), + }, + required=[], + ), + } + + example = _synth_object( + "alerts", + "resources.Alert", + schemas["resources.Alert"], + schemas, + set(), + top_level=True, + ) + + assert bool(example.fields) == kept + + +# Inside a nested object (anything that isn't the resource itself) only required +# fields are kept, which keeps examples bounded. +def test_synth_object_nested_drops_all_optional(): + schemas = { + "sql.AlertCondition": Schema( + type=SchemaType.OBJECT, + properties={ + "op": Property(ref="#/$defs/string"), + "operand": Property(ref="#/$defs/slice/string"), + }, + required=["op"], + ), + } + + example = _synth_object( + "alerts", + "sql.AlertCondition", + schemas["sql.AlertCondition"], + schemas, + set(), + top_level=False, + ) + + assert [name for name, _ in example.fields] == ["op"] + + +# --- rendering ------------------------------------------------------------- + +_VALUE_TREE = _Object( + class_name="Alert", + module="databricks.bundles.alerts._models.alert", + fields=[ + ("display_name", _Scalar('"display_name"', '"display_name"')), + ( + "op", + _Enum( + value="greaterThan", + class_name="ComparisonOperator", + module="databricks.bundles.alerts._models.comparison_operator", + member="GREATER_THAN", + ), + ), + ("tags", _List(_Scalar('"tags"', '"tags"'))), + ("labels", _Map("key", _Scalar('"value"', '"value"'))), + ], +) + + +# Rendering a value tree as a Python dict-literal string (the "dict_example" form). +def test_render_dict(): + assert _render_dict(_VALUE_TREE) == ( + '{"display_name": "display_name", "op": "greaterThan", ' + '"tags": ["tags"], "labels": {"key": "value"}}' + ) + + +# Rendering the same tree as a dataclass-constructor string (the "dataclass_example" +# form); the two renderers must agree on structure but differ on enums. +def test_render_dataclass(): + # Enums render as a class member reference, unlike the dict form's raw string. + assert _render_dataclass(_VALUE_TREE) == ( + 'Alert(display_name="display_name", op=ComparisonOperator.GREATER_THAN, ' + 'tags=["tags"], labels={"key": "value"})' + ) + + +# The dataclass example references object and enum classes; this collects the +# (module, class) imports it needs, reaching into lists and maps to find them. +def test_collect_imports_gathers_objects_and_enums_through_containers(): + out: set[tuple[str, str]] = set() + _collect_imports(_VALUE_TREE, out) + + assert out == { + ("databricks.bundles.alerts._models.alert", "Alert"), + ("databricks.bundles.alerts._models.comparison_operator", "ComparisonOperator"), + } + + +# A tree of only primitives references no classes, so it needs no imports. +def test_collect_imports_scalar_only_tree_is_empty(): + out: set[tuple[str, str]] = set() + _collect_imports(_Scalar('"x"', '"x"'), out) + + assert out == set() + + +# Source of the _generated/__init__.py that imports each resource's module and +# gathers their test cases into a single `test_cases` list. +def test_collector_code(): + resources = [ + _WiredResource( + class_name="Alert", + singular_name="alert", + plural_name="alerts", + model_module="databricks.bundles.alerts._models.alert", + ), + _WiredResource( + class_name="Job", + singular_name="job", + plural_name="jobs", + model_module="databricks.bundles.jobs._models.job", + ), + ] + + assert _collector_code(resources) == ( + "from databricks_tests.core._generated import (\n" + " alerts,\n" + " jobs,\n" + ")\n" + "\n" + '__all__ = ["test_cases"]\n' + "\n" + "test_cases = [\n" + " alerts._test_case(),\n" + " jobs._test_case(),\n" + "]\n" + ) From a21e45d535c6eb3f2797404c79e8a3abc3695494 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:54:18 +0000 Subject: [PATCH 15/52] Add pydabs-acceptance-test skill for authoring resource acceptance tests An AI Agent Skill that guides an agent to author the acceptance test for a newly-onboarded PyDABs resource: the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt). Includes fill-in templates (.tmpl so they stay out of linters). Complements the schema-synthesized unit-test generation; realistic field values are adapted from the resource's invariant config. Co-authored-by: Isaac --- .../skills/pydabs-acceptance-test/SKILL.md | 137 ++++++++++++++++++ .../templates/databricks.yml.tmpl | 15 ++ .../templates/mutators.py.tmpl | 11 ++ .../templates/resources.py.tmpl | 14 ++ .../templates/script.tmpl | 5 + .../templates/test.toml.tmpl | 7 + 6 files changed, 189 insertions(+) create mode 100644 .agents/skills/pydabs-acceptance-test/SKILL.md create mode 100644 .agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/script.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl diff --git a/.agents/skills/pydabs-acceptance-test/SKILL.md b/.agents/skills/pydabs-acceptance-test/SKILL.md new file mode 100644 index 00000000000..466177d0856 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/SKILL.md @@ -0,0 +1,137 @@ +--- +name: pydabs-acceptance-test +description: "Author the acceptance test for a PyDABs (Python DABs) resource. Use when onboarding a new PyDABs resource, when the test_python_support_coverage guard fails for a resource, or when the user says 'add a pydabs acceptance test', 'write the acceptance test for ', or 'the -support test is missing'. Produces the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt)." +user-invocable: true +allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion +--- + +# Author a PyDABs resource acceptance test + +PyDABs acceptance tests are hand-written, one fixture per resource under +`acceptance/bundle/python/-support/`. The OpenAPI spec has no examples, so +the realistic field values come from the resource's invariant config and your own +judgement — not from a generator. This skill guides you through authoring that +fixture deterministically and verifying it. + +The coverage guard `test_python_support_coverage` +(`python/databricks_tests/core/test_python_support.py`) fails CI for any PyDABs +resource that lacks a `-support` fixture, so every newly-onboarded resource +must get one. This skill is how you close that gap. + +Worked reference: `acceptance/bundle/python/alerts-support/` (a resource with required +nested fields) and `acceptance/bundle/python/catalogs-support/` (a direct-engine-only +resource). Read both before starting — the fixture you write mirrors them. + +## Input + +The resource to cover, as its **plural** name (the `resources:` key in +`databricks.yml`, e.g. `alerts`, `volumes`). If given a singular or a Go/Python +type name, resolve it to the plural first (step 1). + +## Step 1 — Verify the resource is wired in PyDABs + +The fixture cannot work unless the resource's Python surface exists. Confirm all of: + +- The package `python/databricks/bundles//` exists and has a `_models/` + subdirectory (this is what marks it a generated resource package). +- `add_` is a method on `Resources` and `_mutator` is exported + from `databricks.bundles.core`: + + ```sh + grep -rn "def add_\|_mutator" python/databricks/bundles/core/ + ``` + +If any is missing, the resource is not wired yet — stop and onboard it in PyDABs +first (that is a separate task). Note the exact `` and `` names +(the dataclass, e.g. `Alert`) from `python/databricks/bundles//__init__.py`; +you need them for `resources.py` and `mutators.py`. + +## Step 2 — Find the resource's required fields + +The generated dataclass is the source of truth. In +`python/databricks/bundles//_models/.py`, required fields are typed +`VariableOr[...]` (no default); optional fields are `VariableOrOptional[...] = None`. +You must set every required field, including required fields of required nested +objects (recurse into their `_models` files). Optional fields are usually omitted. + +```sh +grep -nE "VariableOr\[|VariableOrOptional\[" python/databricks/bundles//_models/.py +``` + +## Step 3 — Get realistic values (adapt, don't copy) + +The invariant config `acceptance/bundle/invariant/configs/.yml.tmpl` shows +realistic values for the same resource. **Adapt** it — do not copy verbatim: + +- Replace `$UNIQUE_NAME`, `$TEST_DEFAULT_WAREHOUSE_ID`, and every other `$VAR` + interpolation with plain string literals. This test runs locally with no cloud and + no variable substitution. +- Drop cloud-only / IAM blocks the invariant config carries for its real-workspace + run: `permissions`, `grants`, `file_path` pointing at an external asset, etc. Keep + the fixture to the resource's own fields so `bundle validate` is deterministic. + +If no invariant config exists, invent plausible literals that satisfy the field types +(a display name string, an enum's first member, a cron string, etc.). + +## Step 4 — Write the six fixture files + +Copy each `templates/*.tmpl` into `acceptance/bundle/python/-support/`, +dropping the `.tmpl` suffix (e.g. `resources.py.tmpl` → `resources.py`), and fill +them in. The `.tmpl` suffix keeps the placeholder files out of the repo's linters; +the copied fixture files are real Python/YAML/TOML and must pass lint (step 7). +Placeholders: `PLURAL`, `SINGULAR`, `CLASS`, `NAME` (a short stem, e.g. `alert`), +`FIELD` (a required **string** field to mutate). + +1. **`databricks.yml`** — `bundle.name: my_project`, `sync: {paths: []}`, a top-level + `python:` block wiring `resources:load_resources` and `mutators:update_`, + and one YAML-declared resource `resources..my__1` with all required + fields. (`bundle validate` normalizes the `python:` key to `experimental.python` + in the output — that is expected, don't fight it.) +2. **`resources.py`** — `load_resources()` adds a second instance `my__2` via + `resources.add_(...)`, same required fields, slightly different values. +3. **`mutators.py`** — a `@_mutator` that `assert isinstance(...)` on a + required string field and `replace(...)`s it to append `" (updated)"`. The mutator + runs on **both** instances, so the golden shows the transform applied to each. +4. **`script`** — copy `templates/script` verbatim (`bundle validate --output json` + piped through `jq "pick(.experimental.python, .resources)"`). +5. **`test.toml`** — `Cloud = false`. Add `EnvMatrix.PYDAB_VERSION = ["current"]` for + a brand-new resource (it only exists in the current wheel, not the pinned older + one). Add `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]` only for a direct-only + resource — terraform is deprecated, so never add a `["terraform", "direct"]` + matrix. When unsure, copy the engine convention from the newest existing fixture + (`catalogs-support`), not an old one. +6. **`output.txt`** — do NOT hand-write; generate it in step 5. + +## Step 5 — Generate the golden output + +```sh +go test ./acceptance -run 'TestAccept/bundle/python/-support' -update +``` + +(or `./task test-update` to regenerate the whole suite). This writes `output.txt`. +Inspect it: both `my__1` and `my__2` must appear with the mutated field +showing `" (updated)"`, and only `experimental.python` + `resources` keys are present. + +## Step 6 — Verify it reproduces deterministically + +Re-run **without** `-update`. It must pass against the golden you just generated: + +```sh +go test ./acceptance -run 'TestAccept/bundle/python/-support' -count=1 +``` + +A test that only passes with `-update` is nondeterministic — investigate before +finishing (a `$VAR` left in a value, a non-deterministic field, an EnvMatrix variant +producing different output). Never stop at "golden written". + +## Step 7 — Confirm coverage and format + +```sh +(cd python && uv run --python 3.11 pytest databricks_tests/core/test_python_support.py) +./task fmt && ./task lint-q +``` + +`test_python_support_coverage` should now be green for this resource. If the resource +was previously in the `_LACKING` allowlist +(`python/databricks_tests/core/test_python_support.py`), remove its entry — the list +only shrinks. diff --git a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl new file mode 100644 index 00000000000..18f303dd816 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl @@ -0,0 +1,15 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_SINGULAR" + +resources: + PLURAL: + my_NAME_1: + # required fields, realistic literal values (see SKILL.md steps 2-3) diff --git a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl new file mode 100644 index 00000000000..4a2bfb94d89 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.PLURAL import CLASS +from databricks.bundles.core import SINGULAR_mutator + + +@SINGULAR_mutator +def update_SINGULAR(SINGULAR: CLASS) -> CLASS: + assert isinstance(SINGULAR.FIELD, str) + + return replace(SINGULAR, FIELD=f"{SINGULAR.FIELD} (updated)") diff --git a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl new file mode 100644 index 00000000000..9360bec828a --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl @@ -0,0 +1,14 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_SINGULAR( + "my_NAME_2", + { + # same required fields as _1, slightly different values + }, + ) + + return resources diff --git a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl new file mode 100644 index 00000000000..4935b9b020a --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# new resource, only in the current wheel: +# EnvMatrix.PYDAB_VERSION = ["current"] + +# direct-only resource (terraform is deprecated): +# EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] From 687cece88f817d5ce4f17c853dbfba4aa089f6e0 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:54:19 +0000 Subject: [PATCH 16/52] Assert every PyDABs resource has an acceptance test test_python_support_coverage fails until each resource in the _ResourceType registry has an acceptance/bundle/python/-support/ fixture, so coverage cannot silently regress as resources are onboarded. Mirrors the invariant-config coverage guard; shrink-only _LACKING allowlist ({jobs}, whose coverage predates the convention). Lives in the python test suite (runs in CI via pydabs-test) since it checks the filesystem rather than exercising the CLI. Co-authored-by: Isaac --- .../core/test_python_support.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 python/databricks_tests/core/test_python_support.py diff --git a/python/databricks_tests/core/test_python_support.py b/python/databricks_tests/core/test_python_support.py new file mode 100644 index 00000000000..ef8a113d56b --- /dev/null +++ b/python/databricks_tests/core/test_python_support.py @@ -0,0 +1,36 @@ +"""Coverage guard: every PyDABs resource must have an acceptance fixture. + +Asserts each resource in the _ResourceType registry has an +acceptance/bundle/python/-support/ fixture. New resources get one via the +pydabs-acceptance-test skill; this fails CI until it exists. +""" + +from pathlib import Path + +import pytest + +from databricks.bundles.core._resource_type import _ResourceType + +_ACCEPTANCE_DIR = Path(__file__).parents[3] / "acceptance" / "bundle" / "python" + +# Resources knowingly lacking a -support fixture. Shrink-only: the test fails +# if an entry here is actually covered, so gaps can only close. +_LACKING = { + # jobs predates the -support convention; covered across the suite instead. + "jobs", +} + +_PLURALS = sorted(t.plural_name for t in _ResourceType.all()) + + +@pytest.mark.parametrize("plural", _PLURALS) +def test_python_support_coverage(plural: str): + covered = (_ACCEPTANCE_DIR / f"{plural}-support" / "databricks.yml").exists() + + if plural in _LACKING: + assert not covered, f"{plural!r} now has a fixture; remove it from _LACKING" + else: + assert covered, ( + f"no acceptance/bundle/python/{plural}-support/ fixture for {plural!r}; " + "author one with the pydabs-acceptance-test skill or add it to _LACKING" + ) From b35f2bc99cf82fc334a02876a3507fe952d1e80e Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 12:29:25 +0000 Subject: [PATCH 17/52] Derive PyDABs singular names via snake_case class_name.lower() ran multi-word type names together (e.g. vectorsearchindex). Snake-case the type name instead. No-op for the 6 currently-wired single-word resources. Co-authored-by: Isaac --- python/codegen/codegen/generated_wiring.py | 2 +- python/codegen/codegen/packages.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/codegen/codegen/generated_wiring.py b/python/codegen/codegen/generated_wiring.py index b9ae99015d0..b5caa80c62b 100644 --- a/python/codegen/codegen/generated_wiring.py +++ b/python/codegen/codegen/generated_wiring.py @@ -56,7 +56,7 @@ def _wired_resources() -> list[_WiredResource]: resources.append( _WiredResource( class_name=class_name, - singular_name=class_name.lower(), + singular_name=packages.to_snake_case(class_name), plural_name=namespace, model_module=packages.get_package(namespace, ref), ) diff --git a/python/codegen/codegen/packages.py b/python/codegen/codegen/packages.py index f5c2a53fb39..772ce4b4c5e 100644 --- a/python/codegen/codegen/packages.py +++ b/python/codegen/codegen/packages.py @@ -41,6 +41,11 @@ def get_class_name(ref: str) -> str: return RENAMES.get(name, name) +def to_snake_case(name: str) -> str: + # "VectorSearchIndex" -> "vector_search_index" + return re.sub(r"(? bool: return ref in RESOURCE_TYPES From 177bb2b65404e5e763797d934d19ff687c9eafdf Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 12:31:31 +0000 Subject: [PATCH 18/52] Mark public-beta fields experimental in PyDABs codegen Extend the experimental marker (previously private-preview only) to public-beta fields and enums via is_experimental_stage. Beta and private preview may still change; GA and public preview are frozen. Co-authored-by: Isaac --- python/codegen/codegen/generated_dataclass.py | 12 +++---- python/codegen/codegen/generated_enum.py | 4 +-- python/codegen/codegen/jsonschema.py | 11 ++++--- .../bundles/jobs/_models/ai_runtime_task.py | 4 +++ .../bundles/jobs/_models/cluster_spec.py | 4 +++ .../bundles/jobs/_models/compute.py | 4 +++ .../continuous_trigger_configuration.py | 4 +++ .../_models/cron_trigger_configuration.py | 8 +++++ python/databricks/bundles/jobs/_models/job.py | 4 +++ .../bundles/jobs/_models/pipeline_params.py | 16 ++++++++++ .../bundles/jobs/_models/pipeline_task.py | 20 ++++++++++++ .../databricks/bundles/jobs/_models/task.py | 4 +++ .../jobs/_models/trigger_configuration.py | 24 ++++++++++++++ .../pipelines/_models/connector_options.py | 12 +++++++ ...tion_pipeline_definition_fanout_options.py | 8 +++++ ...fic_config_query_based_connector_config.py | 4 +++ .../_models/jira_connector_options.py | 4 +++ .../_models/json_transformer_options.py | 20 ++++++++++++ .../pipelines/_models/kafka_options.py | 20 ++++++++++++ .../_models/meta_marketing_options.py | 32 +++++++++++++++++++ .../bundles/pipelines/_models/pipeline.py | 4 +++ .../_models/pipelines_environment.py | 4 +++ .../bundles/pipelines/_models/schema_spec.py | 4 +++ .../_models/table_specific_config.py | 16 ++++++++++ .../bundles/pipelines/_models/transformer.py | 8 +++++ 25 files changed, 242 insertions(+), 13 deletions(-) diff --git a/python/codegen/codegen/generated_dataclass.py b/python/codegen/codegen/generated_dataclass.py index eb20dabb6e2..ad4f6133aa5 100644 --- a/python/codegen/codegen/generated_dataclass.py +++ b/python/codegen/codegen/generated_dataclass.py @@ -6,7 +6,7 @@ import codegen.packages as packages from codegen.code_builder import CodeBuilder -from codegen.jsonschema import LaunchStage, Property, Schema +from codegen.jsonschema import Property, Schema, is_experimental_stage from codegen.packages import is_resource @@ -161,7 +161,7 @@ def generate_field( default=None, default_factory="dict", create_func_default="None", - experimental=prop.stage == LaunchStage.PRIVATE_PREVIEW, + experimental=is_experimental_stage(prop.stage), deprecated=prop.deprecated or False, ) elif field_type.name == "VariableOrList": @@ -174,7 +174,7 @@ def generate_field( default=None, default_factory="list", create_func_default="None", - experimental=prop.stage == LaunchStage.PRIVATE_PREVIEW, + experimental=is_experimental_stage(prop.stage), deprecated=prop.deprecated or False, ) elif is_required: @@ -187,7 +187,7 @@ def generate_field( default=None, default_factory=None, create_func_default=None, - experimental=prop.stage == LaunchStage.PRIVATE_PREVIEW, + experimental=is_experimental_stage(prop.stage), deprecated=prop.deprecated or False, ) else: @@ -200,7 +200,7 @@ def generate_field( default="None", default_factory=None, create_func_default="None", - experimental=prop.stage == LaunchStage.PRIVATE_PREVIEW, + experimental=is_experimental_stage(prop.stage), deprecated=prop.deprecated or False, ) @@ -335,7 +335,7 @@ def generate_dataclass( description=schema.description, fields=fields, extends=extends, - experimental=schema.stage == LaunchStage.PRIVATE_PREVIEW, + experimental=is_experimental_stage(schema.stage), deprecated=schema.deprecated or False, ) diff --git a/python/codegen/codegen/generated_enum.py b/python/codegen/codegen/generated_enum.py index 84bb79e957c..7a951e01735 100644 --- a/python/codegen/codegen/generated_enum.py +++ b/python/codegen/codegen/generated_enum.py @@ -5,7 +5,7 @@ import codegen.packages as packages from codegen.code_builder import CodeBuilder from codegen.generated_dataclass import _append_description -from codegen.jsonschema import LaunchStage, Schema +from codegen.jsonschema import Schema, is_experimental_stage @dataclass(kw_only=True) @@ -35,7 +35,7 @@ def generate_enum(namespace: str, schema_name: str, schema: Schema) -> Generated package=package, values=values, description=schema.description, - experimental=schema.stage == LaunchStage.PRIVATE_PREVIEW, + experimental=is_experimental_stage(schema.stage), deprecated=schema.deprecated or False, ) diff --git a/python/codegen/codegen/jsonschema.py b/python/codegen/codegen/jsonschema.py index c780d1dc522..d76976844bd 100644 --- a/python/codegen/codegen/jsonschema.py +++ b/python/codegen/codegen/jsonschema.py @@ -8,17 +8,18 @@ class LaunchStage: - # Mirrors clijson.LaunchStage in the Go code. jsonschema.json only carries - # x-databricks-launch-stage for private-preview fields (the Go schema - # generator emits it only there, to mark them experimental and exclude them - # from the generated documentation), but the full set is mirrored here for - # completeness. + # Mirrors clijson.LaunchStage in the Go code. GA = "GA" PUBLIC_PREVIEW = "PUBLIC_PREVIEW" PUBLIC_BETA = "PUBLIC_BETA" PRIVATE_PREVIEW = "PRIVATE_PREVIEW" +def is_experimental_stage(stage: Optional[str]) -> bool: + # Beta and private preview may still change; GA and public preview are frozen. + return stage in (LaunchStage.PUBLIC_BETA, LaunchStage.PRIVATE_PREVIEW) + + @dataclass class Property: ref: str diff --git a/python/databricks/bundles/jobs/_models/ai_runtime_task.py b/python/databricks/bundles/jobs/_models/ai_runtime_task.py index 3c8a802d5be..e1257223f6a 100644 --- a/python/databricks/bundles/jobs/_models/ai_runtime_task.py +++ b/python/databricks/bundles/jobs/_models/ai_runtime_task.py @@ -61,6 +61,8 @@ class AiRuntimeTask: docker_image_url: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Optional Docker image URL for a custom container image. When set, the task runs on the specified container image instead of the default Databricks client image. Format: @@ -133,6 +135,8 @@ class AiRuntimeTaskDict(TypedDict, total=False): docker_image_url: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Optional Docker image URL for a custom container image. When set, the task runs on the specified container image instead of the default Databricks client image. Format: diff --git a/python/databricks/bundles/jobs/_models/cluster_spec.py b/python/databricks/bundles/jobs/_models/cluster_spec.py index 685863137f3..2edebdd2e93 100644 --- a/python/databricks/bundles/jobs/_models/cluster_spec.py +++ b/python/databricks/bundles/jobs/_models/cluster_spec.py @@ -149,6 +149,8 @@ class ClusterSpec: dependency_mode: VariableOrOptional[DependencyMode] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Controls dependency configuration for the cluster. """ @@ -425,6 +427,8 @@ class ClusterSpecDict(TypedDict, total=False): dependency_mode: VariableOrOptional[DependencyModeParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Controls dependency configuration for the cluster. """ diff --git a/python/databricks/bundles/jobs/_models/compute.py b/python/databricks/bundles/jobs/_models/compute.py index 6e6e47d1d7a..e967d342520 100644 --- a/python/databricks/bundles/jobs/_models/compute.py +++ b/python/databricks/bundles/jobs/_models/compute.py @@ -21,6 +21,8 @@ class Compute: hardware_accelerator: VariableOrOptional[HardwareAcceleratorType] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Hardware accelerator configuration for Serverless GPU workloads. """ @@ -37,6 +39,8 @@ class ComputeDict(TypedDict, total=False): hardware_accelerator: VariableOrOptional[HardwareAcceleratorTypeParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Hardware accelerator configuration for Serverless GPU workloads. """ diff --git a/python/databricks/bundles/jobs/_models/continuous_trigger_configuration.py b/python/databricks/bundles/jobs/_models/continuous_trigger_configuration.py index 866ffda4c61..2ad5f5a2336 100644 --- a/python/databricks/bundles/jobs/_models/continuous_trigger_configuration.py +++ b/python/databricks/bundles/jobs/_models/continuous_trigger_configuration.py @@ -24,6 +24,8 @@ class ContinuousTriggerConfiguration: task_retry_mode: VariableOrOptional[TaskRetryMode] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Whether the continuous job applies task-level retries. Defaults to NEVER. """ @@ -40,6 +42,8 @@ class ContinuousTriggerConfigurationDict(TypedDict, total=False): task_retry_mode: VariableOrOptional[TaskRetryModeParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Whether the continuous job applies task-level retries. Defaults to NEVER. """ diff --git a/python/databricks/bundles/jobs/_models/cron_trigger_configuration.py b/python/databricks/bundles/jobs/_models/cron_trigger_configuration.py index e62e51e217d..9e083514b15 100644 --- a/python/databricks/bundles/jobs/_models/cron_trigger_configuration.py +++ b/python/databricks/bundles/jobs/_models/cron_trigger_configuration.py @@ -20,12 +20,16 @@ class CronTriggerConfiguration: quartz_cron_expression: VariableOr[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A Cron expression using Quartz syntax that describes the schedule for this trigger. See [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details. """ timezone_id: VariableOr[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A Java timezone ID. The schedule is resolved with respect to this timezone. See [Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details. """ @@ -43,12 +47,16 @@ class CronTriggerConfigurationDict(TypedDict, total=False): quartz_cron_expression: VariableOr[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A Cron expression using Quartz syntax that describes the schedule for this trigger. See [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details. """ timezone_id: VariableOr[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A Java timezone ID. The schedule is resolved with respect to this timezone. See [Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details. """ diff --git a/python/databricks/bundles/jobs/_models/job.py b/python/databricks/bundles/jobs/_models/job.py index d4010ac38f8..e9cdd9ac27a 100644 --- a/python/databricks/bundles/jobs/_models/job.py +++ b/python/databricks/bundles/jobs/_models/job.py @@ -217,6 +217,8 @@ class Job(Resource): triggers: VariableOrList[TriggerConfiguration] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] List of triggers attached to this job. A run starts when any active trigger evaluates to true. Cannot be set in the same request as the legacy `schedule`, `trigger`, or `continuous` fields. Gated behind the "Multiple Triggers" feature preview. """ @@ -386,6 +388,8 @@ class JobDict(TypedDict, total=False): triggers: VariableOrList[TriggerConfigurationParam] """ + :meta private: [EXPERIMENTAL] + [Beta] List of triggers attached to this job. A run starts when any active trigger evaluates to true. Cannot be set in the same request as the legacy `schedule`, `trigger`, or `continuous` fields. Gated behind the "Multiple Triggers" feature preview. """ diff --git a/python/databricks/bundles/jobs/_models/pipeline_params.py b/python/databricks/bundles/jobs/_models/pipeline_params.py index 0d84734931d..ef2793b6580 100644 --- a/python/databricks/bundles/jobs/_models/pipeline_params.py +++ b/python/databricks/bundles/jobs/_models/pipeline_params.py @@ -22,22 +22,30 @@ class PipelineParams: full_refresh_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update with fullRefresh. """ refresh_flow_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] Flow names to selectively refresh. These are unioned with other selective refresh options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. """ refresh_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update without fullRefresh. """ reset_checkpoint_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] A list of streaming flows to reset checkpoints without clearing data. """ @@ -59,22 +67,30 @@ class PipelineParamsDict(TypedDict, total=False): full_refresh_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update with fullRefresh. """ refresh_flow_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Flow names to selectively refresh. These are unioned with other selective refresh options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. """ refresh_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update without fullRefresh. """ reset_checkpoint_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A list of streaming flows to reset checkpoints without clearing data. """ diff --git a/python/databricks/bundles/jobs/_models/pipeline_task.py b/python/databricks/bundles/jobs/_models/pipeline_task.py index e23ed9da713..d249f0215d2 100644 --- a/python/databricks/bundles/jobs/_models/pipeline_task.py +++ b/python/databricks/bundles/jobs/_models/pipeline_task.py @@ -32,28 +32,38 @@ class PipelineTask: full_refresh_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update with fullRefresh. """ parameters: VariableOrDict[str] = field(default_factory=dict) """ + :meta private: [EXPERIMENTAL] + [Beta] Key/value-map of parameters passed to the pipeline execution. Limited to 10k characters in total. """ refresh_flow_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] Flow names to selectively refresh. These are unioned with other selective refresh options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. """ refresh_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update without fullRefresh. """ reset_checkpoint_selection: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] A list of streaming flows to reset checkpoints without clearing data. """ @@ -80,28 +90,38 @@ class PipelineTaskDict(TypedDict, total=False): full_refresh_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update with fullRefresh. """ parameters: VariableOrDict[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Key/value-map of parameters passed to the pipeline execution. Limited to 10k characters in total. """ refresh_flow_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Flow names to selectively refresh. These are unioned with other selective refresh options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. """ refresh_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A list of tables to update without fullRefresh. """ reset_checkpoint_selection: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] A list of streaming flows to reset checkpoints without clearing data. """ diff --git a/python/databricks/bundles/jobs/_models/task.py b/python/databricks/bundles/jobs/_models/task.py index 1b352983859..0a3217235d7 100644 --- a/python/databricks/bundles/jobs/_models/task.py +++ b/python/databricks/bundles/jobs/_models/task.py @@ -132,6 +132,8 @@ class Task: compute: VariableOrOptional[Compute] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Task level compute configuration. """ @@ -369,6 +371,8 @@ class TaskDict(TypedDict, total=False): compute: VariableOrOptional[ComputeParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Task level compute configuration. """ diff --git a/python/databricks/bundles/jobs/_models/trigger_configuration.py b/python/databricks/bundles/jobs/_models/trigger_configuration.py index 259c45c7f9d..60042222371 100644 --- a/python/databricks/bundles/jobs/_models/trigger_configuration.py +++ b/python/databricks/bundles/jobs/_models/trigger_configuration.py @@ -51,11 +51,15 @@ class TriggerConfiguration: continuous: VariableOrOptional[ContinuousTriggerConfiguration] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Continuous trigger configuration. """ file_arrival: VariableOrOptional[FileArrivalTriggerConfiguration] = None """ + :meta private: [EXPERIMENTAL] + [Beta] File arrival trigger configuration. """ @@ -68,17 +72,23 @@ class TriggerConfiguration: pause_status: VariableOrOptional[PauseStatus] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Whether this trigger is paused. Defaults to UNPAUSED when unset; the server always returns an explicit value on read. """ periodic: VariableOrOptional[PeriodicTriggerConfiguration] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Trigger type: exactly one must be set; mutual exclusivity is enforced in the API handler Periodic trigger configuration. """ schedule: VariableOrOptional[CronTriggerConfiguration] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Cron schedule trigger configuration. """ @@ -91,6 +101,8 @@ class TriggerConfiguration: table_update: VariableOrOptional[TableUpdateTriggerConfiguration] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Table update trigger configuration. """ @@ -107,11 +119,15 @@ class TriggerConfigurationDict(TypedDict, total=False): continuous: VariableOrOptional[ContinuousTriggerConfigurationParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Continuous trigger configuration. """ file_arrival: VariableOrOptional[FileArrivalTriggerConfigurationParam] """ + :meta private: [EXPERIMENTAL] + [Beta] File arrival trigger configuration. """ @@ -124,17 +140,23 @@ class TriggerConfigurationDict(TypedDict, total=False): pause_status: VariableOrOptional[PauseStatusParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Whether this trigger is paused. Defaults to UNPAUSED when unset; the server always returns an explicit value on read. """ periodic: VariableOrOptional[PeriodicTriggerConfigurationParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Trigger type: exactly one must be set; mutual exclusivity is enforced in the API handler Periodic trigger configuration. """ schedule: VariableOrOptional[CronTriggerConfigurationParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Cron schedule trigger configuration. """ @@ -147,6 +169,8 @@ class TriggerConfigurationDict(TypedDict, total=False): table_update: VariableOrOptional[TableUpdateTriggerConfigurationParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Table update trigger configuration. """ diff --git a/python/databricks/bundles/pipelines/_models/connector_options.py b/python/databricks/bundles/pipelines/_models/connector_options.py index 5fc9bfce6cc..21b18203a54 100644 --- a/python/databricks/bundles/pipelines/_models/connector_options.py +++ b/python/databricks/bundles/pipelines/_models/connector_options.py @@ -107,11 +107,15 @@ class ConnectorOptions: jira_options: VariableOrOptional[JiraConnectorOptions] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Jira specific options for ingestion """ kafka_options: VariableOrOptional[KafkaOptions] = None """ + :meta private: [EXPERIMENTAL] + [Beta] """ @@ -134,6 +138,8 @@ class ConnectorOptions: meta_ads_options: VariableOrOptional[MetaMarketingOptions] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Meta Marketing (Meta Ads) specific options for ingestion """ @@ -218,11 +224,15 @@ class ConnectorOptionsDict(TypedDict, total=False): jira_options: VariableOrOptional[JiraConnectorOptionsParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Jira specific options for ingestion """ kafka_options: VariableOrOptional[KafkaOptionsParam] """ + :meta private: [EXPERIMENTAL] + [Beta] """ @@ -245,6 +255,8 @@ class ConnectorOptionsDict(TypedDict, total=False): meta_ads_options: VariableOrOptional[MetaMarketingOptionsParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Meta Marketing (Meta Ads) specific options for ingestion """ diff --git a/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_fanout_options.py b/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_fanout_options.py index d2e17ce0c9d..092b91581ed 100644 --- a/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_fanout_options.py +++ b/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_fanout_options.py @@ -26,6 +26,8 @@ class IngestionPipelineDefinitionFanoutOptions: fanout_by: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Column path or SQL expression whose value determines the destination table. Supports dotted paths (e.g. "value.event_name") and expressions (e.g. "value:event_name::string"). @@ -33,6 +35,8 @@ class IngestionPipelineDefinitionFanoutOptions: transforms: VariableOrList[Transformer] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] Optional transforms applied to each route's DataFrame before writing to the destination table. """ @@ -50,6 +54,8 @@ class IngestionPipelineDefinitionFanoutOptionsDict(TypedDict, total=False): fanout_by: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Column path or SQL expression whose value determines the destination table. Supports dotted paths (e.g. "value.event_name") and expressions (e.g. "value:event_name::string"). @@ -57,6 +63,8 @@ class IngestionPipelineDefinitionFanoutOptionsDict(TypedDict, total=False): transforms: VariableOrList[TransformerParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Optional transforms applied to each route's DataFrame before writing to the destination table. """ diff --git a/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_table_specific_config_query_based_connector_config.py b/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_table_specific_config_query_based_connector_config.py index 2ef994bb09e..a784bb6e8b4 100644 --- a/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_table_specific_config_query_based_connector_config.py +++ b/python/databricks/bundles/pipelines/_models/ingestion_pipeline_definition_table_specific_config_query_based_connector_config.py @@ -40,6 +40,8 @@ class IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig: hard_deletion_sync_min_interval_in_seconds: VariableOrOptional[int] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Specifies the minimum interval (in seconds) between snapshots on primary keys for detecting and synchronizing hard deletions—i.e., rows that have been physically removed from the source table. @@ -91,6 +93,8 @@ class IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfigDic hard_deletion_sync_min_interval_in_seconds: VariableOrOptional[int] """ + :meta private: [EXPERIMENTAL] + [Beta] Specifies the minimum interval (in seconds) between snapshots on primary keys for detecting and synchronizing hard deletions—i.e., rows that have been physically removed from the source table. diff --git a/python/databricks/bundles/pipelines/_models/jira_connector_options.py b/python/databricks/bundles/pipelines/_models/jira_connector_options.py index beb6f273455..ef7ba677587 100644 --- a/python/databricks/bundles/pipelines/_models/jira_connector_options.py +++ b/python/databricks/bundles/pipelines/_models/jira_connector_options.py @@ -19,6 +19,8 @@ class JiraConnectorOptions: include_jira_spaces: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Projects to filter Jira data on """ @@ -35,6 +37,8 @@ class JiraConnectorOptionsDict(TypedDict, total=False): include_jira_spaces: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Projects to filter Jira data on """ diff --git a/python/databricks/bundles/pipelines/_models/json_transformer_options.py b/python/databricks/bundles/pipelines/_models/json_transformer_options.py index ef2b9592efc..8359f564eb2 100644 --- a/python/databricks/bundles/pipelines/_models/json_transformer_options.py +++ b/python/databricks/bundles/pipelines/_models/json_transformer_options.py @@ -21,11 +21,15 @@ class JsonTransformerOptions: as_variant: VariableOrOptional[bool] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Parse the entire value as a single Variant column. """ schema: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Inline schema string for JSON parsing (Spark DDL format). """ @@ -33,16 +37,22 @@ class JsonTransformerOptions: FileIngestionOptionsSchemaEvolutionMode ] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Schema evolution mode for schema inference. """ schema_file_path: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Path to a schema file (.ddl). """ schema_hints: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Schema hints as a comma-separated string of "column_name type" pairs. """ @@ -59,11 +69,15 @@ class JsonTransformerOptionsDict(TypedDict, total=False): as_variant: VariableOrOptional[bool] """ + :meta private: [EXPERIMENTAL] + [Beta] Parse the entire value as a single Variant column. """ schema: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Inline schema string for JSON parsing (Spark DDL format). """ @@ -71,16 +85,22 @@ class JsonTransformerOptionsDict(TypedDict, total=False): FileIngestionOptionsSchemaEvolutionModeParam ] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Schema evolution mode for schema inference. """ schema_file_path: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Path to a schema file (.ddl). """ schema_hints: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Schema hints as a comma-separated string of "column_name type" pairs. """ diff --git a/python/databricks/bundles/pipelines/_models/kafka_options.py b/python/databricks/bundles/pipelines/_models/kafka_options.py index 3277d532b86..d42b585624d 100644 --- a/python/databricks/bundles/pipelines/_models/kafka_options.py +++ b/python/databricks/bundles/pipelines/_models/kafka_options.py @@ -34,6 +34,8 @@ class KafkaOptions: key_transformer: VariableOrOptional[Transformer] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Transformer for the message key. If not specified, the key is left as raw bytes. """ @@ -47,24 +49,32 @@ class KafkaOptions: starting_offset: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Where to begin reading when no checkpoint exists. Valid values: "latest" and "earliest". Defaults to "latest". """ topic_pattern: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Java regex pattern to subscribe to matching topics. Only one of topics or topic_pattern must be specified. """ topics: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] Topics to subscribe to. Only one of topics or topic_pattern must be specified. """ value_transformer: VariableOrOptional[Transformer] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Transformer for the message value. If not specified, the value is left as raw bytes. """ @@ -91,6 +101,8 @@ class KafkaOptionsDict(TypedDict, total=False): key_transformer: VariableOrOptional[TransformerParam] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Transformer for the message key. If not specified, the key is left as raw bytes. """ @@ -104,24 +116,32 @@ class KafkaOptionsDict(TypedDict, total=False): starting_offset: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Where to begin reading when no checkpoint exists. Valid values: "latest" and "earliest". Defaults to "latest". """ topic_pattern: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Java regex pattern to subscribe to matching topics. Only one of topics or topic_pattern must be specified. """ topics: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Topics to subscribe to. Only one of topics or topic_pattern must be specified. """ value_transformer: VariableOrOptional[TransformerParam] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Transformer for the message value. If not specified, the value is left as raw bytes. """ diff --git a/python/databricks/bundles/pipelines/_models/meta_marketing_options.py b/python/databricks/bundles/pipelines/_models/meta_marketing_options.py index 4a3a244183f..9a9f657bf5f 100644 --- a/python/databricks/bundles/pipelines/_models/meta_marketing_options.py +++ b/python/databricks/bundles/pipelines/_models/meta_marketing_options.py @@ -23,28 +23,38 @@ class MetaMarketingOptions: action_attribution_windows: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.action_attribution_windows) Action attribution windows for insights reporting (e.g. "28d_click", "1d_view") """ action_breakdowns: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.action_breakdowns) Action breakdowns """ action_report_time: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.action_report_time) Timing used to report action statistics (impression, conversion, mixed, or lifetime) """ breakdowns: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.breakdowns) Breakdowns to configure """ custom_insights_lookback_window: VariableOrOptional[int] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Window in days to revisit data during sync to capture updated conversion data from the API, shared by prebuilt and custom reports. """ @@ -62,18 +72,24 @@ class MetaMarketingOptions: level: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.level) Granularity of data to pull (account, ad, adset, campaign) """ start_date: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Start date in yyyy-MM-dd format (e.g. 2025-01-15). Data added after this date will be ingested, shared by prebuilt and custom reports. """ time_increment: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.time_increment) Value in string by which to aggregate statistics (can take all_days, monthly or number of days) """ @@ -91,28 +107,38 @@ class MetaMarketingOptionsDict(TypedDict, total=False): action_attribution_windows: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.action_attribution_windows) Action attribution windows for insights reporting (e.g. "28d_click", "1d_view") """ action_breakdowns: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.action_breakdowns) Action breakdowns """ action_report_time: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.action_report_time) Timing used to report action statistics (impression, conversion, mixed, or lifetime) """ breakdowns: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.breakdowns) Breakdowns to configure """ custom_insights_lookback_window: VariableOrOptional[int] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Window in days to revisit data during sync to capture updated conversion data from the API, shared by prebuilt and custom reports. """ @@ -130,18 +156,24 @@ class MetaMarketingOptionsDict(TypedDict, total=False): level: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.level) Granularity of data to pull (account, ad, adset, campaign) """ start_date: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Start date in yyyy-MM-dd format (e.g. 2025-01-15). Data added after this date will be ingested, shared by prebuilt and custom reports. """ time_increment: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [DEPRECATED] [Beta] (Optional, DEPRECATED — use custom_report_options.time_increment) Value in string by which to aggregate statistics (can take all_days, monthly or number of days) """ diff --git a/python/databricks/bundles/pipelines/_models/pipeline.py b/python/databricks/bundles/pipelines/_models/pipeline.py index 9f179f7c7a9..3e8a25086a6 100644 --- a/python/databricks/bundles/pipelines/_models/pipeline.py +++ b/python/databricks/bundles/pipelines/_models/pipeline.py @@ -169,6 +169,8 @@ class Pipeline(Resource): parameters: VariableOrDict[str] = field(default_factory=dict) """ + :meta private: [EXPERIMENTAL] + [Beta] Key/value map of default parameters to use for pipeline execution. Maximum total size: 10k characters (JSON format) """ @@ -360,6 +362,8 @@ class PipelineDict(TypedDict, total=False): parameters: VariableOrDict[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Key/value map of default parameters to use for pipeline execution. Maximum total size: 10k characters (JSON format) """ diff --git a/python/databricks/bundles/pipelines/_models/pipelines_environment.py b/python/databricks/bundles/pipelines/_models/pipelines_environment.py index 095104bf8a2..28e9f089094 100644 --- a/python/databricks/bundles/pipelines/_models/pipelines_environment.py +++ b/python/databricks/bundles/pipelines/_models/pipelines_environment.py @@ -27,6 +27,8 @@ class PipelinesEnvironment: environment_version: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] The environment version of the serverless Python environment used to execute customer Python code. Each environment version includes a specific Python version and a curated set of pre-installed libraries with defined versions, @@ -59,6 +61,8 @@ class PipelinesEnvironmentDict(TypedDict, total=False): environment_version: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] The environment version of the serverless Python environment used to execute customer Python code. Each environment version includes a specific Python version and a curated set of pre-installed libraries with defined versions, diff --git a/python/databricks/bundles/pipelines/_models/schema_spec.py b/python/databricks/bundles/pipelines/_models/schema_spec.py index b3dd638c455..ca2ff08bdc7 100644 --- a/python/databricks/bundles/pipelines/_models/schema_spec.py +++ b/python/databricks/bundles/pipelines/_models/schema_spec.py @@ -53,6 +53,8 @@ class SchemaSpec: fanout_options: VariableOrOptional[IngestionPipelineDefinitionFanoutOptions] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Fanout options for multi-table routing from streaming sources. When set, records are routed to destination tables based on a per-record routing key. The key value becomes the table name: @@ -106,6 +108,8 @@ class SchemaSpecDict(TypedDict, total=False): fanout_options: VariableOrOptional[IngestionPipelineDefinitionFanoutOptionsParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Fanout options for multi-table routing from streaming sources. When set, records are routed to destination tables based on a per-record routing key. The key value becomes the table name: diff --git a/python/databricks/bundles/pipelines/_models/table_specific_config.py b/python/databricks/bundles/pipelines/_models/table_specific_config.py index 1b4c26a748e..42773ae759e 100644 --- a/python/databricks/bundles/pipelines/_models/table_specific_config.py +++ b/python/databricks/bundles/pipelines/_models/table_specific_config.py @@ -52,6 +52,8 @@ class TableSpecificConfig: clustering_columns: VariableOrList[str] = field(default_factory=list) """ + :meta private: [EXPERIMENTAL] + [Beta] List of column names to use for clustering the destination table. When specified, the destination Delta table will be clustered by these columns. This can improve query performance when filtering on these columns. @@ -62,6 +64,8 @@ class TableSpecificConfig: enable_auto_clustering: VariableOrOptional[bool] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Whether to enable auto clustering on the destination table. When enabled, Delta will automatically optimize the data layout based on the clustering columns for improved query performance. @@ -125,12 +129,16 @@ class TableSpecificConfig: source_metadata_column: VariableOrOptional[str] = None """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Name of the struct column added to each ingested record to hold per row source metadata. """ table_properties: VariableOrDict[str] = field(default_factory=dict) """ + :meta private: [EXPERIMENTAL] + [Beta] Table properties to set on the destination table. These are key-value pairs that configure various Delta table behaviors or any user defined properties. Example: {"delta.feature.variantType": "supported", "delta.enableTypeWidening": "true"} @@ -174,6 +182,8 @@ class TableSpecificConfigDict(TypedDict, total=False): clustering_columns: VariableOrList[str] """ + :meta private: [EXPERIMENTAL] + [Beta] List of column names to use for clustering the destination table. When specified, the destination Delta table will be clustered by these columns. This can improve query performance when filtering on these columns. @@ -184,6 +194,8 @@ class TableSpecificConfigDict(TypedDict, total=False): enable_auto_clustering: VariableOrOptional[bool] """ + :meta private: [EXPERIMENTAL] + [Beta] Whether to enable auto clustering on the destination table. When enabled, Delta will automatically optimize the data layout based on the clustering columns for improved query performance. @@ -247,12 +259,16 @@ class TableSpecificConfigDict(TypedDict, total=False): source_metadata_column: VariableOrOptional[str] """ + :meta private: [EXPERIMENTAL] + [Beta] (Optional) Name of the struct column added to each ingested record to hold per row source metadata. """ table_properties: VariableOrDict[str] """ + :meta private: [EXPERIMENTAL] + [Beta] Table properties to set on the destination table. These are key-value pairs that configure various Delta table behaviors or any user defined properties. Example: {"delta.feature.variantType": "supported", "delta.enableTypeWidening": "true"} diff --git a/python/databricks/bundles/pipelines/_models/transformer.py b/python/databricks/bundles/pipelines/_models/transformer.py index b7823c623bb..861e50c096d 100644 --- a/python/databricks/bundles/pipelines/_models/transformer.py +++ b/python/databricks/bundles/pipelines/_models/transformer.py @@ -27,6 +27,8 @@ class Transformer: format: VariableOrOptional[TransformerFormat] = None """ + :meta private: [EXPERIMENTAL] + [Beta] Required: the wire format of the data. """ @@ -40,6 +42,8 @@ class Transformer: json_options: VariableOrOptional[JsonTransformerOptions] = None """ + :meta private: [EXPERIMENTAL] + [Beta] """ @@ -64,6 +68,8 @@ class TransformerDict(TypedDict, total=False): format: VariableOrOptional[TransformerFormatParam] """ + :meta private: [EXPERIMENTAL] + [Beta] Required: the wire format of the data. """ @@ -77,6 +83,8 @@ class TransformerDict(TypedDict, total=False): json_options: VariableOrOptional[JsonTransformerOptionsParam] """ + :meta private: [EXPERIMENTAL] + [Beta] """ From 105b2c99dbd87345bfa2b0a8813c7691eb5cc941 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 12:43:45 +0000 Subject: [PATCH 19/52] Sanitize enum member names in PyDABs codegen Enum values with non-identifier characters (e.g. "amazon-bedrock") produced invalid Python member names. Replace runs of non-alphanumeric characters with an underscore. Co-authored-by: Isaac --- python/codegen/codegen/generated_enum.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/codegen/codegen/generated_enum.py b/python/codegen/codegen/generated_enum.py index 7a951e01735..8f6b4ecbcaa 100644 --- a/python/codegen/codegen/generated_enum.py +++ b/python/codegen/codegen/generated_enum.py @@ -81,5 +81,6 @@ def get_code(generated: GeneratedEnum) -> str: def _camel_to_upper_snake(value): s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", value) - - return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).upper() + s1 = re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1) + # Non-identifier chars (e.g. "-" in "amazon-bedrock") become "_". + return re.sub(r"[^0-9a-zA-Z]+", "_", s1).upper() From 544828ea0d48f3d855193eac62074727e8bc9691 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 12:43:59 +0000 Subject: [PATCH 20/52] Generate all public-preview and GA PyDABs resources Derive the resource set from the Resources struct in the bundle schema instead of a hardcoded allowlist, excluding denylisted resources and those below public preview. Adds 17 resources (23 total). Co-authored-by: Isaac --- python/codegen/codegen/packages.py | 65 +- python/databricks/bundles/apps/__init__.py | 237 +++++++ python/databricks/bundles/apps/_models/app.py | 260 +++++++ .../bundles/apps/_models/app_config.py | 39 ++ .../bundles/apps/_models/app_env_var.py | 42 ++ .../bundles/apps/_models/app_permission.py | 74 ++ .../apps/_models/app_permission_level.py | 16 + .../bundles/apps/_models/app_resource.py | 130 ++++ .../bundles/apps/_models/app_resource_app.py | 42 ++ .../app_resource_app_app_permission.py | 11 + .../apps/_models/app_resource_database.py | 46 ++ ...p_resource_database_database_permission.py | 13 + .../apps/_models/app_resource_experiment.py | 42 ++ ...source_experiment_experiment_permission.py | 16 + .../apps/_models/app_resource_genie_space.py | 46 ++ ...urce_genie_space_genie_space_permission.py | 17 + .../bundles/apps/_models/app_resource_job.py | 54 ++ .../app_resource_job_job_permission.py | 17 + .../apps/_models/app_resource_postgres.py | 46 ++ ...p_resource_postgres_postgres_permission.py | 13 + .../apps/_models/app_resource_secret.py | 64 ++ .../app_resource_secret_secret_permission.py | 19 + .../_models/app_resource_serving_endpoint.py | 56 ++ ...ng_endpoint_serving_endpoint_permission.py | 16 + .../_models/app_resource_sql_warehouse.py | 54 ++ ..._sql_warehouse_sql_warehouse_permission.py | 16 + .../apps/_models/app_resource_uc_securable.py | 50 ++ ...ce_uc_securable_uc_securable_permission.py | 21 + ...resource_uc_securable_uc_securable_type.py | 17 + .../bundles/apps/_models/compute_size.py | 13 + .../bundles/apps/_models/git_repository.py | 86 +++ .../bundles/apps/_models/git_source.py | 74 ++ .../apps/_models/lifecycle_with_started.py | 50 ++ .../_models/telemetry_export_destination.py | 48 ++ .../bundles/apps/_models/unity_catalog.py | 62 ++ .../databricks/bundles/clusters/__init__.py | 239 +++++++ .../bundles/clusters/_models/adlsgen2_info.py | 42 ++ .../bundles/clusters/_models/auto_scale.py | 54 ++ .../clusters/_models/aws_attributes.py | 234 +++++++ .../clusters/_models/aws_availability.py | 21 + .../clusters/_models/azure_attributes.py | 132 ++++ .../clusters/_models/azure_availability.py | 21 + .../bundles/clusters/_models/clients_types.py | 50 ++ .../bundles/clusters/_models/cluster.py | 648 ++++++++++++++++++ .../clusters/_models/cluster_log_conf.py | 84 +++ .../clusters/_models/cluster_permission.py | 74 ++ .../_models/cluster_permission_level.py | 19 + .../_models/confidential_compute_type.py | 23 + .../clusters/_models/data_security_mode.py | 56 ++ .../clusters/_models/dbfs_storage_info.py | 42 ++ .../clusters/_models/dependency_mode.py | 28 + .../clusters/_models/docker_basic_auth.py | 50 ++ .../bundles/clusters/_models/docker_image.py | 54 ++ .../clusters/_models/ebs_volume_type.py | 19 + .../clusters/_models/gcp_attributes.py | 168 +++++ .../clusters/_models/gcp_availability.py | 21 + .../clusters/_models/gcs_storage_info.py | 42 ++ .../clusters/_models/init_script_info.py | 146 ++++ .../bundles/clusters/_models/kind.py | 23 + .../_models/lifecycle_with_started.py | 50 ++ .../clusters/_models/local_file_info.py | 40 ++ .../clusters/_models/log_analytics_info.py | 50 ++ .../clusters/_models/node_type_flexibility.py | 42 ++ .../clusters/_models/runtime_engine.py | 13 + .../clusters/_models/s3_storage_info.py | 124 ++++ .../clusters/_models/volumes_storage_info.py | 44 ++ .../bundles/clusters/_models/workload_type.py | 46 ++ .../_models/workspace_storage_info.py | 42 ++ python/databricks/bundles/core/__init__.py | 34 + .../bundles/core/_generated/__init__.py | 133 ++++ .../bundles/core/_generated/apps.py | 115 ++++ .../bundles/core/_generated/clusters.py | 115 ++++ .../core/_generated/database_catalogs.py | 124 ++++ .../core/_generated/database_instances.py | 126 ++++ .../bundles/core/_generated/experiments.py | 126 ++++ .../core/_generated/external_locations.py | 126 ++++ .../bundles/core/_generated/instance_pools.py | 118 ++++ .../bundles/core/_generated/job_runs.py | 115 ++++ .../_generated/model_serving_endpoints.py | 130 ++++ .../bundles/core/_generated/models.py | 118 ++++ .../core/_generated/quality_monitors.py | 124 ++++ .../core/_generated/registered_models.py | 124 ++++ .../bundles/core/_generated/secret_scopes.py | 118 ++++ .../bundles/core/_generated/sql_warehouses.py | 118 ++++ .../core/_generated/synced_database_tables.py | 128 ++++ .../_generated/vector_search_endpoints.py | 130 ++++ .../core/_generated/vector_search_indexes.py | 128 ++++ .../bundles/database_catalogs/__init__.py | 22 + .../_models/database_catalog.py | 85 +++ .../database_catalogs/_models/lifecycle.py | 40 ++ .../bundles/database_instances/__init__.py | 52 ++ .../database_instances/_models/custom_tag.py | 58 ++ .../_models/database_instance.py | 193 ++++++ .../_models/database_instance_ref.py | 87 +++ .../database_instances/_models/lifecycle.py | 40 ++ .../database_instances/_models/permission.py | 74 ++ .../_models/permission_level.py | 58 ++ .../bundles/experiments/__init__.py | 60 ++ .../_models/experiment_permission_level.py | 19 + .../experiments/_models/experiment_tag.py | 52 ++ .../_models/experiment_trace_location.py | 54 ++ .../bundles/experiments/_models/lifecycle.py | 40 ++ .../experiments/_models/mlflow_experiment.py | 131 ++++ .../_models/mlflow_experiment_permission.py | 76 ++ .../experiments/_models/uc_trace_location.py | 87 +++ .../bundles/external_locations/__init__.py | 90 +++ .../_models/aws_sqs_queue.py | 42 ++ .../_models/azure_queue_storage.py | 70 ++ .../_models/encryption_details.py | 46 ++ .../_models/external_location.py | 173 +++++ .../_models/file_event_queue.py | 66 ++ .../external_locations/_models/gcp_pubsub.py | 42 ++ .../external_locations/_models/lifecycle.py | 40 ++ .../external_locations/_models/privilege.py | 116 ++++ .../_models/privilege_assignment.py | 56 ++ .../_models/sse_encryption_details.py | 58 ++ .../sse_encryption_details_algorithm.py | 18 + .../bundles/instance_pools/__init__.py | 130 ++++ .../instance_pools/_models/disk_spec.py | 136 ++++ .../instance_pools/_models/disk_type.py | 64 ++ .../disk_type_azure_disk_volume_type.py | 19 + .../_models/disk_type_ebs_volume_type.py | 19 + .../_models/docker_basic_auth.py | 50 ++ .../instance_pools/_models/docker_image.py | 54 ++ .../_models/gcp_availability.py | 21 + .../instance_pools/_models/instance_pool.py | 289 ++++++++ .../_models/instance_pool_aws_attributes.py | 122 ++++ ...stance_pool_aws_attributes_availability.py | 18 + .../_models/instance_pool_azure_attributes.py | 100 +++ ...ance_pool_azure_attributes_availability.py | 18 + .../_models/instance_pool_gcp_attributes.py | 94 +++ .../_models/instance_pool_permission.py | 74 ++ .../_models/instance_pool_permission_level.py | 18 + .../instance_pools/_models/lifecycle.py | 40 ++ .../_models/node_type_flexibility.py | 42 ++ .../databricks/bundles/job_runs/__init__.py | 48 ++ .../bundles/job_runs/_models/job_run.py | 136 ++++ .../job_runs/_models/job_run_lifecycle.py | 54 ++ .../job_runs/_models/job_run_trigger.py | 40 ++ .../job_runs/_models/performance_target.py | 20 + .../job_runs/_models/pipeline_params.py | 98 +++ .../job_runs/_models/queue_settings.py | 40 ++ .../model_serving_endpoints/__init__.py | 352 ++++++++++ .../_models/ai21_labs_config.py | 62 ++ .../_models/ai_gateway_config.py | 106 +++ .../ai_gateway_guardrail_parameters.py | 80 +++ .../ai_gateway_guardrail_pii_behavior.py | 46 ++ ...gateway_guardrail_pii_behavior_behavior.py | 15 + .../_models/ai_gateway_guardrails.py | 54 ++ .../ai_gateway_inference_table_config.py | 78 +++ .../_models/ai_gateway_rate_limit.py | 90 +++ .../_models/ai_gateway_rate_limit_key.py | 17 + .../ai_gateway_rate_limit_renewal_period.py | 13 + .../ai_gateway_usage_tracking_config.py | 42 ++ .../_models/amazon_bedrock_config.py | 148 ++++ .../amazon_bedrock_config_bedrock_provider.py | 17 + .../_models/anthropic_config.py | 62 ++ .../_models/api_key_auth.py | 64 ++ .../_models/auto_capture_config_input.py | 73 ++ .../_models/bearer_token_auth.py | 54 ++ .../_models/cohere_config.py | 74 ++ .../_models/custom_provider_config.py | 74 ++ .../databricks_model_serving_config.py | 84 +++ .../_models/email_notifications.py | 50 ++ .../_models/endpoint_core_config_input.py | 92 +++ .../_models/endpoint_tag.py | 50 ++ .../_models/external_model.py | 194 ++++++ .../_models/external_model_provider.py | 32 + .../_models/fallback_config.py | 46 ++ .../_models/google_cloud_vertex_ai_config.py | 110 +++ .../_models/lifecycle.py | 40 ++ .../_models/model_serving_endpoint.py | 185 +++++ .../model_serving_endpoint_permission.py | 76 ++ .../_models/open_ai_config.py | 200 ++++++ .../_models/pa_lm_config.py | 62 ++ .../_models/rate_limit.py | 70 ++ .../_models/rate_limit_key.py | 16 + .../_models/rate_limit_renewal_period.py | 15 + .../model_serving_endpoints/_models/route.py | 54 ++ .../_models/served_entity_input.py | 186 +++++ .../_models/served_model_input.py | 170 +++++ .../served_model_input_workload_type.py | 36 + .../serving_endpoint_permission_level.py | 19 + .../_models/serving_model_workload_type.py | 36 + .../_models/telemetry_config.py | 90 +++ .../_models/telemetry_feature.py | 27 + .../telemetry_inference_table_config.py | 44 ++ .../_models/traffic_config.py | 44 ++ .../_models/unity_catalog_table_names.py | 78 +++ python/databricks/bundles/models/__init__.py | 44 ++ .../bundles/models/_models/lifecycle.py | 40 ++ .../bundles/models/_models/mlflow_model.py | 91 +++ .../models/_models/mlflow_model_permission.py | 74 ++ .../bundles/models/_models/model_tag.py | 52 ++ .../registered_model_permission_level.py | 28 + .../bundles/quality_monitors/__init__.py | 104 +++ .../quality_monitors/_models/lifecycle.py | 40 ++ .../_models/monitor_cron_schedule.py | 64 ++ .../monitor_cron_schedule_pause_status.py | 20 + .../monitor_data_classification_config.py | 50 ++ .../_models/monitor_destination.py | 40 ++ .../_models/monitor_inference_log.py | 108 +++ .../monitor_inference_log_problem_type.py | 15 + .../_models/monitor_metric.py | 100 +++ .../_models/monitor_metric_type.py | 30 + .../_models/monitor_notifications.py | 58 ++ .../_models/monitor_snapshot.py | 31 + .../_models/monitor_time_series.py | 52 ++ .../_models/quality_monitor.py | 239 +++++++ .../bundles/registered_models/__init__.py | 44 ++ .../registered_models/_models/lifecycle.py | 40 ++ .../registered_models/_models/privilege.py | 116 ++++ .../_models/privilege_assignment.py | 56 ++ .../_models/registered_model.py | 193 ++++++ .../_models/registered_model_alias.py | 90 +++ .../bundles/secret_scopes/__init__.py | 50 ++ .../azure_key_vault_secret_scope_metadata.py | 54 ++ .../secret_scopes/_models/lifecycle.py | 40 ++ .../_models/scope_backend_type.py | 17 + .../secret_scopes/_models/secret_scope.py | 98 +++ .../_models/secret_scope_permission.py | 74 ++ .../_models/secret_scope_permission_level.py | 15 + .../bundles/sql_warehouses/__init__.py | 78 +++ .../bundles/sql_warehouses/_models/channel.py | 44 ++ .../sql_warehouses/_models/channel_name.py | 22 + ...create_warehouse_request_warehouse_type.py | 15 + .../_models/endpoint_tag_pair.py | 38 + .../sql_warehouses/_models/endpoint_tags.py | 38 + .../_models/lifecycle_with_started.py | 50 ++ .../_models/spot_instance_policy.py | 32 + .../sql_warehouses/_models/sql_warehouse.py | 304 ++++++++ .../_models/sql_warehouse_permission.py | 74 ++ .../_models/warehouse_permission_level.py | 22 + .../synced_database_tables/__init__.py | 58 ++ .../_models/lifecycle.py | 40 ++ .../_models/new_pipeline_spec.py | 79 +++ .../_models/synced_database_table.py | 113 +++ .../_models/synced_table_scheduling_policy.py | 15 + .../_models/synced_table_spec.py | 170 +++++ .../synced_table_spec_pg_specific_type.py | 26 + .../synced_table_spec_type_override.py | 84 +++ .../vector_search_endpoints/__init__.py | 42 ++ .../_models/endpoint_type.py | 16 + .../_models/lifecycle.py | 40 ++ .../_models/vector_search_endpoint.py | 127 ++++ .../vector_search_endpoint_permission.py | 52 ++ ...vector_search_endpoint_permission_level.py | 19 + .../bundles/vector_search_indexes/__init__.py | 86 +++ .../delta_sync_vector_index_spec_request.py | 132 ++++ .../direct_access_vector_index_spec.py | 78 +++ .../_models/embedding_source_column.py | 60 ++ .../_models/embedding_vector_column.py | 50 ++ .../_models/index_subtype.py | 20 + .../_models/lifecycle.py | 40 ++ .../_models/pipeline_type.py | 18 + .../_models/privilege.py | 116 ++++ .../_models/privilege_assignment.py | 56 ++ .../_models/vector_index_type.py | 18 + .../_models/vector_search_index.py | 157 +++++ .../core/_generated/__init__.py | 34 + .../databricks_tests/core/_generated/apps.py | 48 ++ .../core/_generated/clusters.py | 82 +++ .../core/_generated/database_catalogs.py | 31 + .../core/_generated/database_instances.py | 38 + .../core/_generated/experiments.py | 40 ++ .../core/_generated/external_locations.py | 46 ++ .../core/_generated/instance_pools.py | 67 ++ .../core/_generated/job_runs.py | 38 + .../_generated/model_serving_endpoints.py | 62 ++ .../core/_generated/models.py | 40 ++ .../core/_generated/quality_monitors.py | 102 +++ .../core/_generated/registered_models.py | 31 + .../core/_generated/secret_scopes.py | 48 ++ .../core/_generated/sql_warehouses.py | 51 ++ .../core/_generated/synced_database_tables.py | 26 + .../_generated/vector_search_endpoints.py | 44 ++ .../core/_generated/vector_search_indexes.py | 51 ++ python/databricks_tests/core/public_api.txt | 136 ++++ 278 files changed, 19882 insertions(+), 8 deletions(-) create mode 100644 python/databricks/bundles/apps/__init__.py create mode 100644 python/databricks/bundles/apps/_models/app.py create mode 100644 python/databricks/bundles/apps/_models/app_config.py create mode 100644 python/databricks/bundles/apps/_models/app_env_var.py create mode 100644 python/databricks/bundles/apps/_models/app_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_permission_level.py create mode 100644 python/databricks/bundles/apps/_models/app_resource.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_app.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_app_app_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_database.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_database_database_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_experiment.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_experiment_experiment_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_genie_space.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_genie_space_genie_space_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_job.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_job_job_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_postgres.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_postgres_postgres_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_secret.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_secret_secret_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_serving_endpoint.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_serving_endpoint_serving_endpoint_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_sql_warehouse.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_sql_warehouse_sql_warehouse_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_uc_securable.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_permission.py create mode 100644 python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_type.py create mode 100644 python/databricks/bundles/apps/_models/compute_size.py create mode 100644 python/databricks/bundles/apps/_models/git_repository.py create mode 100644 python/databricks/bundles/apps/_models/git_source.py create mode 100644 python/databricks/bundles/apps/_models/lifecycle_with_started.py create mode 100644 python/databricks/bundles/apps/_models/telemetry_export_destination.py create mode 100644 python/databricks/bundles/apps/_models/unity_catalog.py create mode 100644 python/databricks/bundles/clusters/__init__.py create mode 100644 python/databricks/bundles/clusters/_models/adlsgen2_info.py create mode 100644 python/databricks/bundles/clusters/_models/auto_scale.py create mode 100644 python/databricks/bundles/clusters/_models/aws_attributes.py create mode 100644 python/databricks/bundles/clusters/_models/aws_availability.py create mode 100644 python/databricks/bundles/clusters/_models/azure_attributes.py create mode 100644 python/databricks/bundles/clusters/_models/azure_availability.py create mode 100644 python/databricks/bundles/clusters/_models/clients_types.py create mode 100644 python/databricks/bundles/clusters/_models/cluster.py create mode 100644 python/databricks/bundles/clusters/_models/cluster_log_conf.py create mode 100644 python/databricks/bundles/clusters/_models/cluster_permission.py create mode 100644 python/databricks/bundles/clusters/_models/cluster_permission_level.py create mode 100644 python/databricks/bundles/clusters/_models/confidential_compute_type.py create mode 100644 python/databricks/bundles/clusters/_models/data_security_mode.py create mode 100644 python/databricks/bundles/clusters/_models/dbfs_storage_info.py create mode 100644 python/databricks/bundles/clusters/_models/dependency_mode.py create mode 100644 python/databricks/bundles/clusters/_models/docker_basic_auth.py create mode 100644 python/databricks/bundles/clusters/_models/docker_image.py create mode 100644 python/databricks/bundles/clusters/_models/ebs_volume_type.py create mode 100644 python/databricks/bundles/clusters/_models/gcp_attributes.py create mode 100644 python/databricks/bundles/clusters/_models/gcp_availability.py create mode 100644 python/databricks/bundles/clusters/_models/gcs_storage_info.py create mode 100644 python/databricks/bundles/clusters/_models/init_script_info.py create mode 100644 python/databricks/bundles/clusters/_models/kind.py create mode 100644 python/databricks/bundles/clusters/_models/lifecycle_with_started.py create mode 100644 python/databricks/bundles/clusters/_models/local_file_info.py create mode 100644 python/databricks/bundles/clusters/_models/log_analytics_info.py create mode 100644 python/databricks/bundles/clusters/_models/node_type_flexibility.py create mode 100644 python/databricks/bundles/clusters/_models/runtime_engine.py create mode 100644 python/databricks/bundles/clusters/_models/s3_storage_info.py create mode 100644 python/databricks/bundles/clusters/_models/volumes_storage_info.py create mode 100644 python/databricks/bundles/clusters/_models/workload_type.py create mode 100644 python/databricks/bundles/clusters/_models/workspace_storage_info.py create mode 100644 python/databricks/bundles/core/_generated/apps.py create mode 100644 python/databricks/bundles/core/_generated/clusters.py create mode 100644 python/databricks/bundles/core/_generated/database_catalogs.py create mode 100644 python/databricks/bundles/core/_generated/database_instances.py create mode 100644 python/databricks/bundles/core/_generated/experiments.py create mode 100644 python/databricks/bundles/core/_generated/external_locations.py create mode 100644 python/databricks/bundles/core/_generated/instance_pools.py create mode 100644 python/databricks/bundles/core/_generated/job_runs.py create mode 100644 python/databricks/bundles/core/_generated/model_serving_endpoints.py create mode 100644 python/databricks/bundles/core/_generated/models.py create mode 100644 python/databricks/bundles/core/_generated/quality_monitors.py create mode 100644 python/databricks/bundles/core/_generated/registered_models.py create mode 100644 python/databricks/bundles/core/_generated/secret_scopes.py create mode 100644 python/databricks/bundles/core/_generated/sql_warehouses.py create mode 100644 python/databricks/bundles/core/_generated/synced_database_tables.py create mode 100644 python/databricks/bundles/core/_generated/vector_search_endpoints.py create mode 100644 python/databricks/bundles/core/_generated/vector_search_indexes.py create mode 100644 python/databricks/bundles/database_catalogs/__init__.py create mode 100644 python/databricks/bundles/database_catalogs/_models/database_catalog.py create mode 100644 python/databricks/bundles/database_catalogs/_models/lifecycle.py create mode 100644 python/databricks/bundles/database_instances/__init__.py create mode 100644 python/databricks/bundles/database_instances/_models/custom_tag.py create mode 100644 python/databricks/bundles/database_instances/_models/database_instance.py create mode 100644 python/databricks/bundles/database_instances/_models/database_instance_ref.py create mode 100644 python/databricks/bundles/database_instances/_models/lifecycle.py create mode 100644 python/databricks/bundles/database_instances/_models/permission.py create mode 100644 python/databricks/bundles/database_instances/_models/permission_level.py create mode 100644 python/databricks/bundles/experiments/__init__.py create mode 100644 python/databricks/bundles/experiments/_models/experiment_permission_level.py create mode 100644 python/databricks/bundles/experiments/_models/experiment_tag.py create mode 100644 python/databricks/bundles/experiments/_models/experiment_trace_location.py create mode 100644 python/databricks/bundles/experiments/_models/lifecycle.py create mode 100644 python/databricks/bundles/experiments/_models/mlflow_experiment.py create mode 100644 python/databricks/bundles/experiments/_models/mlflow_experiment_permission.py create mode 100644 python/databricks/bundles/experiments/_models/uc_trace_location.py create mode 100644 python/databricks/bundles/external_locations/__init__.py create mode 100644 python/databricks/bundles/external_locations/_models/aws_sqs_queue.py create mode 100644 python/databricks/bundles/external_locations/_models/azure_queue_storage.py create mode 100644 python/databricks/bundles/external_locations/_models/encryption_details.py create mode 100644 python/databricks/bundles/external_locations/_models/external_location.py create mode 100644 python/databricks/bundles/external_locations/_models/file_event_queue.py create mode 100644 python/databricks/bundles/external_locations/_models/gcp_pubsub.py create mode 100644 python/databricks/bundles/external_locations/_models/lifecycle.py create mode 100644 python/databricks/bundles/external_locations/_models/privilege.py create mode 100644 python/databricks/bundles/external_locations/_models/privilege_assignment.py create mode 100644 python/databricks/bundles/external_locations/_models/sse_encryption_details.py create mode 100644 python/databricks/bundles/external_locations/_models/sse_encryption_details_algorithm.py create mode 100644 python/databricks/bundles/instance_pools/__init__.py create mode 100644 python/databricks/bundles/instance_pools/_models/disk_spec.py create mode 100644 python/databricks/bundles/instance_pools/_models/disk_type.py create mode 100644 python/databricks/bundles/instance_pools/_models/disk_type_azure_disk_volume_type.py create mode 100644 python/databricks/bundles/instance_pools/_models/disk_type_ebs_volume_type.py create mode 100644 python/databricks/bundles/instance_pools/_models/docker_basic_auth.py create mode 100644 python/databricks/bundles/instance_pools/_models/docker_image.py create mode 100644 python/databricks/bundles/instance_pools/_models/gcp_availability.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes_availability.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes_availability.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_gcp_attributes.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_permission.py create mode 100644 python/databricks/bundles/instance_pools/_models/instance_pool_permission_level.py create mode 100644 python/databricks/bundles/instance_pools/_models/lifecycle.py create mode 100644 python/databricks/bundles/instance_pools/_models/node_type_flexibility.py create mode 100644 python/databricks/bundles/job_runs/__init__.py create mode 100644 python/databricks/bundles/job_runs/_models/job_run.py create mode 100644 python/databricks/bundles/job_runs/_models/job_run_lifecycle.py create mode 100644 python/databricks/bundles/job_runs/_models/job_run_trigger.py create mode 100644 python/databricks/bundles/job_runs/_models/performance_target.py create mode 100644 python/databricks/bundles/job_runs/_models/pipeline_params.py create mode 100644 python/databricks/bundles/job_runs/_models/queue_settings.py create mode 100644 python/databricks/bundles/model_serving_endpoints/__init__.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai21_labs_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_parameters.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior_behavior.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrails.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_inference_table_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_key.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_renewal_period.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_usage_tracking_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config_bedrock_provider.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/anthropic_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/api_key_auth.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/auto_capture_config_input.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/bearer_token_auth.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/cohere_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/custom_provider_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/databricks_model_serving_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/email_notifications.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/endpoint_core_config_input.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/endpoint_tag.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/external_model.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/external_model_provider.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/fallback_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/google_cloud_vertex_ai_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/lifecycle.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint_permission.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/open_ai_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/pa_lm_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/rate_limit.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/rate_limit_key.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/rate_limit_renewal_period.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/route.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/served_entity_input.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/served_model_input.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/served_model_input_workload_type.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/serving_endpoint_permission_level.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/serving_model_workload_type.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/telemetry_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/telemetry_feature.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/telemetry_inference_table_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/traffic_config.py create mode 100644 python/databricks/bundles/model_serving_endpoints/_models/unity_catalog_table_names.py create mode 100644 python/databricks/bundles/models/__init__.py create mode 100644 python/databricks/bundles/models/_models/lifecycle.py create mode 100644 python/databricks/bundles/models/_models/mlflow_model.py create mode 100644 python/databricks/bundles/models/_models/mlflow_model_permission.py create mode 100644 python/databricks/bundles/models/_models/model_tag.py create mode 100644 python/databricks/bundles/models/_models/registered_model_permission_level.py create mode 100644 python/databricks/bundles/quality_monitors/__init__.py create mode 100644 python/databricks/bundles/quality_monitors/_models/lifecycle.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule_pause_status.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_data_classification_config.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_destination.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_inference_log.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_inference_log_problem_type.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_metric.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_metric_type.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_notifications.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_snapshot.py create mode 100644 python/databricks/bundles/quality_monitors/_models/monitor_time_series.py create mode 100644 python/databricks/bundles/quality_monitors/_models/quality_monitor.py create mode 100644 python/databricks/bundles/registered_models/__init__.py create mode 100644 python/databricks/bundles/registered_models/_models/lifecycle.py create mode 100644 python/databricks/bundles/registered_models/_models/privilege.py create mode 100644 python/databricks/bundles/registered_models/_models/privilege_assignment.py create mode 100644 python/databricks/bundles/registered_models/_models/registered_model.py create mode 100644 python/databricks/bundles/registered_models/_models/registered_model_alias.py create mode 100644 python/databricks/bundles/secret_scopes/__init__.py create mode 100644 python/databricks/bundles/secret_scopes/_models/azure_key_vault_secret_scope_metadata.py create mode 100644 python/databricks/bundles/secret_scopes/_models/lifecycle.py create mode 100644 python/databricks/bundles/secret_scopes/_models/scope_backend_type.py create mode 100644 python/databricks/bundles/secret_scopes/_models/secret_scope.py create mode 100644 python/databricks/bundles/secret_scopes/_models/secret_scope_permission.py create mode 100644 python/databricks/bundles/secret_scopes/_models/secret_scope_permission_level.py create mode 100644 python/databricks/bundles/sql_warehouses/__init__.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/channel.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/channel_name.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/create_warehouse_request_warehouse_type.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/endpoint_tag_pair.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/endpoint_tags.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/lifecycle_with_started.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/spot_instance_policy.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/sql_warehouse.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/sql_warehouse_permission.py create mode 100644 python/databricks/bundles/sql_warehouses/_models/warehouse_permission_level.py create mode 100644 python/databricks/bundles/synced_database_tables/__init__.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/lifecycle.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/new_pipeline_spec.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/synced_database_table.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/synced_table_scheduling_policy.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/synced_table_spec.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/synced_table_spec_pg_specific_type.py create mode 100644 python/databricks/bundles/synced_database_tables/_models/synced_table_spec_type_override.py create mode 100644 python/databricks/bundles/vector_search_endpoints/__init__.py create mode 100644 python/databricks/bundles/vector_search_endpoints/_models/endpoint_type.py create mode 100644 python/databricks/bundles/vector_search_endpoints/_models/lifecycle.py create mode 100644 python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint.py create mode 100644 python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission.py create mode 100644 python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission_level.py create mode 100644 python/databricks/bundles/vector_search_indexes/__init__.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/delta_sync_vector_index_spec_request.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/direct_access_vector_index_spec.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/embedding_source_column.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/embedding_vector_column.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/index_subtype.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/lifecycle.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/pipeline_type.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/privilege.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/privilege_assignment.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/vector_index_type.py create mode 100644 python/databricks/bundles/vector_search_indexes/_models/vector_search_index.py create mode 100644 python/databricks_tests/core/_generated/apps.py create mode 100644 python/databricks_tests/core/_generated/clusters.py create mode 100644 python/databricks_tests/core/_generated/database_catalogs.py create mode 100644 python/databricks_tests/core/_generated/database_instances.py create mode 100644 python/databricks_tests/core/_generated/experiments.py create mode 100644 python/databricks_tests/core/_generated/external_locations.py create mode 100644 python/databricks_tests/core/_generated/instance_pools.py create mode 100644 python/databricks_tests/core/_generated/job_runs.py create mode 100644 python/databricks_tests/core/_generated/model_serving_endpoints.py create mode 100644 python/databricks_tests/core/_generated/models.py create mode 100644 python/databricks_tests/core/_generated/quality_monitors.py create mode 100644 python/databricks_tests/core/_generated/registered_models.py create mode 100644 python/databricks_tests/core/_generated/secret_scopes.py create mode 100644 python/databricks_tests/core/_generated/sql_warehouses.py create mode 100644 python/databricks_tests/core/_generated/synced_database_tables.py create mode 100644 python/databricks_tests/core/_generated/vector_search_endpoints.py create mode 100644 python/databricks_tests/core/_generated/vector_search_indexes.py diff --git a/python/codegen/codegen/packages.py b/python/codegen/codegen/packages.py index 772ce4b4c5e..c3741c93907 100644 --- a/python/codegen/codegen/packages.py +++ b/python/codegen/codegen/packages.py @@ -1,16 +1,65 @@ +import json import re +from pathlib import Path from typing import Optional -# All supported resource types and their namespace -RESOURCE_NAMESPACE = { - "resources.Job": "jobs", - "resources.Pipeline": "pipelines", - "resources.Catalog": "catalogs", - "resources.Schema": "schemas", - "resources.Volume": "volumes", - "resources.Alert": "alerts", +# Resources with a field type the generator can't model yet. Excluded until +# support for that type is added. +RESOURCE_DENYLIST = { + "resources.ClusterPolicy", # interface{} + "resources.Dashboard", # interface{} + "resources.GenieSpace", # interface{} + "resources.Secret", # time.Time } +# Only GA and public-preview resources are generated; later stages may still change. +_EXCLUDED_RESOURCE_STAGES = {"PUBLIC_BETA", "PRIVATE_PREVIEW"} + + +def _resource_stage(config: dict, type_name: str) -> Optional[str]: + node = config.get(type_name, {}) + if "x-databricks-launch-stage" in node: + return node["x-databricks-launch-stage"] + for option in node.get("oneOf", []): + if "x-databricks-launch-stage" in option: + return option["x-databricks-launch-stage"] + return None + + +def _load_resource_namespace() -> dict[str, str]: + """Map each generated resource type to its bundle section (plural) name. + + Derived from the Resources struct in the bundle schema so it stays in sync + with the Go source, minus denylisted and non-public resources. + """ + path = Path(__file__).parent / ".." / ".." / ".." / "bundle/schema/jsonschema.json" + bundle = json.load(path.open())["$defs"]["github.com"]["databricks"]["cli"][ + "bundle" + ] + config = bundle["config"] + properties = bundle["config.Resources"]["oneOf"][0]["properties"] + + namespace = {} + for plural, prop in properties.items(): + ref = prop.get("$ref") + if ref is None: + options = prop.get("oneOf", []) + prop.get("anyOf", []) + ref = next(o["$ref"] for o in options if o.get("$ref")) + type_name = ref.split("/")[-1] + + if type_name in RESOURCE_DENYLIST: + continue + if _resource_stage(config, type_name) in _EXCLUDED_RESOURCE_STAGES: + continue + + namespace[type_name] = plural + + return namespace + + +# All supported resource types and their namespace. +RESOURCE_NAMESPACE = _load_resource_namespace() + RESOURCE_TYPES = list(RESOURCE_NAMESPACE.keys()) RENAMES = { diff --git a/python/databricks/bundles/apps/__init__.py b/python/databricks/bundles/apps/__init__.py new file mode 100644 index 00000000000..7b92e6d61bb --- /dev/null +++ b/python/databricks/bundles/apps/__init__.py @@ -0,0 +1,237 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "App", + "AppConfig", + "AppConfigDict", + "AppConfigParam", + "AppDict", + "AppEnvVar", + "AppEnvVarDict", + "AppEnvVarParam", + "AppParam", + "AppPermission", + "AppPermissionDict", + "AppPermissionLevel", + "AppPermissionLevelParam", + "AppPermissionParam", + "AppResource", + "AppResourceApp", + "AppResourceAppAppPermission", + "AppResourceAppAppPermissionParam", + "AppResourceAppDict", + "AppResourceAppParam", + "AppResourceDatabase", + "AppResourceDatabaseDatabasePermission", + "AppResourceDatabaseDatabasePermissionParam", + "AppResourceDatabaseDict", + "AppResourceDatabaseParam", + "AppResourceDict", + "AppResourceExperiment", + "AppResourceExperimentDict", + "AppResourceExperimentExperimentPermission", + "AppResourceExperimentExperimentPermissionParam", + "AppResourceExperimentParam", + "AppResourceGenieSpace", + "AppResourceGenieSpaceDict", + "AppResourceGenieSpaceGenieSpacePermission", + "AppResourceGenieSpaceGenieSpacePermissionParam", + "AppResourceGenieSpaceParam", + "AppResourceJob", + "AppResourceJobDict", + "AppResourceJobJobPermission", + "AppResourceJobJobPermissionParam", + "AppResourceJobParam", + "AppResourceParam", + "AppResourcePostgres", + "AppResourcePostgresDict", + "AppResourcePostgresParam", + "AppResourcePostgresPostgresPermission", + "AppResourcePostgresPostgresPermissionParam", + "AppResourceSecret", + "AppResourceSecretDict", + "AppResourceSecretParam", + "AppResourceSecretSecretPermission", + "AppResourceSecretSecretPermissionParam", + "AppResourceServingEndpoint", + "AppResourceServingEndpointDict", + "AppResourceServingEndpointParam", + "AppResourceServingEndpointServingEndpointPermission", + "AppResourceServingEndpointServingEndpointPermissionParam", + "AppResourceSqlWarehouse", + "AppResourceSqlWarehouseDict", + "AppResourceSqlWarehouseParam", + "AppResourceSqlWarehouseSqlWarehousePermission", + "AppResourceSqlWarehouseSqlWarehousePermissionParam", + "AppResourceUcSecurable", + "AppResourceUcSecurableDict", + "AppResourceUcSecurableParam", + "AppResourceUcSecurableUcSecurablePermission", + "AppResourceUcSecurableUcSecurablePermissionParam", + "AppResourceUcSecurableUcSecurableType", + "AppResourceUcSecurableUcSecurableTypeParam", + "ComputeSize", + "ComputeSizeParam", + "GitRepository", + "GitRepositoryDict", + "GitRepositoryParam", + "GitSource", + "GitSourceDict", + "GitSourceParam", + "LifecycleWithStarted", + "LifecycleWithStartedDict", + "LifecycleWithStartedParam", + "TelemetryExportDestination", + "TelemetryExportDestinationDict", + "TelemetryExportDestinationParam", + "UnityCatalog", + "UnityCatalogDict", + "UnityCatalogParam", +] + + +from databricks.bundles.apps._models.app import App, AppDict, AppParam +from databricks.bundles.apps._models.app_config import ( + AppConfig, + AppConfigDict, + AppConfigParam, +) +from databricks.bundles.apps._models.app_env_var import ( + AppEnvVar, + AppEnvVarDict, + AppEnvVarParam, +) +from databricks.bundles.apps._models.app_permission import ( + AppPermission, + AppPermissionDict, + AppPermissionParam, +) +from databricks.bundles.apps._models.app_permission_level import ( + AppPermissionLevel, + AppPermissionLevelParam, +) +from databricks.bundles.apps._models.app_resource import ( + AppResource, + AppResourceDict, + AppResourceParam, +) +from databricks.bundles.apps._models.app_resource_app import ( + AppResourceApp, + AppResourceAppDict, + AppResourceAppParam, +) +from databricks.bundles.apps._models.app_resource_app_app_permission import ( + AppResourceAppAppPermission, + AppResourceAppAppPermissionParam, +) +from databricks.bundles.apps._models.app_resource_database import ( + AppResourceDatabase, + AppResourceDatabaseDict, + AppResourceDatabaseParam, +) +from databricks.bundles.apps._models.app_resource_database_database_permission import ( + AppResourceDatabaseDatabasePermission, + AppResourceDatabaseDatabasePermissionParam, +) +from databricks.bundles.apps._models.app_resource_experiment import ( + AppResourceExperiment, + AppResourceExperimentDict, + AppResourceExperimentParam, +) +from databricks.bundles.apps._models.app_resource_experiment_experiment_permission import ( + AppResourceExperimentExperimentPermission, + AppResourceExperimentExperimentPermissionParam, +) +from databricks.bundles.apps._models.app_resource_genie_space import ( + AppResourceGenieSpace, + AppResourceGenieSpaceDict, + AppResourceGenieSpaceParam, +) +from databricks.bundles.apps._models.app_resource_genie_space_genie_space_permission import ( + AppResourceGenieSpaceGenieSpacePermission, + AppResourceGenieSpaceGenieSpacePermissionParam, +) +from databricks.bundles.apps._models.app_resource_job import ( + AppResourceJob, + AppResourceJobDict, + AppResourceJobParam, +) +from databricks.bundles.apps._models.app_resource_job_job_permission import ( + AppResourceJobJobPermission, + AppResourceJobJobPermissionParam, +) +from databricks.bundles.apps._models.app_resource_postgres import ( + AppResourcePostgres, + AppResourcePostgresDict, + AppResourcePostgresParam, +) +from databricks.bundles.apps._models.app_resource_postgres_postgres_permission import ( + AppResourcePostgresPostgresPermission, + AppResourcePostgresPostgresPermissionParam, +) +from databricks.bundles.apps._models.app_resource_secret import ( + AppResourceSecret, + AppResourceSecretDict, + AppResourceSecretParam, +) +from databricks.bundles.apps._models.app_resource_secret_secret_permission import ( + AppResourceSecretSecretPermission, + AppResourceSecretSecretPermissionParam, +) +from databricks.bundles.apps._models.app_resource_serving_endpoint import ( + AppResourceServingEndpoint, + AppResourceServingEndpointDict, + AppResourceServingEndpointParam, +) +from databricks.bundles.apps._models.app_resource_serving_endpoint_serving_endpoint_permission import ( + AppResourceServingEndpointServingEndpointPermission, + AppResourceServingEndpointServingEndpointPermissionParam, +) +from databricks.bundles.apps._models.app_resource_sql_warehouse import ( + AppResourceSqlWarehouse, + AppResourceSqlWarehouseDict, + AppResourceSqlWarehouseParam, +) +from databricks.bundles.apps._models.app_resource_sql_warehouse_sql_warehouse_permission import ( + AppResourceSqlWarehouseSqlWarehousePermission, + AppResourceSqlWarehouseSqlWarehousePermissionParam, +) +from databricks.bundles.apps._models.app_resource_uc_securable import ( + AppResourceUcSecurable, + AppResourceUcSecurableDict, + AppResourceUcSecurableParam, +) +from databricks.bundles.apps._models.app_resource_uc_securable_uc_securable_permission import ( + AppResourceUcSecurableUcSecurablePermission, + AppResourceUcSecurableUcSecurablePermissionParam, +) +from databricks.bundles.apps._models.app_resource_uc_securable_uc_securable_type import ( + AppResourceUcSecurableUcSecurableType, + AppResourceUcSecurableUcSecurableTypeParam, +) +from databricks.bundles.apps._models.compute_size import ComputeSize, ComputeSizeParam +from databricks.bundles.apps._models.git_repository import ( + GitRepository, + GitRepositoryDict, + GitRepositoryParam, +) +from databricks.bundles.apps._models.git_source import ( + GitSource, + GitSourceDict, + GitSourceParam, +) +from databricks.bundles.apps._models.lifecycle_with_started import ( + LifecycleWithStarted, + LifecycleWithStartedDict, + LifecycleWithStartedParam, +) +from databricks.bundles.apps._models.telemetry_export_destination import ( + TelemetryExportDestination, + TelemetryExportDestinationDict, + TelemetryExportDestinationParam, +) +from databricks.bundles.apps._models.unity_catalog import ( + UnityCatalog, + UnityCatalogDict, + UnityCatalogParam, +) diff --git a/python/databricks/bundles/apps/_models/app.py b/python/databricks/bundles/apps/_models/app.py new file mode 100644 index 00000000000..a700c7b26ac --- /dev/null +++ b/python/databricks/bundles/apps/_models/app.py @@ -0,0 +1,260 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_config import ( + AppConfig, + AppConfigParam, +) +from databricks.bundles.apps._models.app_permission import ( + AppPermission, + AppPermissionParam, +) +from databricks.bundles.apps._models.app_resource import AppResource, AppResourceParam +from databricks.bundles.apps._models.compute_size import ComputeSize, ComputeSizeParam +from databricks.bundles.apps._models.git_repository import ( + GitRepository, + GitRepositoryParam, +) +from databricks.bundles.apps._models.git_source import GitSource, GitSourceParam +from databricks.bundles.apps._models.lifecycle_with_started import ( + LifecycleWithStarted, + LifecycleWithStartedParam, +) +from databricks.bundles.apps._models.telemetry_export_destination import ( + TelemetryExportDestination, + TelemetryExportDestinationParam, +) +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class App(Resource): + """""" + + name: VariableOr[str] + """ + The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. + It must be unique within the workspace. + """ + + budget_policy_id: VariableOrOptional[str] = None + """ + [Public Preview] + """ + + compute_max_instances: VariableOrOptional[int] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Maximum number of app instances. Must be set together with `compute_min_instances`. + """ + + compute_min_instances: VariableOrOptional[int] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Minimum number of app instances. Must be set together with `compute_max_instances`. + """ + + compute_size: VariableOrOptional[ComputeSize] = None + + config: VariableOrOptional[AppConfig] = None + + description: VariableOrOptional[str] = None + """ + The description of the app. + """ + + forward_user_access_token: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Forward the user's access token to the app. Requires stopping and starting app compute to take effect. + """ + + git_repository: VariableOrOptional[GitRepository] = None + """ + Git repository configuration for app deployments. When specified, deployments can + reference code from this repository by providing only the git reference (branch, tag, or commit). + """ + + git_source: VariableOrOptional[GitSource] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] Git source configuration for app deployments. Specifies which git reference (branch, tag, or commit) + to use when deploying the app. Used in conjunction with git_repository to deploy code directly from git. + The source_code_path within git_source specifies the relative path to the app code within the repository. + """ + + lifecycle: VariableOrOptional[LifecycleWithStarted] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[AppPermission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + resources: VariableOrList[AppResource] = field(default_factory=list) + """ + Resources for the app. + """ + + source_code_path: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] + """ + + space: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Name of the space this app belongs to. + """ + + telemetry_export_destinations: VariableOrList[TelemetryExportDestination] = field( + default_factory=list + ) + """ + [Public Preview] + """ + + usage_policy_id: VariableOrOptional[str] = None + """ + [Public Preview] + """ + + user_api_scopes: VariableOrList[str] = field(default_factory=list) + """ + [Public Preview] + """ + + @classmethod + def from_dict(cls, value: "AppDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppDict": + return _transform_to_json_value(self) # type:ignore + + +class AppDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. + It must be unique within the workspace. + """ + + budget_policy_id: VariableOrOptional[str] + """ + [Public Preview] + """ + + compute_max_instances: VariableOrOptional[int] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Maximum number of app instances. Must be set together with `compute_min_instances`. + """ + + compute_min_instances: VariableOrOptional[int] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Minimum number of app instances. Must be set together with `compute_max_instances`. + """ + + compute_size: VariableOrOptional[ComputeSizeParam] + + config: VariableOrOptional[AppConfigParam] + + description: VariableOrOptional[str] + """ + The description of the app. + """ + + forward_user_access_token: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Forward the user's access token to the app. Requires stopping and starting app compute to take effect. + """ + + git_repository: VariableOrOptional[GitRepositoryParam] + """ + Git repository configuration for app deployments. When specified, deployments can + reference code from this repository by providing only the git reference (branch, tag, or commit). + """ + + git_source: VariableOrOptional[GitSourceParam] + """ + :meta private: [EXPERIMENTAL] + + [Beta] Git source configuration for app deployments. Specifies which git reference (branch, tag, or commit) + to use when deploying the app. Used in conjunction with git_repository to deploy code directly from git. + The source_code_path within git_source specifies the relative path to the app code within the repository. + """ + + lifecycle: VariableOrOptional[LifecycleWithStartedParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[AppPermissionParam] + """ + The permissions to apply to this resource. + """ + + resources: VariableOrList[AppResourceParam] + """ + Resources for the app. + """ + + source_code_path: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] + """ + + space: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Name of the space this app belongs to. + """ + + telemetry_export_destinations: VariableOrList[TelemetryExportDestinationParam] + """ + [Public Preview] + """ + + usage_policy_id: VariableOrOptional[str] + """ + [Public Preview] + """ + + user_api_scopes: VariableOrList[str] + """ + [Public Preview] + """ + + +AppParam = AppDict | App diff --git a/python/databricks/bundles/apps/_models/app_config.py b/python/databricks/bundles/apps/_models/app_config.py new file mode 100644 index 00000000000..e8a8f5fd70e --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_config.py @@ -0,0 +1,39 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_env_var import AppEnvVar, AppEnvVarParam +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppConfig: + """""" + + command: VariableOrList[str] = field(default_factory=list) + + env: VariableOrList[AppEnvVar] = field(default_factory=list) + + @classmethod + def from_dict(cls, value: "AppConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class AppConfigDict(TypedDict, total=False): + """""" + + command: VariableOrList[str] + + env: VariableOrList[AppEnvVarParam] + + +AppConfigParam = AppConfigDict | AppConfig diff --git a/python/databricks/bundles/apps/_models/app_env_var.py b/python/databricks/bundles/apps/_models/app_env_var.py new file mode 100644 index 00000000000..a0afec4223a --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_env_var.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppEnvVar: + """""" + + name: VariableOr[str] + + value: VariableOrOptional[str] = None + + value_from: VariableOrOptional[str] = None + + @classmethod + def from_dict(cls, value: "AppEnvVarDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppEnvVarDict": + return _transform_to_json_value(self) # type:ignore + + +class AppEnvVarDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + + value: VariableOrOptional[str] + + value_from: VariableOrOptional[str] + + +AppEnvVarParam = AppEnvVarDict | AppEnvVar diff --git a/python/databricks/bundles/apps/_models/app_permission.py b/python/databricks/bundles/apps/_models/app_permission.py new file mode 100644 index 00000000000..f04638d0df2 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_permission_level import ( + AppPermissionLevel, + AppPermissionLevelParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppPermission: + """""" + + level: VariableOr[AppPermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "AppPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class AppPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[AppPermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +AppPermissionParam = AppPermissionDict | AppPermission diff --git a/python/databricks/bundles/apps/_models/app_permission_level.py b/python/databricks/bundles/apps/_models/app_permission_level.py new file mode 100644 index 00000000000..a951c137ea7 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_permission_level.py @@ -0,0 +1,16 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppPermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_USE = "CAN_USE" + + +AppPermissionLevelParam = Literal["CAN_MANAGE", "CAN_USE"] | AppPermissionLevel diff --git a/python/databricks/bundles/apps/_models/app_resource.py b/python/databricks/bundles/apps/_models/app_resource.py new file mode 100644 index 00000000000..cc96b083c2c --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource.py @@ -0,0 +1,130 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_app import ( + AppResourceApp, + AppResourceAppParam, +) +from databricks.bundles.apps._models.app_resource_database import ( + AppResourceDatabase, + AppResourceDatabaseParam, +) +from databricks.bundles.apps._models.app_resource_experiment import ( + AppResourceExperiment, + AppResourceExperimentParam, +) +from databricks.bundles.apps._models.app_resource_genie_space import ( + AppResourceGenieSpace, + AppResourceGenieSpaceParam, +) +from databricks.bundles.apps._models.app_resource_job import ( + AppResourceJob, + AppResourceJobParam, +) +from databricks.bundles.apps._models.app_resource_postgres import ( + AppResourcePostgres, + AppResourcePostgresParam, +) +from databricks.bundles.apps._models.app_resource_secret import ( + AppResourceSecret, + AppResourceSecretParam, +) +from databricks.bundles.apps._models.app_resource_serving_endpoint import ( + AppResourceServingEndpoint, + AppResourceServingEndpointParam, +) +from databricks.bundles.apps._models.app_resource_sql_warehouse import ( + AppResourceSqlWarehouse, + AppResourceSqlWarehouseParam, +) +from databricks.bundles.apps._models.app_resource_uc_securable import ( + AppResourceUcSecurable, + AppResourceUcSecurableParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResource: + """""" + + name: VariableOr[str] + """ + Name of the App Resource. + """ + + app: VariableOrOptional[AppResourceApp] = None + + database: VariableOrOptional[AppResourceDatabase] = None + + description: VariableOrOptional[str] = None + """ + Description of the App Resource. + """ + + experiment: VariableOrOptional[AppResourceExperiment] = None + + genie_space: VariableOrOptional[AppResourceGenieSpace] = None + + job: VariableOrOptional[AppResourceJob] = None + + postgres: VariableOrOptional[AppResourcePostgres] = None + + secret: VariableOrOptional[AppResourceSecret] = None + + serving_endpoint: VariableOrOptional[AppResourceServingEndpoint] = None + + sql_warehouse: VariableOrOptional[AppResourceSqlWarehouse] = None + + uc_securable: VariableOrOptional[AppResourceUcSecurable] = None + + @classmethod + def from_dict(cls, value: "AppResourceDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + Name of the App Resource. + """ + + app: VariableOrOptional[AppResourceAppParam] + + database: VariableOrOptional[AppResourceDatabaseParam] + + description: VariableOrOptional[str] + """ + Description of the App Resource. + """ + + experiment: VariableOrOptional[AppResourceExperimentParam] + + genie_space: VariableOrOptional[AppResourceGenieSpaceParam] + + job: VariableOrOptional[AppResourceJobParam] + + postgres: VariableOrOptional[AppResourcePostgresParam] + + secret: VariableOrOptional[AppResourceSecretParam] + + serving_endpoint: VariableOrOptional[AppResourceServingEndpointParam] + + sql_warehouse: VariableOrOptional[AppResourceSqlWarehouseParam] + + uc_securable: VariableOrOptional[AppResourceUcSecurableParam] + + +AppResourceParam = AppResourceDict | AppResource diff --git a/python/databricks/bundles/apps/_models/app_resource_app.py b/python/databricks/bundles/apps/_models/app_resource_app.py new file mode 100644 index 00000000000..a7a05689c2e --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_app.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_app_app_permission import ( + AppResourceAppAppPermission, + AppResourceAppAppPermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceApp: + """""" + + name: VariableOrOptional[str] = None + + permission: VariableOrOptional[AppResourceAppAppPermission] = None + + @classmethod + def from_dict(cls, value: "AppResourceAppDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceAppDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceAppDict(TypedDict, total=False): + """""" + + name: VariableOrOptional[str] + + permission: VariableOrOptional[AppResourceAppAppPermissionParam] + + +AppResourceAppParam = AppResourceAppDict | AppResourceApp diff --git a/python/databricks/bundles/apps/_models/app_resource_app_app_permission.py b/python/databricks/bundles/apps/_models/app_resource_app_app_permission.py new file mode 100644 index 00000000000..a58dca414e4 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_app_app_permission.py @@ -0,0 +1,11 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceAppAppPermission(Enum): + CAN_USE = "CAN_USE" + + +AppResourceAppAppPermissionParam = Literal["CAN_USE"] | AppResourceAppAppPermission diff --git a/python/databricks/bundles/apps/_models/app_resource_database.py b/python/databricks/bundles/apps/_models/app_resource_database.py new file mode 100644 index 00000000000..b29ce973105 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_database.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_database_database_permission import ( + AppResourceDatabaseDatabasePermission, + AppResourceDatabaseDatabasePermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceDatabase: + """""" + + database_name: VariableOr[str] + + instance_name: VariableOr[str] + + permission: VariableOr[AppResourceDatabaseDatabasePermission] + + @classmethod + def from_dict(cls, value: "AppResourceDatabaseDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceDatabaseDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceDatabaseDict(TypedDict, total=False): + """""" + + database_name: VariableOr[str] + + instance_name: VariableOr[str] + + permission: VariableOr[AppResourceDatabaseDatabasePermissionParam] + + +AppResourceDatabaseParam = AppResourceDatabaseDict | AppResourceDatabase diff --git a/python/databricks/bundles/apps/_models/app_resource_database_database_permission.py b/python/databricks/bundles/apps/_models/app_resource_database_database_permission.py new file mode 100644 index 00000000000..447d015a1c2 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_database_database_permission.py @@ -0,0 +1,13 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceDatabaseDatabasePermission(Enum): + CAN_CONNECT_AND_CREATE = "CAN_CONNECT_AND_CREATE" + + +AppResourceDatabaseDatabasePermissionParam = ( + Literal["CAN_CONNECT_AND_CREATE"] | AppResourceDatabaseDatabasePermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_experiment.py b/python/databricks/bundles/apps/_models/app_resource_experiment.py new file mode 100644 index 00000000000..e69d4be1a17 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_experiment.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_experiment_experiment_permission import ( + AppResourceExperimentExperimentPermission, + AppResourceExperimentExperimentPermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceExperiment: + """""" + + experiment_id: VariableOr[str] + + permission: VariableOr[AppResourceExperimentExperimentPermission] + + @classmethod + def from_dict(cls, value: "AppResourceExperimentDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceExperimentDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceExperimentDict(TypedDict, total=False): + """""" + + experiment_id: VariableOr[str] + + permission: VariableOr[AppResourceExperimentExperimentPermissionParam] + + +AppResourceExperimentParam = AppResourceExperimentDict | AppResourceExperiment diff --git a/python/databricks/bundles/apps/_models/app_resource_experiment_experiment_permission.py b/python/databricks/bundles/apps/_models/app_resource_experiment_experiment_permission.py new file mode 100644 index 00000000000..230b8d5c06e --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_experiment_experiment_permission.py @@ -0,0 +1,16 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceExperimentExperimentPermission(Enum): + CAN_MANAGE = "CAN_MANAGE" + CAN_EDIT = "CAN_EDIT" + CAN_READ = "CAN_READ" + + +AppResourceExperimentExperimentPermissionParam = ( + Literal["CAN_MANAGE", "CAN_EDIT", "CAN_READ"] + | AppResourceExperimentExperimentPermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_genie_space.py b/python/databricks/bundles/apps/_models/app_resource_genie_space.py new file mode 100644 index 00000000000..0cfdaf316f4 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_genie_space.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_genie_space_genie_space_permission import ( + AppResourceGenieSpaceGenieSpacePermission, + AppResourceGenieSpaceGenieSpacePermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceGenieSpace: + """""" + + name: VariableOr[str] + + permission: VariableOr[AppResourceGenieSpaceGenieSpacePermission] + + space_id: VariableOr[str] + + @classmethod + def from_dict(cls, value: "AppResourceGenieSpaceDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceGenieSpaceDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceGenieSpaceDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + + permission: VariableOr[AppResourceGenieSpaceGenieSpacePermissionParam] + + space_id: VariableOr[str] + + +AppResourceGenieSpaceParam = AppResourceGenieSpaceDict | AppResourceGenieSpace diff --git a/python/databricks/bundles/apps/_models/app_resource_genie_space_genie_space_permission.py b/python/databricks/bundles/apps/_models/app_resource_genie_space_genie_space_permission.py new file mode 100644 index 00000000000..312897a8cce --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_genie_space_genie_space_permission.py @@ -0,0 +1,17 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceGenieSpaceGenieSpacePermission(Enum): + CAN_MANAGE = "CAN_MANAGE" + CAN_EDIT = "CAN_EDIT" + CAN_RUN = "CAN_RUN" + CAN_VIEW = "CAN_VIEW" + + +AppResourceGenieSpaceGenieSpacePermissionParam = ( + Literal["CAN_MANAGE", "CAN_EDIT", "CAN_RUN", "CAN_VIEW"] + | AppResourceGenieSpaceGenieSpacePermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_job.py b/python/databricks/bundles/apps/_models/app_resource_job.py new file mode 100644 index 00000000000..08ca1be6cfc --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_job.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_job_job_permission import ( + AppResourceJobJobPermission, + AppResourceJobJobPermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceJob: + """""" + + id: VariableOr[str] + """ + Id of the job to grant permission on. + """ + + permission: VariableOr[AppResourceJobJobPermission] + """ + Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". + """ + + @classmethod + def from_dict(cls, value: "AppResourceJobDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceJobDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceJobDict(TypedDict, total=False): + """""" + + id: VariableOr[str] + """ + Id of the job to grant permission on. + """ + + permission: VariableOr[AppResourceJobJobPermissionParam] + """ + Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". + """ + + +AppResourceJobParam = AppResourceJobDict | AppResourceJob diff --git a/python/databricks/bundles/apps/_models/app_resource_job_job_permission.py b/python/databricks/bundles/apps/_models/app_resource_job_job_permission.py new file mode 100644 index 00000000000..29f08d0aab1 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_job_job_permission.py @@ -0,0 +1,17 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceJobJobPermission(Enum): + CAN_MANAGE = "CAN_MANAGE" + IS_OWNER = "IS_OWNER" + CAN_MANAGE_RUN = "CAN_MANAGE_RUN" + CAN_VIEW = "CAN_VIEW" + + +AppResourceJobJobPermissionParam = ( + Literal["CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW"] + | AppResourceJobJobPermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_postgres.py b/python/databricks/bundles/apps/_models/app_resource_postgres.py new file mode 100644 index 00000000000..0d3b6e39b17 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_postgres.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_postgres_postgres_permission import ( + AppResourcePostgresPostgresPermission, + AppResourcePostgresPostgresPermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourcePostgres: + """""" + + branch: VariableOrOptional[str] = None + + database: VariableOrOptional[str] = None + + permission: VariableOrOptional[AppResourcePostgresPostgresPermission] = None + + @classmethod + def from_dict(cls, value: "AppResourcePostgresDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourcePostgresDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourcePostgresDict(TypedDict, total=False): + """""" + + branch: VariableOrOptional[str] + + database: VariableOrOptional[str] + + permission: VariableOrOptional[AppResourcePostgresPostgresPermissionParam] + + +AppResourcePostgresParam = AppResourcePostgresDict | AppResourcePostgres diff --git a/python/databricks/bundles/apps/_models/app_resource_postgres_postgres_permission.py b/python/databricks/bundles/apps/_models/app_resource_postgres_postgres_permission.py new file mode 100644 index 00000000000..85657edfc35 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_postgres_postgres_permission.py @@ -0,0 +1,13 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourcePostgresPostgresPermission(Enum): + CAN_CONNECT_AND_CREATE = "CAN_CONNECT_AND_CREATE" + + +AppResourcePostgresPostgresPermissionParam = ( + Literal["CAN_CONNECT_AND_CREATE"] | AppResourcePostgresPostgresPermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_secret.py b/python/databricks/bundles/apps/_models/app_resource_secret.py new file mode 100644 index 00000000000..3ecca5e2199 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_secret.py @@ -0,0 +1,64 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_secret_secret_permission import ( + AppResourceSecretSecretPermission, + AppResourceSecretSecretPermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceSecret: + """""" + + key: VariableOr[str] + """ + Key of the secret to grant permission on. + """ + + permission: VariableOr[AppResourceSecretSecretPermission] + """ + Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". + """ + + scope: VariableOr[str] + """ + Scope of the secret to grant permission on. + """ + + @classmethod + def from_dict(cls, value: "AppResourceSecretDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceSecretDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceSecretDict(TypedDict, total=False): + """""" + + key: VariableOr[str] + """ + Key of the secret to grant permission on. + """ + + permission: VariableOr[AppResourceSecretSecretPermissionParam] + """ + Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". + """ + + scope: VariableOr[str] + """ + Scope of the secret to grant permission on. + """ + + +AppResourceSecretParam = AppResourceSecretDict | AppResourceSecret diff --git a/python/databricks/bundles/apps/_models/app_resource_secret_secret_permission.py b/python/databricks/bundles/apps/_models/app_resource_secret_secret_permission.py new file mode 100644 index 00000000000..c30b6d977ff --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_secret_secret_permission.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceSecretSecretPermission(Enum): + """ + Permission to grant on the secret scope. Supported permissions are: "READ", "WRITE", "MANAGE". + """ + + READ = "READ" + WRITE = "WRITE" + MANAGE = "MANAGE" + + +AppResourceSecretSecretPermissionParam = ( + Literal["READ", "WRITE", "MANAGE"] | AppResourceSecretSecretPermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_serving_endpoint.py b/python/databricks/bundles/apps/_models/app_resource_serving_endpoint.py new file mode 100644 index 00000000000..ee444cd7692 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_serving_endpoint.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_serving_endpoint_serving_endpoint_permission import ( + AppResourceServingEndpointServingEndpointPermission, + AppResourceServingEndpointServingEndpointPermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceServingEndpoint: + """""" + + name: VariableOr[str] + """ + Name of the serving endpoint to grant permission on. + """ + + permission: VariableOr[AppResourceServingEndpointServingEndpointPermission] + """ + Permission to grant on the serving endpoint. Supported permissions are: "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". + """ + + @classmethod + def from_dict(cls, value: "AppResourceServingEndpointDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceServingEndpointDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceServingEndpointDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + Name of the serving endpoint to grant permission on. + """ + + permission: VariableOr[AppResourceServingEndpointServingEndpointPermissionParam] + """ + Permission to grant on the serving endpoint. Supported permissions are: "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". + """ + + +AppResourceServingEndpointParam = ( + AppResourceServingEndpointDict | AppResourceServingEndpoint +) diff --git a/python/databricks/bundles/apps/_models/app_resource_serving_endpoint_serving_endpoint_permission.py b/python/databricks/bundles/apps/_models/app_resource_serving_endpoint_serving_endpoint_permission.py new file mode 100644 index 00000000000..abfe5e63be0 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_serving_endpoint_serving_endpoint_permission.py @@ -0,0 +1,16 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceServingEndpointServingEndpointPermission(Enum): + CAN_MANAGE = "CAN_MANAGE" + CAN_QUERY = "CAN_QUERY" + CAN_VIEW = "CAN_VIEW" + + +AppResourceServingEndpointServingEndpointPermissionParam = ( + Literal["CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"] + | AppResourceServingEndpointServingEndpointPermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_sql_warehouse.py b/python/databricks/bundles/apps/_models/app_resource_sql_warehouse.py new file mode 100644 index 00000000000..691528a0450 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_sql_warehouse.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_sql_warehouse_sql_warehouse_permission import ( + AppResourceSqlWarehouseSqlWarehousePermission, + AppResourceSqlWarehouseSqlWarehousePermissionParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceSqlWarehouse: + """""" + + id: VariableOr[str] + """ + Id of the SQL warehouse to grant permission on. + """ + + permission: VariableOr[AppResourceSqlWarehouseSqlWarehousePermission] + """ + Permission to grant on the SQL warehouse. Supported permissions are: "CAN_MANAGE", "CAN_USE", "IS_OWNER". + """ + + @classmethod + def from_dict(cls, value: "AppResourceSqlWarehouseDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceSqlWarehouseDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceSqlWarehouseDict(TypedDict, total=False): + """""" + + id: VariableOr[str] + """ + Id of the SQL warehouse to grant permission on. + """ + + permission: VariableOr[AppResourceSqlWarehouseSqlWarehousePermissionParam] + """ + Permission to grant on the SQL warehouse. Supported permissions are: "CAN_MANAGE", "CAN_USE", "IS_OWNER". + """ + + +AppResourceSqlWarehouseParam = AppResourceSqlWarehouseDict | AppResourceSqlWarehouse diff --git a/python/databricks/bundles/apps/_models/app_resource_sql_warehouse_sql_warehouse_permission.py b/python/databricks/bundles/apps/_models/app_resource_sql_warehouse_sql_warehouse_permission.py new file mode 100644 index 00000000000..ceb417a6edb --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_sql_warehouse_sql_warehouse_permission.py @@ -0,0 +1,16 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceSqlWarehouseSqlWarehousePermission(Enum): + CAN_MANAGE = "CAN_MANAGE" + CAN_USE = "CAN_USE" + IS_OWNER = "IS_OWNER" + + +AppResourceSqlWarehouseSqlWarehousePermissionParam = ( + Literal["CAN_MANAGE", "CAN_USE", "IS_OWNER"] + | AppResourceSqlWarehouseSqlWarehousePermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_uc_securable.py b/python/databricks/bundles/apps/_models/app_resource_uc_securable.py new file mode 100644 index 00000000000..196b2396592 --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_uc_securable.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.app_resource_uc_securable_uc_securable_permission import ( + AppResourceUcSecurableUcSecurablePermission, + AppResourceUcSecurableUcSecurablePermissionParam, +) +from databricks.bundles.apps._models.app_resource_uc_securable_uc_securable_type import ( + AppResourceUcSecurableUcSecurableType, + AppResourceUcSecurableUcSecurableTypeParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AppResourceUcSecurable: + """""" + + permission: VariableOr[AppResourceUcSecurableUcSecurablePermission] + + securable_full_name: VariableOr[str] + + securable_type: VariableOr[AppResourceUcSecurableUcSecurableType] + + @classmethod + def from_dict(cls, value: "AppResourceUcSecurableDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AppResourceUcSecurableDict": + return _transform_to_json_value(self) # type:ignore + + +class AppResourceUcSecurableDict(TypedDict, total=False): + """""" + + permission: VariableOr[AppResourceUcSecurableUcSecurablePermissionParam] + + securable_full_name: VariableOr[str] + + securable_type: VariableOr[AppResourceUcSecurableUcSecurableTypeParam] + + +AppResourceUcSecurableParam = AppResourceUcSecurableDict | AppResourceUcSecurable diff --git a/python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_permission.py b/python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_permission.py new file mode 100644 index 00000000000..bd4ed5005db --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_permission.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceUcSecurableUcSecurablePermission(Enum): + READ_VOLUME = "READ_VOLUME" + WRITE_VOLUME = "WRITE_VOLUME" + SELECT = "SELECT" + EXECUTE = "EXECUTE" + USE_CONNECTION = "USE_CONNECTION" + MODIFY = "MODIFY" + + +AppResourceUcSecurableUcSecurablePermissionParam = ( + Literal[ + "READ_VOLUME", "WRITE_VOLUME", "SELECT", "EXECUTE", "USE_CONNECTION", "MODIFY" + ] + | AppResourceUcSecurableUcSecurablePermission +) diff --git a/python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_type.py b/python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_type.py new file mode 100644 index 00000000000..592496010af --- /dev/null +++ b/python/databricks/bundles/apps/_models/app_resource_uc_securable_uc_securable_type.py @@ -0,0 +1,17 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AppResourceUcSecurableUcSecurableType(Enum): + VOLUME = "VOLUME" + TABLE = "TABLE" + FUNCTION = "FUNCTION" + CONNECTION = "CONNECTION" + + +AppResourceUcSecurableUcSecurableTypeParam = ( + Literal["VOLUME", "TABLE", "FUNCTION", "CONNECTION"] + | AppResourceUcSecurableUcSecurableType +) diff --git a/python/databricks/bundles/apps/_models/compute_size.py b/python/databricks/bundles/apps/_models/compute_size.py new file mode 100644 index 00000000000..4881d034935 --- /dev/null +++ b/python/databricks/bundles/apps/_models/compute_size.py @@ -0,0 +1,13 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ComputeSize(Enum): + MEDIUM = "MEDIUM" + LARGE = "LARGE" + XLARGE = "XLARGE" + + +ComputeSizeParam = Literal["MEDIUM", "LARGE", "XLARGE"] | ComputeSize diff --git a/python/databricks/bundles/apps/_models/git_repository.py b/python/databricks/bundles/apps/_models/git_repository.py new file mode 100644 index 00000000000..1ee7502580d --- /dev/null +++ b/python/databricks/bundles/apps/_models/git_repository.py @@ -0,0 +1,86 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class GitRepository: + """ + Git repository configuration specifying the location of the repository. + """ + + provider: VariableOr[str] + """ + Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, + bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit. + """ + + url: VariableOr[str] + """ + URL of the Git repository. + """ + + auto_deploy: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] When true, automatically deploys the app on push events to the branch configured in + the app's deployment_source.git_source. + """ + + caller_credential_id: VariableOrOptional[int] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] ID of a personal access token Git credential owned by the caller, used to + grant the app's service principal access to this repository. + """ + + @classmethod + def from_dict(cls, value: "GitRepositoryDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "GitRepositoryDict": + return _transform_to_json_value(self) # type:ignore + + +class GitRepositoryDict(TypedDict, total=False): + """""" + + provider: VariableOr[str] + """ + Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, + bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit. + """ + + url: VariableOr[str] + """ + URL of the Git repository. + """ + + auto_deploy: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Beta] When true, automatically deploys the app on push events to the branch configured in + the app's deployment_source.git_source. + """ + + caller_credential_id: VariableOrOptional[int] + """ + :meta private: [EXPERIMENTAL] + + [Beta] ID of a personal access token Git credential owned by the caller, used to + grant the app's service principal access to this repository. + """ + + +GitRepositoryParam = GitRepositoryDict | GitRepository diff --git a/python/databricks/bundles/apps/_models/git_source.py b/python/databricks/bundles/apps/_models/git_source.py new file mode 100644 index 00000000000..93bd61f5aa4 --- /dev/null +++ b/python/databricks/bundles/apps/_models/git_source.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class GitSource: + """ + Complete git source specification including repository location and reference. + """ + + branch: VariableOrOptional[str] = None + """ + Git branch to checkout. + """ + + commit: VariableOrOptional[str] = None + """ + Git commit SHA to checkout. + """ + + source_code_path: VariableOrOptional[str] = None + """ + Relative path to the app source code within the Git repository. If not specified, the root + of the repository is used. + """ + + tag: VariableOrOptional[str] = None + """ + Git tag to checkout. + """ + + @classmethod + def from_dict(cls, value: "GitSourceDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "GitSourceDict": + return _transform_to_json_value(self) # type:ignore + + +class GitSourceDict(TypedDict, total=False): + """""" + + branch: VariableOrOptional[str] + """ + Git branch to checkout. + """ + + commit: VariableOrOptional[str] + """ + Git commit SHA to checkout. + """ + + source_code_path: VariableOrOptional[str] + """ + Relative path to the app source code within the Git repository. If not specified, the root + of the repository is used. + """ + + tag: VariableOrOptional[str] + """ + Git tag to checkout. + """ + + +GitSourceParam = GitSourceDict | GitSource diff --git a/python/databricks/bundles/apps/_models/lifecycle_with_started.py b/python/databricks/bundles/apps/_models/lifecycle_with_started.py new file mode 100644 index 00000000000..3ee1d2a01b3 --- /dev/null +++ b/python/databricks/bundles/apps/_models/lifecycle_with_started.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class LifecycleWithStarted: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + started: VariableOrOptional[bool] = None + """ + Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses in direct deployment mode. + """ + + @classmethod + def from_dict(cls, value: "LifecycleWithStartedDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleWithStartedDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleWithStartedDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + started: VariableOrOptional[bool] + """ + Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses in direct deployment mode. + """ + + +LifecycleWithStartedParam = LifecycleWithStartedDict | LifecycleWithStarted diff --git a/python/databricks/bundles/apps/_models/telemetry_export_destination.py b/python/databricks/bundles/apps/_models/telemetry_export_destination.py new file mode 100644 index 00000000000..6db241c044d --- /dev/null +++ b/python/databricks/bundles/apps/_models/telemetry_export_destination.py @@ -0,0 +1,48 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.apps._models.unity_catalog import ( + UnityCatalog, + UnityCatalogParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class TelemetryExportDestination: + """ + A single telemetry export destination with its configuration and status. + """ + + unity_catalog: VariableOrOptional[UnityCatalog] = None + """ + [Public Preview] Unity Catalog Destinations for OTEL telemetry export. + """ + + @classmethod + def from_dict(cls, value: "TelemetryExportDestinationDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "TelemetryExportDestinationDict": + return _transform_to_json_value(self) # type:ignore + + +class TelemetryExportDestinationDict(TypedDict, total=False): + """""" + + unity_catalog: VariableOrOptional[UnityCatalogParam] + """ + [Public Preview] Unity Catalog Destinations for OTEL telemetry export. + """ + + +TelemetryExportDestinationParam = ( + TelemetryExportDestinationDict | TelemetryExportDestination +) diff --git a/python/databricks/bundles/apps/_models/unity_catalog.py b/python/databricks/bundles/apps/_models/unity_catalog.py new file mode 100644 index 00000000000..39c521b7e4b --- /dev/null +++ b/python/databricks/bundles/apps/_models/unity_catalog.py @@ -0,0 +1,62 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class UnityCatalog: + """ + Unity Catalog Destinations for OTEL telemetry export. + """ + + logs_table: VariableOr[str] + """ + [Public Preview] Unity Catalog table for OTEL logs. + """ + + metrics_table: VariableOr[str] + """ + [Public Preview] Unity Catalog table for OTEL metrics. + """ + + traces_table: VariableOr[str] + """ + [Public Preview] Unity Catalog table for OTEL traces (spans). + """ + + @classmethod + def from_dict(cls, value: "UnityCatalogDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "UnityCatalogDict": + return _transform_to_json_value(self) # type:ignore + + +class UnityCatalogDict(TypedDict, total=False): + """""" + + logs_table: VariableOr[str] + """ + [Public Preview] Unity Catalog table for OTEL logs. + """ + + metrics_table: VariableOr[str] + """ + [Public Preview] Unity Catalog table for OTEL metrics. + """ + + traces_table: VariableOr[str] + """ + [Public Preview] Unity Catalog table for OTEL traces (spans). + """ + + +UnityCatalogParam = UnityCatalogDict | UnityCatalog diff --git a/python/databricks/bundles/clusters/__init__.py b/python/databricks/bundles/clusters/__init__.py new file mode 100644 index 00000000000..a24c8ac4fdc --- /dev/null +++ b/python/databricks/bundles/clusters/__init__.py @@ -0,0 +1,239 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Adlsgen2Info", + "Adlsgen2InfoDict", + "Adlsgen2InfoParam", + "AutoScale", + "AutoScaleDict", + "AutoScaleParam", + "AwsAttributes", + "AwsAttributesDict", + "AwsAttributesParam", + "AwsAvailability", + "AwsAvailabilityParam", + "AzureAttributes", + "AzureAttributesDict", + "AzureAttributesParam", + "AzureAvailability", + "AzureAvailabilityParam", + "ClientsTypes", + "ClientsTypesDict", + "ClientsTypesParam", + "Cluster", + "ClusterDict", + "ClusterLogConf", + "ClusterLogConfDict", + "ClusterLogConfParam", + "ClusterParam", + "ClusterPermission", + "ClusterPermissionDict", + "ClusterPermissionLevel", + "ClusterPermissionLevelParam", + "ClusterPermissionParam", + "ConfidentialComputeType", + "ConfidentialComputeTypeParam", + "DataSecurityMode", + "DataSecurityModeParam", + "DbfsStorageInfo", + "DbfsStorageInfoDict", + "DbfsStorageInfoParam", + "DependencyMode", + "DependencyModeParam", + "DockerBasicAuth", + "DockerBasicAuthDict", + "DockerBasicAuthParam", + "DockerImage", + "DockerImageDict", + "DockerImageParam", + "EbsVolumeType", + "EbsVolumeTypeParam", + "GcpAttributes", + "GcpAttributesDict", + "GcpAttributesParam", + "GcpAvailability", + "GcpAvailabilityParam", + "GcsStorageInfo", + "GcsStorageInfoDict", + "GcsStorageInfoParam", + "InitScriptInfo", + "InitScriptInfoDict", + "InitScriptInfoParam", + "Kind", + "KindParam", + "LifecycleWithStarted", + "LifecycleWithStartedDict", + "LifecycleWithStartedParam", + "LocalFileInfo", + "LocalFileInfoDict", + "LocalFileInfoParam", + "LogAnalyticsInfo", + "LogAnalyticsInfoDict", + "LogAnalyticsInfoParam", + "NodeTypeFlexibility", + "NodeTypeFlexibilityDict", + "NodeTypeFlexibilityParam", + "RuntimeEngine", + "RuntimeEngineParam", + "S3StorageInfo", + "S3StorageInfoDict", + "S3StorageInfoParam", + "VolumesStorageInfo", + "VolumesStorageInfoDict", + "VolumesStorageInfoParam", + "WorkloadType", + "WorkloadTypeDict", + "WorkloadTypeParam", + "WorkspaceStorageInfo", + "WorkspaceStorageInfoDict", + "WorkspaceStorageInfoParam", +] + + +from databricks.bundles.clusters._models.adlsgen2_info import ( + Adlsgen2Info, + Adlsgen2InfoDict, + Adlsgen2InfoParam, +) +from databricks.bundles.clusters._models.auto_scale import ( + AutoScale, + AutoScaleDict, + AutoScaleParam, +) +from databricks.bundles.clusters._models.aws_attributes import ( + AwsAttributes, + AwsAttributesDict, + AwsAttributesParam, +) +from databricks.bundles.clusters._models.aws_availability import ( + AwsAvailability, + AwsAvailabilityParam, +) +from databricks.bundles.clusters._models.azure_attributes import ( + AzureAttributes, + AzureAttributesDict, + AzureAttributesParam, +) +from databricks.bundles.clusters._models.azure_availability import ( + AzureAvailability, + AzureAvailabilityParam, +) +from databricks.bundles.clusters._models.clients_types import ( + ClientsTypes, + ClientsTypesDict, + ClientsTypesParam, +) +from databricks.bundles.clusters._models.cluster import ( + Cluster, + ClusterDict, + ClusterParam, +) +from databricks.bundles.clusters._models.cluster_log_conf import ( + ClusterLogConf, + ClusterLogConfDict, + ClusterLogConfParam, +) +from databricks.bundles.clusters._models.cluster_permission import ( + ClusterPermission, + ClusterPermissionDict, + ClusterPermissionParam, +) +from databricks.bundles.clusters._models.cluster_permission_level import ( + ClusterPermissionLevel, + ClusterPermissionLevelParam, +) +from databricks.bundles.clusters._models.confidential_compute_type import ( + ConfidentialComputeType, + ConfidentialComputeTypeParam, +) +from databricks.bundles.clusters._models.data_security_mode import ( + DataSecurityMode, + DataSecurityModeParam, +) +from databricks.bundles.clusters._models.dbfs_storage_info import ( + DbfsStorageInfo, + DbfsStorageInfoDict, + DbfsStorageInfoParam, +) +from databricks.bundles.clusters._models.dependency_mode import ( + DependencyMode, + DependencyModeParam, +) +from databricks.bundles.clusters._models.docker_basic_auth import ( + DockerBasicAuth, + DockerBasicAuthDict, + DockerBasicAuthParam, +) +from databricks.bundles.clusters._models.docker_image import ( + DockerImage, + DockerImageDict, + DockerImageParam, +) +from databricks.bundles.clusters._models.ebs_volume_type import ( + EbsVolumeType, + EbsVolumeTypeParam, +) +from databricks.bundles.clusters._models.gcp_attributes import ( + GcpAttributes, + GcpAttributesDict, + GcpAttributesParam, +) +from databricks.bundles.clusters._models.gcp_availability import ( + GcpAvailability, + GcpAvailabilityParam, +) +from databricks.bundles.clusters._models.gcs_storage_info import ( + GcsStorageInfo, + GcsStorageInfoDict, + GcsStorageInfoParam, +) +from databricks.bundles.clusters._models.init_script_info import ( + InitScriptInfo, + InitScriptInfoDict, + InitScriptInfoParam, +) +from databricks.bundles.clusters._models.kind import Kind, KindParam +from databricks.bundles.clusters._models.lifecycle_with_started import ( + LifecycleWithStarted, + LifecycleWithStartedDict, + LifecycleWithStartedParam, +) +from databricks.bundles.clusters._models.local_file_info import ( + LocalFileInfo, + LocalFileInfoDict, + LocalFileInfoParam, +) +from databricks.bundles.clusters._models.log_analytics_info import ( + LogAnalyticsInfo, + LogAnalyticsInfoDict, + LogAnalyticsInfoParam, +) +from databricks.bundles.clusters._models.node_type_flexibility import ( + NodeTypeFlexibility, + NodeTypeFlexibilityDict, + NodeTypeFlexibilityParam, +) +from databricks.bundles.clusters._models.runtime_engine import ( + RuntimeEngine, + RuntimeEngineParam, +) +from databricks.bundles.clusters._models.s3_storage_info import ( + S3StorageInfo, + S3StorageInfoDict, + S3StorageInfoParam, +) +from databricks.bundles.clusters._models.volumes_storage_info import ( + VolumesStorageInfo, + VolumesStorageInfoDict, + VolumesStorageInfoParam, +) +from databricks.bundles.clusters._models.workload_type import ( + WorkloadType, + WorkloadTypeDict, + WorkloadTypeParam, +) +from databricks.bundles.clusters._models.workspace_storage_info import ( + WorkspaceStorageInfo, + WorkspaceStorageInfoDict, + WorkspaceStorageInfoParam, +) diff --git a/python/databricks/bundles/clusters/_models/adlsgen2_info.py b/python/databricks/bundles/clusters/_models/adlsgen2_info.py new file mode 100644 index 00000000000..87c883adeb9 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/adlsgen2_info.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Adlsgen2Info: + """ + A storage location in Adls Gen2 + """ + + destination: VariableOr[str] + """ + abfss destination, e.g. `abfss://@.dfs.core.windows.net/`. + """ + + @classmethod + def from_dict(cls, value: "Adlsgen2InfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "Adlsgen2InfoDict": + return _transform_to_json_value(self) # type:ignore + + +class Adlsgen2InfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + abfss destination, e.g. `abfss://@.dfs.core.windows.net/`. + """ + + +Adlsgen2InfoParam = Adlsgen2InfoDict | Adlsgen2Info diff --git a/python/databricks/bundles/clusters/_models/auto_scale.py b/python/databricks/bundles/clusters/_models/auto_scale.py new file mode 100644 index 00000000000..10ca50c26d7 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/auto_scale.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AutoScale: + """""" + + max_workers: VariableOrOptional[int] = None + """ + The maximum number of workers to which the cluster can scale up when overloaded. + Note that `max_workers` must be strictly greater than `min_workers`. + """ + + min_workers: VariableOrOptional[int] = None + """ + The minimum number of workers to which the cluster can scale down when underutilized. + It is also the initial number of workers the cluster will have after creation. + """ + + @classmethod + def from_dict(cls, value: "AutoScaleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AutoScaleDict": + return _transform_to_json_value(self) # type:ignore + + +class AutoScaleDict(TypedDict, total=False): + """""" + + max_workers: VariableOrOptional[int] + """ + The maximum number of workers to which the cluster can scale up when overloaded. + Note that `max_workers` must be strictly greater than `min_workers`. + """ + + min_workers: VariableOrOptional[int] + """ + The minimum number of workers to which the cluster can scale down when underutilized. + It is also the initial number of workers the cluster will have after creation. + """ + + +AutoScaleParam = AutoScaleDict | AutoScale diff --git a/python/databricks/bundles/clusters/_models/aws_attributes.py b/python/databricks/bundles/clusters/_models/aws_attributes.py new file mode 100644 index 00000000000..2ff19359882 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/aws_attributes.py @@ -0,0 +1,234 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.aws_availability import ( + AwsAvailability, + AwsAvailabilityParam, +) +from databricks.bundles.clusters._models.ebs_volume_type import ( + EbsVolumeType, + EbsVolumeTypeParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AwsAttributes: + """ + Attributes set during cluster creation which are related to Amazon Web Services. + """ + + availability: VariableOrOptional[AwsAvailability] = None + """ + Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + """ + + ebs_volume_count: VariableOrOptional[int] = None + """ + The number of volumes launched for each instance. Users can choose up to 10 volumes. + This feature is only enabled for supported node types. Legacy node types cannot specify + custom EBS volumes. + For node types with no instance store, at least one EBS volume needs to be specified; + otherwise, cluster creation will fail. + + These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. + Instance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc. + + If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + scratch storage because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + store volumes. + + Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + will be overridden. + """ + + ebs_volume_iops: VariableOrOptional[int] = None + """ + If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. + """ + + ebs_volume_size: VariableOrOptional[int] = None + """ + The size of each EBS volume (in GiB) launched for each instance. For general purpose + SSD, this value must be within the range 100 - 4096. For throughput optimized HDD, + this value must be within the range 500 - 4096. + """ + + ebs_volume_throughput: VariableOrOptional[int] = None + """ + If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. + """ + + ebs_volume_type: VariableOrOptional[EbsVolumeType] = None + """ + The type of EBS volumes that will be launched with this cluster. + """ + + first_on_demand: VariableOrOptional[int] = None + """ + The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + If this value is greater than 0, the cluster driver node in particular will be placed on an + on-demand instance. If this value is greater than or equal to the current cluster size, all + nodes will be placed on on-demand instances. If this value is less than the current cluster + size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + be placed on `availability` instances. Note that this value does not affect + cluster size and cannot currently be mutated over the lifetime of a cluster. + """ + + instance_profile_arn: VariableOrOptional[str] = None + """ + Nodes for this cluster will only be placed on AWS instances with this instance profile. If + ommitted, nodes will be placed on instances without an IAM instance profile. The instance + profile must have previously been added to the Databricks environment by an account + administrator. + + This feature may only be available to certain customer plans. + """ + + spot_bid_price_percent: VariableOrOptional[int] = None + """ + The bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. + For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + instance, then the bid price is half of the price of + on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + When spot instances are requested for this cluster, only spot instances whose bid price + percentage matches this field will be considered. + Note that, for safety, we enforce this field to be no more than 10000. + """ + + zone_id: VariableOrOptional[str] = None + """ + Identifier for the availability zone/datacenter in which the cluster resides. + This string will be of a form like "us-west-2a". The provided availability + zone must be in the same region as the Databricks deployment. For example, "us-west-2a" + is not a valid zone id if the Databricks deployment resides in the "us-east-1" region. + This is an optional field at cluster creation, and if not specified, the zone "auto" will be used. + If the zone specified is "auto", will try to place cluster in a zone with high availability, + and will retry placement in a different AZ if there is not enough capacity. + + The list of available zones as well as the default value can be found by using the + `List Zones` method. + """ + + @classmethod + def from_dict(cls, value: "AwsAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AwsAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class AwsAttributesDict(TypedDict, total=False): + """""" + + availability: VariableOrOptional[AwsAvailabilityParam] + """ + Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + """ + + ebs_volume_count: VariableOrOptional[int] + """ + The number of volumes launched for each instance. Users can choose up to 10 volumes. + This feature is only enabled for supported node types. Legacy node types cannot specify + custom EBS volumes. + For node types with no instance store, at least one EBS volume needs to be specified; + otherwise, cluster creation will fail. + + These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. + Instance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc. + + If EBS volumes are attached, Databricks will configure Spark to use only the EBS volumes for + scratch storage because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no EBS volumes are attached, Databricks will configure Spark to use instance + store volumes. + + Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + will be overridden. + """ + + ebs_volume_iops: VariableOrOptional[int] + """ + If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. + """ + + ebs_volume_size: VariableOrOptional[int] + """ + The size of each EBS volume (in GiB) launched for each instance. For general purpose + SSD, this value must be within the range 100 - 4096. For throughput optimized HDD, + this value must be within the range 500 - 4096. + """ + + ebs_volume_throughput: VariableOrOptional[int] + """ + If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. + """ + + ebs_volume_type: VariableOrOptional[EbsVolumeTypeParam] + """ + The type of EBS volumes that will be launched with this cluster. + """ + + first_on_demand: VariableOrOptional[int] + """ + The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + If this value is greater than 0, the cluster driver node in particular will be placed on an + on-demand instance. If this value is greater than or equal to the current cluster size, all + nodes will be placed on on-demand instances. If this value is less than the current cluster + size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + be placed on `availability` instances. Note that this value does not affect + cluster size and cannot currently be mutated over the lifetime of a cluster. + """ + + instance_profile_arn: VariableOrOptional[str] + """ + Nodes for this cluster will only be placed on AWS instances with this instance profile. If + ommitted, nodes will be placed on instances without an IAM instance profile. The instance + profile must have previously been added to the Databricks environment by an account + administrator. + + This feature may only be available to certain customer plans. + """ + + spot_bid_price_percent: VariableOrOptional[int] + """ + The bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. + For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + instance, then the bid price is half of the price of + on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + When spot instances are requested for this cluster, only spot instances whose bid price + percentage matches this field will be considered. + Note that, for safety, we enforce this field to be no more than 10000. + """ + + zone_id: VariableOrOptional[str] + """ + Identifier for the availability zone/datacenter in which the cluster resides. + This string will be of a form like "us-west-2a". The provided availability + zone must be in the same region as the Databricks deployment. For example, "us-west-2a" + is not a valid zone id if the Databricks deployment resides in the "us-east-1" region. + This is an optional field at cluster creation, and if not specified, the zone "auto" will be used. + If the zone specified is "auto", will try to place cluster in a zone with high availability, + and will retry placement in a different AZ if there is not enough capacity. + + The list of available zones as well as the default value can be found by using the + `List Zones` method. + """ + + +AwsAttributesParam = AwsAttributesDict | AwsAttributes diff --git a/python/databricks/bundles/clusters/_models/aws_availability.py b/python/databricks/bundles/clusters/_models/aws_availability.py new file mode 100644 index 00000000000..4c3810f067e --- /dev/null +++ b/python/databricks/bundles/clusters/_models/aws_availability.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AwsAvailability(Enum): + """ + Availability type used for all subsequent nodes past the `first_on_demand` ones. + + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + """ + + SPOT = "SPOT" + ON_DEMAND = "ON_DEMAND" + SPOT_WITH_FALLBACK = "SPOT_WITH_FALLBACK" + + +AwsAvailabilityParam = ( + Literal["SPOT", "ON_DEMAND", "SPOT_WITH_FALLBACK"] | AwsAvailability +) diff --git a/python/databricks/bundles/clusters/_models/azure_attributes.py b/python/databricks/bundles/clusters/_models/azure_attributes.py new file mode 100644 index 00000000000..f5c5cbee36d --- /dev/null +++ b/python/databricks/bundles/clusters/_models/azure_attributes.py @@ -0,0 +1,132 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.azure_availability import ( + AzureAvailability, + AzureAvailabilityParam, +) +from databricks.bundles.clusters._models.log_analytics_info import ( + LogAnalyticsInfo, + LogAnalyticsInfoParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AzureAttributes: + """ + Attributes set during cluster creation which are related to Microsoft Azure. + """ + + availability: VariableOrOptional[AzureAvailability] = None + """ + Availability type used for all subsequent nodes past the `first_on_demand` ones. + Note: If `first_on_demand` is zero, this availability + type will be used for the entire cluster. + """ + + capacity_reservation_group: VariableOrOptional[str] = None + """ + The Azure capacity reservation group resource ID to use for launching VMs. + When specified, VMs will be launched using the provided capacity reservation. + + Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + 1. Microsoft.Compute/capacityReservationGroups/read + 2. Microsoft.Compute/capacityReservationGroups/deploy/action + 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + + Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + """ + + first_on_demand: VariableOrOptional[int] = None + """ + The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + This value should be greater than 0, to make sure the cluster driver node is placed on an + on-demand instance. If this value is greater than or equal to the current cluster size, all + nodes will be placed on on-demand instances. If this value is less than the current cluster + size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + be placed on `availability` instances. Note that this value does not affect + cluster size and cannot currently be mutated over the lifetime of a cluster. + """ + + log_analytics_info: VariableOrOptional[LogAnalyticsInfo] = None + """ + Defines values necessary to configure and run Azure Log Analytics agent + """ + + spot_bid_max_price: VariableOrOptional[float] = None + """ + The max bid price to be used for Azure spot instances. + The Max price for the bid cannot be higher than the on-demand price of the instance. + If not specified, the default value is -1, which specifies that the instance cannot be evicted + on the basis of price, and only on the basis of availability. Further, the value should > 0 or -1. + """ + + @classmethod + def from_dict(cls, value: "AzureAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AzureAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class AzureAttributesDict(TypedDict, total=False): + """""" + + availability: VariableOrOptional[AzureAvailabilityParam] + """ + Availability type used for all subsequent nodes past the `first_on_demand` ones. + Note: If `first_on_demand` is zero, this availability + type will be used for the entire cluster. + """ + + capacity_reservation_group: VariableOrOptional[str] + """ + The Azure capacity reservation group resource ID to use for launching VMs. + When specified, VMs will be launched using the provided capacity reservation. + + Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + 1. Microsoft.Compute/capacityReservationGroups/read + 2. Microsoft.Compute/capacityReservationGroups/deploy/action + 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + + Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + """ + + first_on_demand: VariableOrOptional[int] + """ + The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + This value should be greater than 0, to make sure the cluster driver node is placed on an + on-demand instance. If this value is greater than or equal to the current cluster size, all + nodes will be placed on on-demand instances. If this value is less than the current cluster + size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + be placed on `availability` instances. Note that this value does not affect + cluster size and cannot currently be mutated over the lifetime of a cluster. + """ + + log_analytics_info: VariableOrOptional[LogAnalyticsInfoParam] + """ + Defines values necessary to configure and run Azure Log Analytics agent + """ + + spot_bid_max_price: VariableOrOptional[float] + """ + The max bid price to be used for Azure spot instances. + The Max price for the bid cannot be higher than the on-demand price of the instance. + If not specified, the default value is -1, which specifies that the instance cannot be evicted + on the basis of price, and only on the basis of availability. Further, the value should > 0 or -1. + """ + + +AzureAttributesParam = AzureAttributesDict | AzureAttributes diff --git a/python/databricks/bundles/clusters/_models/azure_availability.py b/python/databricks/bundles/clusters/_models/azure_availability.py new file mode 100644 index 00000000000..a03cb1fdddf --- /dev/null +++ b/python/databricks/bundles/clusters/_models/azure_availability.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AzureAvailability(Enum): + """ + Availability type used for all subsequent nodes past the `first_on_demand` ones. + Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster. + """ + + SPOT_AZURE = "SPOT_AZURE" + ON_DEMAND_AZURE = "ON_DEMAND_AZURE" + SPOT_WITH_FALLBACK_AZURE = "SPOT_WITH_FALLBACK_AZURE" + + +AzureAvailabilityParam = ( + Literal["SPOT_AZURE", "ON_DEMAND_AZURE", "SPOT_WITH_FALLBACK_AZURE"] + | AzureAvailability +) diff --git a/python/databricks/bundles/clusters/_models/clients_types.py b/python/databricks/bundles/clusters/_models/clients_types.py new file mode 100644 index 00000000000..87f92446ba5 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/clients_types.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ClientsTypes: + """""" + + jobs: VariableOrOptional[bool] = None + """ + With jobs set, the cluster can be used for jobs + """ + + notebooks: VariableOrOptional[bool] = None + """ + With notebooks set, this cluster can be used for notebooks + """ + + @classmethod + def from_dict(cls, value: "ClientsTypesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ClientsTypesDict": + return _transform_to_json_value(self) # type:ignore + + +class ClientsTypesDict(TypedDict, total=False): + """""" + + jobs: VariableOrOptional[bool] + """ + With jobs set, the cluster can be used for jobs + """ + + notebooks: VariableOrOptional[bool] + """ + With notebooks set, this cluster can be used for notebooks + """ + + +ClientsTypesParam = ClientsTypesDict | ClientsTypes diff --git a/python/databricks/bundles/clusters/_models/cluster.py b/python/databricks/bundles/clusters/_models/cluster.py new file mode 100644 index 00000000000..93eeadfca1e --- /dev/null +++ b/python/databricks/bundles/clusters/_models/cluster.py @@ -0,0 +1,648 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.auto_scale import ( + AutoScale, + AutoScaleParam, +) +from databricks.bundles.clusters._models.aws_attributes import ( + AwsAttributes, + AwsAttributesParam, +) +from databricks.bundles.clusters._models.azure_attributes import ( + AzureAttributes, + AzureAttributesParam, +) +from databricks.bundles.clusters._models.cluster_log_conf import ( + ClusterLogConf, + ClusterLogConfParam, +) +from databricks.bundles.clusters._models.cluster_permission import ( + ClusterPermission, + ClusterPermissionParam, +) +from databricks.bundles.clusters._models.data_security_mode import ( + DataSecurityMode, + DataSecurityModeParam, +) +from databricks.bundles.clusters._models.dependency_mode import ( + DependencyMode, + DependencyModeParam, +) +from databricks.bundles.clusters._models.docker_image import ( + DockerImage, + DockerImageParam, +) +from databricks.bundles.clusters._models.gcp_attributes import ( + GcpAttributes, + GcpAttributesParam, +) +from databricks.bundles.clusters._models.init_script_info import ( + InitScriptInfo, + InitScriptInfoParam, +) +from databricks.bundles.clusters._models.kind import Kind, KindParam +from databricks.bundles.clusters._models.lifecycle_with_started import ( + LifecycleWithStarted, + LifecycleWithStartedParam, +) +from databricks.bundles.clusters._models.node_type_flexibility import ( + NodeTypeFlexibility, + NodeTypeFlexibilityParam, +) +from databricks.bundles.clusters._models.runtime_engine import ( + RuntimeEngine, + RuntimeEngineParam, +) +from databricks.bundles.clusters._models.workload_type import ( + WorkloadType, + WorkloadTypeParam, +) +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOrDict, + VariableOrList, + VariableOrOptional, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Cluster(Resource): + """ + Contains a snapshot of the latest user specified settings that were used to create/edit the cluster. + """ + + apply_policy_default_values: VariableOrOptional[bool] = None + """ + When set to true, fixed and default values from the policy will be used for fields that are omitted. When set to false, only fixed values from the policy will be applied. + """ + + autoscale: VariableOrOptional[AutoScale] = None + """ + Parameters needed in order to automatically scale clusters up and down based on load. + Note: autoscaling works best with DB runtime versions 3.0 or later. + """ + + autotermination_minutes: VariableOrOptional[int] = None + """ + Automatically terminates the cluster after it is inactive for this time in minutes. If not set, + this cluster will not be automatically terminated. If specified, the threshold must be between + 10 and 10000 minutes. + Users can also set this value to 0 to explicitly disable automatic termination. + """ + + aws_attributes: VariableOrOptional[AwsAttributes] = None + """ + Attributes related to clusters running on Amazon Web Services. + If not specified at cluster creation, a set of default values will be used. + """ + + azure_attributes: VariableOrOptional[AzureAttributes] = None + """ + Attributes related to clusters running on Microsoft Azure. + If not specified at cluster creation, a set of default values will be used. + """ + + cluster_log_conf: VariableOrOptional[ClusterLogConf] = None + """ + The configuration for delivering spark logs to a long-term storage destination. + Three kinds of destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be specified + for one cluster. If the conf is given, the logs will be delivered to the destination every + `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while + the destination of executor logs is `$destination/$clusterId/executor`. + """ + + cluster_name: VariableOrOptional[str] = None + """ + Cluster name requested by the user. This doesn't have to be unique. + If not specified at creation, the cluster name will be an empty string. + For job clusters, the cluster name is automatically set based on the job and job run IDs. + """ + + custom_tags: VariableOrDict[str] = field(default_factory=dict) + """ + Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + + - Currently, Databricks allows at most 45 custom tags + + - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags + """ + + data_security_mode: VariableOrOptional[DataSecurityMode] = None + """ + Data security mode decides what data governance model to use when accessing data + from a cluster. + + * `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other’s data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited. + * `DATA_SECURITY_MODE_DEDICATED`: A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode. + + The following modes are legacy aliases for the above modes: + + * `USER_ISOLATION`: Legacy alias for `DATA_SECURITY_MODE_STANDARD`. + * `SINGLE_USER`: Legacy alias for `DATA_SECURITY_MODE_DEDICATED`. + + The following modes are deprecated starting with Databricks Runtime 15.0 and + will be removed for future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. + * `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high concurrency clusters. + * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy Passthrough on standard clusters. + * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have UC nor passthrough enabled. + """ + + dependency_mode: VariableOrOptional[DependencyMode] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] Controls dependency configuration for the cluster. + """ + + docker_image: VariableOrOptional[DockerImage] = None + """ + Custom docker image BYOC + """ + + driver_instance_pool_id: VariableOrOptional[str] = None + """ + The optional ID of the instance pool for the driver of the cluster belongs. + The pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not + assigned. + """ + + driver_node_type_flexibility: VariableOrOptional[NodeTypeFlexibility] = None + """ + Flexible node type configuration for the driver node. + """ + + driver_node_type_id: VariableOrOptional[str] = None + """ + The node type of the Spark driver. + Note that this field is optional; if unset, the driver node type will be set as the same value + as `node_type_id` defined above. + + This field, along with node_type_id, should not be set if virtual_cluster_size is set. + If both driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id and node_type_id take precedence. + """ + + enable_elastic_disk: VariableOrOptional[bool] = None + """ + Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + space when its Spark workers are running low on disk space. + """ + + enable_local_disk_encryption: VariableOrOptional[bool] = None + """ + Whether to enable LUKS on cluster VMs' local disks + """ + + gcp_attributes: VariableOrOptional[GcpAttributes] = None + """ + Attributes related to clusters running on Google Cloud Platform. + If not specified at cluster creation, a set of default values will be used. + """ + + init_scripts: VariableOrList[InitScriptInfo] = field(default_factory=list) + """ + The configuration for storing init scripts. Any number of destinations can be specified. + The scripts are executed sequentially in the order provided. + If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. + """ + + instance_pool_id: VariableOrOptional[str] = None + """ + The optional ID of the instance pool to which the cluster belongs. + """ + + is_single_node: VariableOrOptional[bool] = None + """ + This field can only be used when `kind = CLASSIC_PREVIEW`. + + When set to true, Databricks will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers` + """ + + kind: VariableOrOptional[Kind] = None + """ + The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no specified `kind` do not. + * [is_single_node](/api/workspace/clusters/create#is_single_node) + * [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) + + By using the [simple form](https://docs.databricks.com/compute/simple-form.html), your clusters are automatically using `kind = CLASSIC_PREVIEW`. + """ + + lifecycle: VariableOrOptional[LifecycleWithStarted] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + node_type_id: VariableOrOptional[str] = None + """ + This field encodes, through a single value, the resources available to each of + the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + and optimized for memory or compute intensive workloads. A list of available node + types can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call. + """ + + num_workers: VariableOrOptional[int] = None + """ + Number of worker nodes that this cluster should have. A cluster has one Spark Driver + and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + + Note: When reading the properties of a cluster, this field reflects the desired number + of workers rather than the actual current number of workers. For instance, if a cluster + is resized from 5 to 10 workers, this field will immediately be updated to reflect + the target size of 10 workers, whereas the workers listed in `spark_info` will gradually + increase from 5 to 10 as the new nodes are provisioned. + """ + + permissions: VariableOrList[ClusterPermission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + policy_id: VariableOrOptional[str] = None + """ + The ID of the cluster policy used to create the cluster if applicable. + """ + + remote_disk_throughput: VariableOrOptional[int] = None + """ + If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks. + """ + + runtime_engine: VariableOrOptional[RuntimeEngine] = None + """ + Determines the cluster's runtime engine, either standard or Photon. + + This field is not compatible with legacy `spark_version` values that contain `-photon-`. + Remove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + + If left unspecified, the runtime engine defaults to standard unless the spark_version + contains -photon-, in which case Photon will be used. + """ + + single_user_name: VariableOrOptional[str] = None + """ + Single user name if data_security_mode is `SINGLE_USER` + """ + + spark_conf: VariableOrDict[str] = field(default_factory=dict) + """ + An object containing a set of optional, user-specified Spark configuration key-value pairs. + Users can also pass in a string of extra JVM options to the driver and the executors via + `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively. + """ + + spark_env_vars: VariableOrDict[str] = field(default_factory=dict) + """ + An object containing a set of optional, user-specified environment variable key-value pairs. + Please note that key-value pair of the form (X,Y) will be exported as is (i.e., + `export X='Y'`) while launching the driver and workers. + + In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending + them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all + default databricks managed environmental variables are included as well. + + Example Spark environment variables: + `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": "/local_disk0"}` or + `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` + """ + + spark_version: VariableOrOptional[str] = None + """ + The Spark version of the cluster, e.g. `3.3.x-scala2.11`. + A list of available Spark versions can be retrieved by using + the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + """ + + ssh_public_keys: VariableOrList[str] = field(default_factory=list) + """ + SSH public key contents that will be added to each Spark node in this cluster. The + corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. + Up to 10 keys can be specified. + """ + + total_initial_remote_disk_size: VariableOrOptional[int] = None + """ + If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks. + """ + + use_ml_runtime: VariableOrOptional[bool] = None + """ + This field can only be used when `kind = CLASSIC_PREVIEW`. + + `effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not. + """ + + worker_node_type_flexibility: VariableOrOptional[NodeTypeFlexibility] = None + """ + Flexible node type configuration for worker nodes. + """ + + workload_type: VariableOrOptional[WorkloadType] = None + """ + Cluster Attributes showing for clusters workload types. + """ + + @classmethod + def from_dict(cls, value: "ClusterDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ClusterDict": + return _transform_to_json_value(self) # type:ignore + + +class ClusterDict(TypedDict, total=False): + """""" + + apply_policy_default_values: VariableOrOptional[bool] + """ + When set to true, fixed and default values from the policy will be used for fields that are omitted. When set to false, only fixed values from the policy will be applied. + """ + + autoscale: VariableOrOptional[AutoScaleParam] + """ + Parameters needed in order to automatically scale clusters up and down based on load. + Note: autoscaling works best with DB runtime versions 3.0 or later. + """ + + autotermination_minutes: VariableOrOptional[int] + """ + Automatically terminates the cluster after it is inactive for this time in minutes. If not set, + this cluster will not be automatically terminated. If specified, the threshold must be between + 10 and 10000 minutes. + Users can also set this value to 0 to explicitly disable automatic termination. + """ + + aws_attributes: VariableOrOptional[AwsAttributesParam] + """ + Attributes related to clusters running on Amazon Web Services. + If not specified at cluster creation, a set of default values will be used. + """ + + azure_attributes: VariableOrOptional[AzureAttributesParam] + """ + Attributes related to clusters running on Microsoft Azure. + If not specified at cluster creation, a set of default values will be used. + """ + + cluster_log_conf: VariableOrOptional[ClusterLogConfParam] + """ + The configuration for delivering spark logs to a long-term storage destination. + Three kinds of destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be specified + for one cluster. If the conf is given, the logs will be delivered to the destination every + `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while + the destination of executor logs is `$destination/$clusterId/executor`. + """ + + cluster_name: VariableOrOptional[str] + """ + Cluster name requested by the user. This doesn't have to be unique. + If not specified at creation, the cluster name will be an empty string. + For job clusters, the cluster name is automatically set based on the job and job run IDs. + """ + + custom_tags: VariableOrDict[str] + """ + Additional tags for cluster resources. Databricks will tag all cluster resources (e.g., AWS + instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + + - Currently, Databricks allows at most 45 custom tags + + - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags + """ + + data_security_mode: VariableOrOptional[DataSecurityModeParam] + """ + Data security mode decides what data governance model to use when accessing data + from a cluster. + + * `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other’s data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited. + * `DATA_SECURITY_MODE_DEDICATED`: A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode. + + The following modes are legacy aliases for the above modes: + + * `USER_ISOLATION`: Legacy alias for `DATA_SECURITY_MODE_STANDARD`. + * `SINGLE_USER`: Legacy alias for `DATA_SECURITY_MODE_DEDICATED`. + + The following modes are deprecated starting with Databricks Runtime 15.0 and + will be removed for future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. + * `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high concurrency clusters. + * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy Passthrough on standard clusters. + * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have UC nor passthrough enabled. + """ + + dependency_mode: VariableOrOptional[DependencyModeParam] + """ + :meta private: [EXPERIMENTAL] + + [Beta] Controls dependency configuration for the cluster. + """ + + docker_image: VariableOrOptional[DockerImageParam] + """ + Custom docker image BYOC + """ + + driver_instance_pool_id: VariableOrOptional[str] + """ + The optional ID of the instance pool for the driver of the cluster belongs. + The pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not + assigned. + """ + + driver_node_type_flexibility: VariableOrOptional[NodeTypeFlexibilityParam] + """ + Flexible node type configuration for the driver node. + """ + + driver_node_type_id: VariableOrOptional[str] + """ + The node type of the Spark driver. + Note that this field is optional; if unset, the driver node type will be set as the same value + as `node_type_id` defined above. + + This field, along with node_type_id, should not be set if virtual_cluster_size is set. + If both driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id and node_type_id take precedence. + """ + + enable_elastic_disk: VariableOrOptional[bool] + """ + Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + space when its Spark workers are running low on disk space. + """ + + enable_local_disk_encryption: VariableOrOptional[bool] + """ + Whether to enable LUKS on cluster VMs' local disks + """ + + gcp_attributes: VariableOrOptional[GcpAttributesParam] + """ + Attributes related to clusters running on Google Cloud Platform. + If not specified at cluster creation, a set of default values will be used. + """ + + init_scripts: VariableOrList[InitScriptInfoParam] + """ + The configuration for storing init scripts. Any number of destinations can be specified. + The scripts are executed sequentially in the order provided. + If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. + """ + + instance_pool_id: VariableOrOptional[str] + """ + The optional ID of the instance pool to which the cluster belongs. + """ + + is_single_node: VariableOrOptional[bool] + """ + This field can only be used when `kind = CLASSIC_PREVIEW`. + + When set to true, Databricks will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers` + """ + + kind: VariableOrOptional[KindParam] + """ + The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no specified `kind` do not. + * [is_single_node](/api/workspace/clusters/create#is_single_node) + * [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) + + By using the [simple form](https://docs.databricks.com/compute/simple-form.html), your clusters are automatically using `kind = CLASSIC_PREVIEW`. + """ + + lifecycle: VariableOrOptional[LifecycleWithStartedParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + node_type_id: VariableOrOptional[str] + """ + This field encodes, through a single value, the resources available to each of + the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + and optimized for memory or compute intensive workloads. A list of available node + types can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call. + """ + + num_workers: VariableOrOptional[int] + """ + Number of worker nodes that this cluster should have. A cluster has one Spark Driver + and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + + Note: When reading the properties of a cluster, this field reflects the desired number + of workers rather than the actual current number of workers. For instance, if a cluster + is resized from 5 to 10 workers, this field will immediately be updated to reflect + the target size of 10 workers, whereas the workers listed in `spark_info` will gradually + increase from 5 to 10 as the new nodes are provisioned. + """ + + permissions: VariableOrList[ClusterPermissionParam] + """ + The permissions to apply to this resource. + """ + + policy_id: VariableOrOptional[str] + """ + The ID of the cluster policy used to create the cluster if applicable. + """ + + remote_disk_throughput: VariableOrOptional[int] + """ + If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks. + """ + + runtime_engine: VariableOrOptional[RuntimeEngineParam] + """ + Determines the cluster's runtime engine, either standard or Photon. + + This field is not compatible with legacy `spark_version` values that contain `-photon-`. + Remove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + + If left unspecified, the runtime engine defaults to standard unless the spark_version + contains -photon-, in which case Photon will be used. + """ + + single_user_name: VariableOrOptional[str] + """ + Single user name if data_security_mode is `SINGLE_USER` + """ + + spark_conf: VariableOrDict[str] + """ + An object containing a set of optional, user-specified Spark configuration key-value pairs. + Users can also pass in a string of extra JVM options to the driver and the executors via + `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively. + """ + + spark_env_vars: VariableOrDict[str] + """ + An object containing a set of optional, user-specified environment variable key-value pairs. + Please note that key-value pair of the form (X,Y) will be exported as is (i.e., + `export X='Y'`) while launching the driver and workers. + + In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending + them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all + default databricks managed environmental variables are included as well. + + Example Spark environment variables: + `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": "/local_disk0"}` or + `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` + """ + + spark_version: VariableOrOptional[str] + """ + The Spark version of the cluster, e.g. `3.3.x-scala2.11`. + A list of available Spark versions can be retrieved by using + the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + """ + + ssh_public_keys: VariableOrList[str] + """ + SSH public key contents that will be added to each Spark node in this cluster. The + corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. + Up to 10 keys can be specified. + """ + + total_initial_remote_disk_size: VariableOrOptional[int] + """ + If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks. + """ + + use_ml_runtime: VariableOrOptional[bool] + """ + This field can only be used when `kind = CLASSIC_PREVIEW`. + + `effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not. + """ + + worker_node_type_flexibility: VariableOrOptional[NodeTypeFlexibilityParam] + """ + Flexible node type configuration for worker nodes. + """ + + workload_type: VariableOrOptional[WorkloadTypeParam] + """ + Cluster Attributes showing for clusters workload types. + """ + + +ClusterParam = ClusterDict | Cluster diff --git a/python/databricks/bundles/clusters/_models/cluster_log_conf.py b/python/databricks/bundles/clusters/_models/cluster_log_conf.py new file mode 100644 index 00000000000..c087a2ad463 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/cluster_log_conf.py @@ -0,0 +1,84 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.dbfs_storage_info import ( + DbfsStorageInfo, + DbfsStorageInfoParam, +) +from databricks.bundles.clusters._models.s3_storage_info import ( + S3StorageInfo, + S3StorageInfoParam, +) +from databricks.bundles.clusters._models.volumes_storage_info import ( + VolumesStorageInfo, + VolumesStorageInfoParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ClusterLogConf: + """ + Cluster log delivery config + """ + + dbfs: VariableOrOptional[DbfsStorageInfo] = None + """ + destination needs to be provided. e.g. + `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + """ + + s3: VariableOrOptional[S3StorageInfo] = None + """ + destination and either the region or endpoint need to be provided. e.g. + `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` + Cluster iam role is used to access s3, please make sure the cluster iam role in + `instance_profile_arn` has permission to write data to the s3 destination. + """ + + volumes: VariableOrOptional[VolumesStorageInfo] = None + """ + destination needs to be provided, e.g. + `{ "volumes": { "destination": "/Volumes/catalog/schema/volume/cluster_log" } }` + """ + + @classmethod + def from_dict(cls, value: "ClusterLogConfDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ClusterLogConfDict": + return _transform_to_json_value(self) # type:ignore + + +class ClusterLogConfDict(TypedDict, total=False): + """""" + + dbfs: VariableOrOptional[DbfsStorageInfoParam] + """ + destination needs to be provided. e.g. + `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + """ + + s3: VariableOrOptional[S3StorageInfoParam] + """ + destination and either the region or endpoint need to be provided. e.g. + `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` + Cluster iam role is used to access s3, please make sure the cluster iam role in + `instance_profile_arn` has permission to write data to the s3 destination. + """ + + volumes: VariableOrOptional[VolumesStorageInfoParam] + """ + destination needs to be provided, e.g. + `{ "volumes": { "destination": "/Volumes/catalog/schema/volume/cluster_log" } }` + """ + + +ClusterLogConfParam = ClusterLogConfDict | ClusterLogConf diff --git a/python/databricks/bundles/clusters/_models/cluster_permission.py b/python/databricks/bundles/clusters/_models/cluster_permission.py new file mode 100644 index 00000000000..537e136780a --- /dev/null +++ b/python/databricks/bundles/clusters/_models/cluster_permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.cluster_permission_level import ( + ClusterPermissionLevel, + ClusterPermissionLevelParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ClusterPermission: + """""" + + level: VariableOr[ClusterPermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "ClusterPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ClusterPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class ClusterPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[ClusterPermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +ClusterPermissionParam = ClusterPermissionDict | ClusterPermission diff --git a/python/databricks/bundles/clusters/_models/cluster_permission_level.py b/python/databricks/bundles/clusters/_models/cluster_permission_level.py new file mode 100644 index 00000000000..bb8b1347d92 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/cluster_permission_level.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ClusterPermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_RESTART = "CAN_RESTART" + CAN_ATTACH_TO = "CAN_ATTACH_TO" + + +ClusterPermissionLevelParam = ( + Literal["CAN_MANAGE", "CAN_RESTART", "CAN_ATTACH_TO"] | ClusterPermissionLevel +) diff --git a/python/databricks/bundles/clusters/_models/confidential_compute_type.py b/python/databricks/bundles/clusters/_models/confidential_compute_type.py new file mode 100644 index 00000000000..e881295bd47 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/confidential_compute_type.py @@ -0,0 +1,23 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ConfidentialComputeType(Enum): + """ + :meta private: [EXPERIMENTAL] + + Confidential computing technology for GCP instances. + Aligns with gcloud's --confidential-compute-type flag and the REST API's + confidentialInstanceConfig.confidentialInstanceType field. + See: https://cloud.google.com/confidential-computing/confidential-vm/docs/create-a-confidential-vm-instance + """ + + CONFIDENTIAL_COMPUTE_TYPE_NONE = "CONFIDENTIAL_COMPUTE_TYPE_NONE" + SEV_SNP = "SEV_SNP" + + +ConfidentialComputeTypeParam = ( + Literal["CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"] | ConfidentialComputeType +) diff --git a/python/databricks/bundles/clusters/_models/data_security_mode.py b/python/databricks/bundles/clusters/_models/data_security_mode.py new file mode 100644 index 00000000000..ae1aafcf085 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/data_security_mode.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class DataSecurityMode(Enum): + """ + Data security mode decides what data governance model to use when accessing data + from a cluster. + + * `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate access mode depending on your compute configuration. + * `DATA_SECURITY_MODE_STANDARD`: A secure cluster that can be shared by multiple users. Cluster users are fully isolated so that they cannot see each other’s data and credentials. Most data governance features are supported in this mode. But programming languages and cluster features might be limited. + * `DATA_SECURITY_MODE_DEDICATED`: A secure cluster that can only be exclusively used by a single user specified in `single_user_name`. Most programming languages, cluster features and data governance features are available in this mode. + + The following modes are legacy aliases for the above modes: + + * `USER_ISOLATION`: Legacy alias for `DATA_SECURITY_MODE_STANDARD`. + * `SINGLE_USER`: Legacy alias for `DATA_SECURITY_MODE_DEDICATED`. + + The following modes are deprecated starting with Databricks Runtime 15.0 and + will be removed for future Databricks Runtime versions: + + * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL clusters. + * `LEGACY_PASSTHROUGH`: This mode is for users migrating from legacy Passthrough on high concurrency clusters. + * `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy Passthrough on standard clusters. + * `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have UC nor passthrough enabled. + """ + + NONE = "NONE" + SINGLE_USER = "SINGLE_USER" + USER_ISOLATION = "USER_ISOLATION" + LEGACY_TABLE_ACL = "LEGACY_TABLE_ACL" + LEGACY_PASSTHROUGH = "LEGACY_PASSTHROUGH" + LEGACY_SINGLE_USER = "LEGACY_SINGLE_USER" + LEGACY_SINGLE_USER_STANDARD = "LEGACY_SINGLE_USER_STANDARD" + DATA_SECURITY_MODE_STANDARD = "DATA_SECURITY_MODE_STANDARD" + DATA_SECURITY_MODE_DEDICATED = "DATA_SECURITY_MODE_DEDICATED" + DATA_SECURITY_MODE_AUTO = "DATA_SECURITY_MODE_AUTO" + + +DataSecurityModeParam = ( + Literal[ + "NONE", + "SINGLE_USER", + "USER_ISOLATION", + "LEGACY_TABLE_ACL", + "LEGACY_PASSTHROUGH", + "LEGACY_SINGLE_USER", + "LEGACY_SINGLE_USER_STANDARD", + "DATA_SECURITY_MODE_STANDARD", + "DATA_SECURITY_MODE_DEDICATED", + "DATA_SECURITY_MODE_AUTO", + ] + | DataSecurityMode +) diff --git a/python/databricks/bundles/clusters/_models/dbfs_storage_info.py b/python/databricks/bundles/clusters/_models/dbfs_storage_info.py new file mode 100644 index 00000000000..29744acf26a --- /dev/null +++ b/python/databricks/bundles/clusters/_models/dbfs_storage_info.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DbfsStorageInfo: + """ + A storage location in DBFS + """ + + destination: VariableOr[str] + """ + dbfs destination, e.g. `dbfs:/my/path` + """ + + @classmethod + def from_dict(cls, value: "DbfsStorageInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DbfsStorageInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class DbfsStorageInfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + dbfs destination, e.g. `dbfs:/my/path` + """ + + +DbfsStorageInfoParam = DbfsStorageInfoDict | DbfsStorageInfo diff --git a/python/databricks/bundles/clusters/_models/dependency_mode.py b/python/databricks/bundles/clusters/_models/dependency_mode.py new file mode 100644 index 00000000000..1fdc22cfa4c --- /dev/null +++ b/python/databricks/bundles/clusters/_models/dependency_mode.py @@ -0,0 +1,28 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class DependencyMode(Enum): + """ + Controls dependency configuration for the cluster. + + * `DEPENDENCY_MODE_AUTO`: Databricks will choose the most appropriate dependency mode based on your compute configuration. + * `DEPENDENCY_MODE_ENVIRONMENTS`: Enables a unified dependency management experience across classic and serverless, resulting in increased stability and performance. Supported only on DBR 19+ in Standard access mode. + * `DEPENDENCY_MODE_CLUSTER_LIBRARIES`: Legacy mode: dependencies come from cluster libraries and init scripts. + """ + + DEPENDENCY_MODE_ENVIRONMENTS = "DEPENDENCY_MODE_ENVIRONMENTS" + DEPENDENCY_MODE_CLUSTER_LIBRARIES = "DEPENDENCY_MODE_CLUSTER_LIBRARIES" + DEPENDENCY_MODE_AUTO = "DEPENDENCY_MODE_AUTO" + + +DependencyModeParam = ( + Literal[ + "DEPENDENCY_MODE_ENVIRONMENTS", + "DEPENDENCY_MODE_CLUSTER_LIBRARIES", + "DEPENDENCY_MODE_AUTO", + ] + | DependencyMode +) diff --git a/python/databricks/bundles/clusters/_models/docker_basic_auth.py b/python/databricks/bundles/clusters/_models/docker_basic_auth.py new file mode 100644 index 00000000000..552ea90a83b --- /dev/null +++ b/python/databricks/bundles/clusters/_models/docker_basic_auth.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DockerBasicAuth: + """""" + + password: VariableOrOptional[str] = None + """ + Password of the user + """ + + username: VariableOrOptional[str] = None + """ + Name of the user + """ + + @classmethod + def from_dict(cls, value: "DockerBasicAuthDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DockerBasicAuthDict": + return _transform_to_json_value(self) # type:ignore + + +class DockerBasicAuthDict(TypedDict, total=False): + """""" + + password: VariableOrOptional[str] + """ + Password of the user + """ + + username: VariableOrOptional[str] + """ + Name of the user + """ + + +DockerBasicAuthParam = DockerBasicAuthDict | DockerBasicAuth diff --git a/python/databricks/bundles/clusters/_models/docker_image.py b/python/databricks/bundles/clusters/_models/docker_image.py new file mode 100644 index 00000000000..f7c47633e07 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/docker_image.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.docker_basic_auth import ( + DockerBasicAuth, + DockerBasicAuthParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DockerImage: + """""" + + basic_auth: VariableOrOptional[DockerBasicAuth] = None + """ + Basic auth with username and password + """ + + url: VariableOrOptional[str] = None + """ + URL of the docker image. + """ + + @classmethod + def from_dict(cls, value: "DockerImageDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DockerImageDict": + return _transform_to_json_value(self) # type:ignore + + +class DockerImageDict(TypedDict, total=False): + """""" + + basic_auth: VariableOrOptional[DockerBasicAuthParam] + """ + Basic auth with username and password + """ + + url: VariableOrOptional[str] + """ + URL of the docker image. + """ + + +DockerImageParam = DockerImageDict | DockerImage diff --git a/python/databricks/bundles/clusters/_models/ebs_volume_type.py b/python/databricks/bundles/clusters/_models/ebs_volume_type.py new file mode 100644 index 00000000000..d8f3ef13f89 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/ebs_volume_type.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class EbsVolumeType(Enum): + """ + All EBS volume types that Databricks supports. + See https://aws.amazon.com/ebs/details/ for details. + """ + + GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" + THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" + + +EbsVolumeTypeParam = ( + Literal["GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"] | EbsVolumeType +) diff --git a/python/databricks/bundles/clusters/_models/gcp_attributes.py b/python/databricks/bundles/clusters/_models/gcp_attributes.py new file mode 100644 index 00000000000..ece322d04e0 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/gcp_attributes.py @@ -0,0 +1,168 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.confidential_compute_type import ( + ConfidentialComputeType, + ConfidentialComputeTypeParam, +) +from databricks.bundles.clusters._models.gcp_availability import ( + GcpAvailability, + GcpAvailabilityParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class GcpAttributes: + """ + Attributes set during cluster creation which are related to GCP. + """ + + availability: VariableOrOptional[GcpAvailability] = None + """ + This field determines whether the spark executors will be scheduled to run on preemptible + VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + """ + + boot_disk_size: VariableOrOptional[int] = None + """ + Boot disk size in GB + """ + + confidential_compute_type: VariableOrOptional[ConfidentialComputeType] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The confidential computing technology for this cluster's instances. + Currently only SEV_SNP is supported, and only on N2D instance types. + When not set, no confidential computing is applied. + """ + + first_on_demand: VariableOrOptional[int] = None + """ + The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + This value should be greater than 0, to make sure the cluster driver node is placed on an + on-demand instance. If this value is greater than or equal to the current cluster size, all + nodes will be placed on on-demand instances. If this value is less than the current cluster + size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + be placed on `availability` instances. Note that this value does not affect + cluster size and cannot currently be mutated over the lifetime of a cluster. + """ + + google_service_account: VariableOrOptional[str] = None + """ + If provided, the cluster will impersonate the google service account when accessing + gcloud services (like GCS). The google service account + must have previously been added to the Databricks environment by an account + administrator. + """ + + local_ssd_count: VariableOrOptional[int] = None + """ + If provided, each node (workers and driver) in the cluster will have this number of local SSDs attached. + Each local SSD is 375GB in size. + Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + for the supported number of local SSDs for each instance type. + """ + + use_preemptible_executors: VariableOrOptional[bool] = None + """ + [DEPRECATED] This field determines whether the spark executors will be scheduled to run on preemptible + VMs (when set to true) versus standard compute engine VMs (when set to false; default). + Note: Soon to be deprecated, use the 'availability' field instead. + """ + + zone_id: VariableOrOptional[str] = None + """ + Identifier for the availability zone in which the cluster resides. + This can be one of the following: + - "HA" => High availability, spread nodes across availability zones for a Databricks deployment region [default]. + - "AUTO" => Databricks picks an availability zone to schedule the cluster on. + - A GCP availability zone => Pick One of the available zones for (machine type + region) from + https://cloud.google.com/compute/docs/regions-zones. + """ + + @classmethod + def from_dict(cls, value: "GcpAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "GcpAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class GcpAttributesDict(TypedDict, total=False): + """""" + + availability: VariableOrOptional[GcpAvailabilityParam] + """ + This field determines whether the spark executors will be scheduled to run on preemptible + VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + """ + + boot_disk_size: VariableOrOptional[int] + """ + Boot disk size in GB + """ + + confidential_compute_type: VariableOrOptional[ConfidentialComputeTypeParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The confidential computing technology for this cluster's instances. + Currently only SEV_SNP is supported, and only on N2D instance types. + When not set, no confidential computing is applied. + """ + + first_on_demand: VariableOrOptional[int] + """ + The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + This value should be greater than 0, to make sure the cluster driver node is placed on an + on-demand instance. If this value is greater than or equal to the current cluster size, all + nodes will be placed on on-demand instances. If this value is less than the current cluster + size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + be placed on `availability` instances. Note that this value does not affect + cluster size and cannot currently be mutated over the lifetime of a cluster. + """ + + google_service_account: VariableOrOptional[str] + """ + If provided, the cluster will impersonate the google service account when accessing + gcloud services (like GCS). The google service account + must have previously been added to the Databricks environment by an account + administrator. + """ + + local_ssd_count: VariableOrOptional[int] + """ + If provided, each node (workers and driver) in the cluster will have this number of local SSDs attached. + Each local SSD is 375GB in size. + Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + for the supported number of local SSDs for each instance type. + """ + + use_preemptible_executors: VariableOrOptional[bool] + """ + [DEPRECATED] This field determines whether the spark executors will be scheduled to run on preemptible + VMs (when set to true) versus standard compute engine VMs (when set to false; default). + Note: Soon to be deprecated, use the 'availability' field instead. + """ + + zone_id: VariableOrOptional[str] + """ + Identifier for the availability zone in which the cluster resides. + This can be one of the following: + - "HA" => High availability, spread nodes across availability zones for a Databricks deployment region [default]. + - "AUTO" => Databricks picks an availability zone to schedule the cluster on. + - A GCP availability zone => Pick One of the available zones for (machine type + region) from + https://cloud.google.com/compute/docs/regions-zones. + """ + + +GcpAttributesParam = GcpAttributesDict | GcpAttributes diff --git a/python/databricks/bundles/clusters/_models/gcp_availability.py b/python/databricks/bundles/clusters/_models/gcp_availability.py new file mode 100644 index 00000000000..0d391b87fe3 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/gcp_availability.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class GcpAvailability(Enum): + """ + This field determines whether the instance pool will contain preemptible + VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + """ + + PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" + ON_DEMAND_GCP = "ON_DEMAND_GCP" + PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" + + +GcpAvailabilityParam = ( + Literal["PREEMPTIBLE_GCP", "ON_DEMAND_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"] + | GcpAvailability +) diff --git a/python/databricks/bundles/clusters/_models/gcs_storage_info.py b/python/databricks/bundles/clusters/_models/gcs_storage_info.py new file mode 100644 index 00000000000..e8f1059373b --- /dev/null +++ b/python/databricks/bundles/clusters/_models/gcs_storage_info.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class GcsStorageInfo: + """ + A storage location in Google Cloud Platform's GCS + """ + + destination: VariableOr[str] + """ + GCS destination/URI, e.g. `gs://my-bucket/some-prefix` + """ + + @classmethod + def from_dict(cls, value: "GcsStorageInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "GcsStorageInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class GcsStorageInfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + GCS destination/URI, e.g. `gs://my-bucket/some-prefix` + """ + + +GcsStorageInfoParam = GcsStorageInfoDict | GcsStorageInfo diff --git a/python/databricks/bundles/clusters/_models/init_script_info.py b/python/databricks/bundles/clusters/_models/init_script_info.py new file mode 100644 index 00000000000..6d78d16bf92 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/init_script_info.py @@ -0,0 +1,146 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.adlsgen2_info import ( + Adlsgen2Info, + Adlsgen2InfoParam, +) +from databricks.bundles.clusters._models.dbfs_storage_info import ( + DbfsStorageInfo, + DbfsStorageInfoParam, +) +from databricks.bundles.clusters._models.gcs_storage_info import ( + GcsStorageInfo, + GcsStorageInfoParam, +) +from databricks.bundles.clusters._models.local_file_info import ( + LocalFileInfo, + LocalFileInfoParam, +) +from databricks.bundles.clusters._models.s3_storage_info import ( + S3StorageInfo, + S3StorageInfoParam, +) +from databricks.bundles.clusters._models.volumes_storage_info import ( + VolumesStorageInfo, + VolumesStorageInfoParam, +) +from databricks.bundles.clusters._models.workspace_storage_info import ( + WorkspaceStorageInfo, + WorkspaceStorageInfoParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class InitScriptInfo: + """ + Config for an individual init script + """ + + abfss: VariableOrOptional[Adlsgen2Info] = None + """ + Contains the Azure Data Lake Storage destination path + """ + + dbfs: VariableOrOptional[DbfsStorageInfo] = None + """ + [DEPRECATED] destination needs to be provided. e.g. + `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } }` + """ + + file: VariableOrOptional[LocalFileInfo] = None + """ + destination needs to be provided, e.g. + `{ "file": { "destination": "file:/my/local/file.sh" } }` + """ + + gcs: VariableOrOptional[GcsStorageInfo] = None + """ + destination needs to be provided, e.g. + `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }` + """ + + s3: VariableOrOptional[S3StorageInfo] = None + """ + destination and either the region or endpoint need to be provided. e.g. + `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` + Cluster iam role is used to access s3, please make sure the cluster iam role in + `instance_profile_arn` has permission to write data to the s3 destination. + """ + + volumes: VariableOrOptional[VolumesStorageInfo] = None + """ + destination needs to be provided. e.g. + `{ \"volumes\" : { \"destination\" : \"/Volumes/my-init.sh\" } }` + """ + + workspace: VariableOrOptional[WorkspaceStorageInfo] = None + """ + destination needs to be provided, e.g. + `{ "workspace": { "destination": "/cluster-init-scripts/setup-datadog.sh" } }` + """ + + @classmethod + def from_dict(cls, value: "InitScriptInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "InitScriptInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class InitScriptInfoDict(TypedDict, total=False): + """""" + + abfss: VariableOrOptional[Adlsgen2InfoParam] + """ + Contains the Azure Data Lake Storage destination path + """ + + dbfs: VariableOrOptional[DbfsStorageInfoParam] + """ + [DEPRECATED] destination needs to be provided. e.g. + `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } }` + """ + + file: VariableOrOptional[LocalFileInfoParam] + """ + destination needs to be provided, e.g. + `{ "file": { "destination": "file:/my/local/file.sh" } }` + """ + + gcs: VariableOrOptional[GcsStorageInfoParam] + """ + destination needs to be provided, e.g. + `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }` + """ + + s3: VariableOrOptional[S3StorageInfoParam] + """ + destination and either the region or endpoint need to be provided. e.g. + `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` + Cluster iam role is used to access s3, please make sure the cluster iam role in + `instance_profile_arn` has permission to write data to the s3 destination. + """ + + volumes: VariableOrOptional[VolumesStorageInfoParam] + """ + destination needs to be provided. e.g. + `{ \"volumes\" : { \"destination\" : \"/Volumes/my-init.sh\" } }` + """ + + workspace: VariableOrOptional[WorkspaceStorageInfoParam] + """ + destination needs to be provided, e.g. + `{ "workspace": { "destination": "/cluster-init-scripts/setup-datadog.sh" } }` + """ + + +InitScriptInfoParam = InitScriptInfoDict | InitScriptInfo diff --git a/python/databricks/bundles/clusters/_models/kind.py b/python/databricks/bundles/clusters/_models/kind.py new file mode 100644 index 00000000000..8614e25dd52 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/kind.py @@ -0,0 +1,23 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class Kind(Enum): + """ + The kind of compute described by this compute specification. + + Depending on `kind`, different validations and default values will be applied. + + Clusters with `kind = CLASSIC_PREVIEW` support the following fields, whereas clusters with no specified `kind` do not. + * [is_single_node](/api/workspace/clusters/create#is_single_node) + * [use_ml_runtime](/api/workspace/clusters/create#use_ml_runtime) + + By using the [simple form](https://docs.databricks.com/compute/simple-form.html), your clusters are automatically using `kind = CLASSIC_PREVIEW`. + """ + + CLASSIC_PREVIEW = "CLASSIC_PREVIEW" + + +KindParam = Literal["CLASSIC_PREVIEW"] | Kind diff --git a/python/databricks/bundles/clusters/_models/lifecycle_with_started.py b/python/databricks/bundles/clusters/_models/lifecycle_with_started.py new file mode 100644 index 00000000000..3ee1d2a01b3 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/lifecycle_with_started.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class LifecycleWithStarted: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + started: VariableOrOptional[bool] = None + """ + Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses in direct deployment mode. + """ + + @classmethod + def from_dict(cls, value: "LifecycleWithStartedDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleWithStartedDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleWithStartedDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + started: VariableOrOptional[bool] + """ + Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses in direct deployment mode. + """ + + +LifecycleWithStartedParam = LifecycleWithStartedDict | LifecycleWithStarted diff --git a/python/databricks/bundles/clusters/_models/local_file_info.py b/python/databricks/bundles/clusters/_models/local_file_info.py new file mode 100644 index 00000000000..875f2fe8353 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/local_file_info.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class LocalFileInfo: + """""" + + destination: VariableOr[str] + """ + local file destination, e.g. `file:/my/local/file.sh` + """ + + @classmethod + def from_dict(cls, value: "LocalFileInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LocalFileInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class LocalFileInfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + local file destination, e.g. `file:/my/local/file.sh` + """ + + +LocalFileInfoParam = LocalFileInfoDict | LocalFileInfo diff --git a/python/databricks/bundles/clusters/_models/log_analytics_info.py b/python/databricks/bundles/clusters/_models/log_analytics_info.py new file mode 100644 index 00000000000..67cdf85b2b9 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/log_analytics_info.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class LogAnalyticsInfo: + """""" + + log_analytics_primary_key: VariableOrOptional[str] = None + """ + The primary key for the Azure Log Analytics agent configuration + """ + + log_analytics_workspace_id: VariableOrOptional[str] = None + """ + The workspace ID for the Azure Log Analytics agent configuration + """ + + @classmethod + def from_dict(cls, value: "LogAnalyticsInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LogAnalyticsInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class LogAnalyticsInfoDict(TypedDict, total=False): + """""" + + log_analytics_primary_key: VariableOrOptional[str] + """ + The primary key for the Azure Log Analytics agent configuration + """ + + log_analytics_workspace_id: VariableOrOptional[str] + """ + The workspace ID for the Azure Log Analytics agent configuration + """ + + +LogAnalyticsInfoParam = LogAnalyticsInfoDict | LogAnalyticsInfo diff --git a/python/databricks/bundles/clusters/_models/node_type_flexibility.py b/python/databricks/bundles/clusters/_models/node_type_flexibility.py new file mode 100644 index 00000000000..aa582b763a8 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/node_type_flexibility.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class NodeTypeFlexibility: + """ + Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. + """ + + alternate_node_type_ids: VariableOrList[str] = field(default_factory=list) + """ + A list of node type IDs to use as fallbacks when the primary node type is unavailable. + """ + + @classmethod + def from_dict(cls, value: "NodeTypeFlexibilityDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "NodeTypeFlexibilityDict": + return _transform_to_json_value(self) # type:ignore + + +class NodeTypeFlexibilityDict(TypedDict, total=False): + """""" + + alternate_node_type_ids: VariableOrList[str] + """ + A list of node type IDs to use as fallbacks when the primary node type is unavailable. + """ + + +NodeTypeFlexibilityParam = NodeTypeFlexibilityDict | NodeTypeFlexibility diff --git a/python/databricks/bundles/clusters/_models/runtime_engine.py b/python/databricks/bundles/clusters/_models/runtime_engine.py new file mode 100644 index 00000000000..2e1559fa801 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/runtime_engine.py @@ -0,0 +1,13 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RuntimeEngine(Enum): + NULL = "NULL" + STANDARD = "STANDARD" + PHOTON = "PHOTON" + + +RuntimeEngineParam = Literal["NULL", "STANDARD", "PHOTON"] | RuntimeEngine diff --git a/python/databricks/bundles/clusters/_models/s3_storage_info.py b/python/databricks/bundles/clusters/_models/s3_storage_info.py new file mode 100644 index 00000000000..071abd5b6f3 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/s3_storage_info.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class S3StorageInfo: + """ + A storage location in Amazon S3 + """ + + destination: VariableOr[str] + """ + S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using + cluster iam role, please make sure you set cluster iam role and the role has write access to the + destination. Please also note that you cannot use AWS keys to deliver logs. + """ + + canned_acl: VariableOrOptional[str] = None + """ + (Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. + If `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + the destination bucket and prefix. The full list of possible canned acl can be found at + http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. + Please also note that by default only the object owner gets full controls. If you are using cross account + role for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + read the logs. + """ + + enable_encryption: VariableOrOptional[bool] = None + """ + (Optional) Flag to enable server side encryption, `false` by default. + """ + + encryption_type: VariableOrOptional[str] = None + """ + (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + encryption is enabled and the default type is `sse-s3`. + """ + + endpoint: VariableOrOptional[str] = None + """ + S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be set. + If both are set, endpoint will be used. + """ + + kms_key: VariableOrOptional[str] = None + """ + (Optional) Kms key which will be used if encryption is enabled and encryption type is set to `sse-kms`. + """ + + region: VariableOrOptional[str] = None + """ + S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used. + """ + + @classmethod + def from_dict(cls, value: "S3StorageInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "S3StorageInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class S3StorageInfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using + cluster iam role, please make sure you set cluster iam role and the role has write access to the + destination. Please also note that you cannot use AWS keys to deliver logs. + """ + + canned_acl: VariableOrOptional[str] + """ + (Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. + If `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + the destination bucket and prefix. The full list of possible canned acl can be found at + http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. + Please also note that by default only the object owner gets full controls. If you are using cross account + role for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + read the logs. + """ + + enable_encryption: VariableOrOptional[bool] + """ + (Optional) Flag to enable server side encryption, `false` by default. + """ + + encryption_type: VariableOrOptional[str] + """ + (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + encryption is enabled and the default type is `sse-s3`. + """ + + endpoint: VariableOrOptional[str] + """ + S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be set. + If both are set, endpoint will be used. + """ + + kms_key: VariableOrOptional[str] + """ + (Optional) Kms key which will be used if encryption is enabled and encryption type is set to `sse-kms`. + """ + + region: VariableOrOptional[str] + """ + S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used. + """ + + +S3StorageInfoParam = S3StorageInfoDict | S3StorageInfo diff --git a/python/databricks/bundles/clusters/_models/volumes_storage_info.py b/python/databricks/bundles/clusters/_models/volumes_storage_info.py new file mode 100644 index 00000000000..1eb4fff7bc2 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/volumes_storage_info.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class VolumesStorageInfo: + """ + A storage location back by UC Volumes. + """ + + destination: VariableOr[str] + """ + UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + or `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + """ + + @classmethod + def from_dict(cls, value: "VolumesStorageInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "VolumesStorageInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class VolumesStorageInfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + or `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + """ + + +VolumesStorageInfoParam = VolumesStorageInfoDict | VolumesStorageInfo diff --git a/python/databricks/bundles/clusters/_models/workload_type.py b/python/databricks/bundles/clusters/_models/workload_type.py new file mode 100644 index 00000000000..6760e7d7edd --- /dev/null +++ b/python/databricks/bundles/clusters/_models/workload_type.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.clusters._models.clients_types import ( + ClientsTypes, + ClientsTypesParam, +) +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class WorkloadType: + """ + Cluster Attributes showing for clusters workload types. + """ + + clients: VariableOr[ClientsTypes] + """ + defined what type of clients can use the cluster. E.g. Notebooks, Jobs + """ + + @classmethod + def from_dict(cls, value: "WorkloadTypeDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "WorkloadTypeDict": + return _transform_to_json_value(self) # type:ignore + + +class WorkloadTypeDict(TypedDict, total=False): + """""" + + clients: VariableOr[ClientsTypesParam] + """ + defined what type of clients can use the cluster. E.g. Notebooks, Jobs + """ + + +WorkloadTypeParam = WorkloadTypeDict | WorkloadType diff --git a/python/databricks/bundles/clusters/_models/workspace_storage_info.py b/python/databricks/bundles/clusters/_models/workspace_storage_info.py new file mode 100644 index 00000000000..49aef9256c8 --- /dev/null +++ b/python/databricks/bundles/clusters/_models/workspace_storage_info.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class WorkspaceStorageInfo: + """ + A storage location in Workspace Filesystem (WSFS) + """ + + destination: VariableOr[str] + """ + wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` + """ + + @classmethod + def from_dict(cls, value: "WorkspaceStorageInfoDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "WorkspaceStorageInfoDict": + return _transform_to_json_value(self) # type:ignore + + +class WorkspaceStorageInfoDict(TypedDict, total=False): + """""" + + destination: VariableOr[str] + """ + wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` + """ + + +WorkspaceStorageInfoParam = WorkspaceStorageInfoDict | WorkspaceStorageInfo diff --git a/python/databricks/bundles/core/__init__.py b/python/databricks/bundles/core/__init__.py index cbf4661aed8..3625cf525c4 100644 --- a/python/databricks/bundles/core/__init__.py +++ b/python/databricks/bundles/core/__init__.py @@ -15,15 +15,32 @@ "VariableOrList", "VariableOrOptional", "alert_mutator", + "app_mutator", "catalog_mutator", + "cluster_mutator", + "database_catalog_mutator", + "database_instance_mutator", + "external_location_mutator", + "instance_pool_mutator", "job_mutator", + "job_run_mutator", "load_resources_from_current_package_module", "load_resources_from_module", "load_resources_from_modules", "load_resources_from_package_module", + "mlflow_experiment_mutator", + "mlflow_model_mutator", + "model_serving_endpoint_mutator", "pipeline_mutator", + "quality_monitor_mutator", + "registered_model_mutator", "schema_mutator", + "secret_scope_mutator", + "sql_warehouse_mutator", + "synced_database_table_mutator", "variables", + "vector_search_endpoint_mutator", + "vector_search_index_mutator", "volume_mutator", ] @@ -35,10 +52,27 @@ ) from databricks.bundles.core._generated import ( alert_mutator, + app_mutator, catalog_mutator, + cluster_mutator, + database_catalog_mutator, + database_instance_mutator, + external_location_mutator, + instance_pool_mutator, job_mutator, + job_run_mutator, + mlflow_experiment_mutator, + mlflow_model_mutator, + model_serving_endpoint_mutator, pipeline_mutator, + quality_monitor_mutator, + registered_model_mutator, schema_mutator, + secret_scope_mutator, + sql_warehouse_mutator, + synced_database_table_mutator, + vector_search_endpoint_mutator, + vector_search_index_mutator, volume_mutator, ) from databricks.bundles.core._load import ( diff --git a/python/databricks/bundles/core/_generated/__init__.py b/python/databricks/bundles/core/_generated/__init__.py index ade9313238c..a29e96bda72 100644 --- a/python/databricks/bundles/core/_generated/__init__.py +++ b/python/databricks/bundles/core/_generated/__init__.py @@ -3,16 +3,81 @@ from typing import TYPE_CHECKING from databricks.bundles.core._generated.alerts import _AlertResources, alert_mutator +from databricks.bundles.core._generated.apps import _AppResources, app_mutator from databricks.bundles.core._generated.catalogs import ( _CatalogResources, catalog_mutator, ) +from databricks.bundles.core._generated.clusters import ( + _ClusterResources, + cluster_mutator, +) +from databricks.bundles.core._generated.database_catalogs import ( + _DatabaseCatalogResources, + database_catalog_mutator, +) +from databricks.bundles.core._generated.database_instances import ( + _DatabaseInstanceResources, + database_instance_mutator, +) +from databricks.bundles.core._generated.experiments import ( + _MlflowExperimentResources, + mlflow_experiment_mutator, +) +from databricks.bundles.core._generated.external_locations import ( + _ExternalLocationResources, + external_location_mutator, +) +from databricks.bundles.core._generated.instance_pools import ( + _InstancePoolResources, + instance_pool_mutator, +) +from databricks.bundles.core._generated.job_runs import ( + _JobRunResources, + job_run_mutator, +) from databricks.bundles.core._generated.jobs import _JobResources, job_mutator +from databricks.bundles.core._generated.model_serving_endpoints import ( + _ModelServingEndpointResources, + model_serving_endpoint_mutator, +) +from databricks.bundles.core._generated.models import ( + _MlflowModelResources, + mlflow_model_mutator, +) from databricks.bundles.core._generated.pipelines import ( _PipelineResources, pipeline_mutator, ) +from databricks.bundles.core._generated.quality_monitors import ( + _QualityMonitorResources, + quality_monitor_mutator, +) +from databricks.bundles.core._generated.registered_models import ( + _RegisteredModelResources, + registered_model_mutator, +) from databricks.bundles.core._generated.schemas import _SchemaResources, schema_mutator +from databricks.bundles.core._generated.secret_scopes import ( + _SecretScopeResources, + secret_scope_mutator, +) +from databricks.bundles.core._generated.sql_warehouses import ( + _SqlWarehouseResources, + sql_warehouse_mutator, +) +from databricks.bundles.core._generated.synced_database_tables import ( + _SyncedDatabaseTableResources, + synced_database_table_mutator, +) +from databricks.bundles.core._generated.vector_search_endpoints import ( + _VectorSearchEndpointResources, + vector_search_endpoint_mutator, +) +from databricks.bundles.core._generated.vector_search_indexes import ( + _VectorSearchIndexResources, + vector_search_index_mutator, +) from databricks.bundles.core._generated.volumes import _VolumeResources, volume_mutator if TYPE_CHECKING: @@ -22,20 +87,54 @@ "_GeneratedResources", "_all_resource_types", "alert_mutator", + "app_mutator", "catalog_mutator", + "cluster_mutator", + "database_catalog_mutator", + "database_instance_mutator", + "external_location_mutator", + "instance_pool_mutator", "job_mutator", + "job_run_mutator", + "mlflow_experiment_mutator", + "mlflow_model_mutator", + "model_serving_endpoint_mutator", "pipeline_mutator", + "quality_monitor_mutator", + "registered_model_mutator", "schema_mutator", + "secret_scope_mutator", + "sql_warehouse_mutator", + "synced_database_table_mutator", + "vector_search_endpoint_mutator", + "vector_search_index_mutator", "volume_mutator", ] class _GeneratedResources( _AlertResources, + _AppResources, _CatalogResources, + _ClusterResources, + _DatabaseCatalogResources, + _DatabaseInstanceResources, + _MlflowExperimentResources, + _ExternalLocationResources, + _InstancePoolResources, + _JobRunResources, _JobResources, + _ModelServingEndpointResources, + _MlflowModelResources, _PipelineResources, + _QualityMonitorResources, + _RegisteredModelResources, _SchemaResources, + _SecretScopeResources, + _SqlWarehouseResources, + _SyncedDatabaseTableResources, + _VectorSearchEndpointResources, + _VectorSearchIndexResources, _VolumeResources, ): pass @@ -44,18 +143,52 @@ class _GeneratedResources( def _all_resource_types() -> "tuple[_ResourceType, ...]": from databricks.bundles.core._generated import ( alerts, + apps, catalogs, + clusters, + database_catalogs, + database_instances, + experiments, + external_locations, + instance_pools, + job_runs, jobs, + model_serving_endpoints, + models, pipelines, + quality_monitors, + registered_models, schemas, + secret_scopes, + sql_warehouses, + synced_database_tables, + vector_search_endpoints, + vector_search_indexes, volumes, ) return ( alerts._resource_type(), + apps._resource_type(), catalogs._resource_type(), + clusters._resource_type(), + database_catalogs._resource_type(), + database_instances._resource_type(), + experiments._resource_type(), + external_locations._resource_type(), + instance_pools._resource_type(), + job_runs._resource_type(), jobs._resource_type(), + model_serving_endpoints._resource_type(), + models._resource_type(), pipelines._resource_type(), + quality_monitors._resource_type(), + registered_models._resource_type(), schemas._resource_type(), + secret_scopes._resource_type(), + sql_warehouses._resource_type(), + synced_database_tables._resource_type(), + vector_search_endpoints._resource_type(), + vector_search_indexes._resource_type(), volumes._resource_type(), ) diff --git a/python/databricks/bundles/core/_generated/apps.py b/python/databricks/bundles/core/_generated/apps.py new file mode 100644 index 00000000000..51d14e2c602 --- /dev/null +++ b/python/databricks/bundles/core/_generated/apps.py @@ -0,0 +1,115 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.apps._models.app import App, AppParam + from databricks.bundles.core._resource_type import _ResourceType + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.apps._models.app import App + from databricks.bundles.core._resource_type import _ResourceType + + return _ResourceType( + resource_type=App, + singular_name="app", + plural_name="apps", + ) + + +class _AppResources: + """ + Generated app accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def apps(self) -> dict[str, "App"]: + return self._resources["apps"] + + def add_app( + self, + resource_name: str, + app: "AppParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource app to the collection of resources. Resource name must be unique across all apps. + + :param resource_name: unique identifier for the app + :param app: the app to add, can be App or dict + :param location: optional location of the app in the source code + """ + from databricks.bundles.apps._models.app import App + + app = _transform(App, app) + path = ("resources", "apps", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["apps"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'app'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["apps"][resource_name] = app + + +@overload +def app_mutator( + function: Callable[[Bundle, "App"], "App"], +) -> ResourceMutator["App"]: ... + + +@overload +def app_mutator( + function: Callable[["App"], "App"], +) -> ResourceMutator["App"]: ... + + +def app_mutator(function: Callable) -> ResourceMutator["App"]: + """ + Decorator for defining mutator for apps. Function should return a new instance of the app + with the desired changes, instead of mutating the input app. + + Example: + + .. code-block:: python + + @app_mutator + def my_app_mutator(bundle: Bundle, app: App) -> App: + return replace(app, ...) + + :param function: Function that mutates apps. + """ + from databricks.bundles.apps._models.app import App + + return ResourceMutator(resource_type=App, function=function) diff --git a/python/databricks/bundles/core/_generated/clusters.py b/python/databricks/bundles/core/_generated/clusters.py new file mode 100644 index 00000000000..44c94108ac4 --- /dev/null +++ b/python/databricks/bundles/core/_generated/clusters.py @@ -0,0 +1,115 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.clusters._models.cluster import Cluster, ClusterParam + from databricks.bundles.core._resource_type import _ResourceType + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.clusters._models.cluster import Cluster + from databricks.bundles.core._resource_type import _ResourceType + + return _ResourceType( + resource_type=Cluster, + singular_name="cluster", + plural_name="clusters", + ) + + +class _ClusterResources: + """ + Generated cluster accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def clusters(self) -> dict[str, "Cluster"]: + return self._resources["clusters"] + + def add_cluster( + self, + resource_name: str, + cluster: "ClusterParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource cluster to the collection of resources. Resource name must be unique across all clusters. + + :param resource_name: unique identifier for the cluster + :param cluster: the cluster to add, can be Cluster or dict + :param location: optional location of the cluster in the source code + """ + from databricks.bundles.clusters._models.cluster import Cluster + + cluster = _transform(Cluster, cluster) + path = ("resources", "clusters", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["clusters"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'cluster'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["clusters"][resource_name] = cluster + + +@overload +def cluster_mutator( + function: Callable[[Bundle, "Cluster"], "Cluster"], +) -> ResourceMutator["Cluster"]: ... + + +@overload +def cluster_mutator( + function: Callable[["Cluster"], "Cluster"], +) -> ResourceMutator["Cluster"]: ... + + +def cluster_mutator(function: Callable) -> ResourceMutator["Cluster"]: + """ + Decorator for defining mutator for clusters. Function should return a new instance of the cluster + with the desired changes, instead of mutating the input cluster. + + Example: + + .. code-block:: python + + @cluster_mutator + def my_cluster_mutator(bundle: Bundle, cluster: Cluster) -> Cluster: + return replace(cluster, ...) + + :param function: Function that mutates clusters. + """ + from databricks.bundles.clusters._models.cluster import Cluster + + return ResourceMutator(resource_type=Cluster, function=function) diff --git a/python/databricks/bundles/core/_generated/database_catalogs.py b/python/databricks/bundles/core/_generated/database_catalogs.py new file mode 100644 index 00000000000..a11e165b17f --- /dev/null +++ b/python/databricks/bundles/core/_generated/database_catalogs.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.database_catalogs._models.database_catalog import ( + DatabaseCatalog, + DatabaseCatalogParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.database_catalogs._models.database_catalog import ( + DatabaseCatalog, + ) + + return _ResourceType( + resource_type=DatabaseCatalog, + singular_name="database_catalog", + plural_name="database_catalogs", + ) + + +class _DatabaseCatalogResources: + """ + Generated database_catalog accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def database_catalogs(self) -> dict[str, "DatabaseCatalog"]: + return self._resources["database_catalogs"] + + def add_database_catalog( + self, + resource_name: str, + database_catalog: "DatabaseCatalogParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource database_catalog to the collection of resources. Resource name must be unique across all database_catalogs. + + :param resource_name: unique identifier for the database_catalog + :param database_catalog: the database_catalog to add, can be DatabaseCatalog or dict + :param location: optional location of the database_catalog in the source code + """ + from databricks.bundles.database_catalogs._models.database_catalog import ( + DatabaseCatalog, + ) + + database_catalog = _transform(DatabaseCatalog, database_catalog) + path = ("resources", "database_catalogs", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["database_catalogs"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'database_catalog'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["database_catalogs"][resource_name] = database_catalog + + +@overload +def database_catalog_mutator( + function: Callable[[Bundle, "DatabaseCatalog"], "DatabaseCatalog"], +) -> ResourceMutator["DatabaseCatalog"]: ... + + +@overload +def database_catalog_mutator( + function: Callable[["DatabaseCatalog"], "DatabaseCatalog"], +) -> ResourceMutator["DatabaseCatalog"]: ... + + +def database_catalog_mutator(function: Callable) -> ResourceMutator["DatabaseCatalog"]: + """ + Decorator for defining mutator for database_catalogs. Function should return a new instance of the database_catalog + with the desired changes, instead of mutating the input database_catalog. + + Example: + + .. code-block:: python + + @database_catalog_mutator + def my_database_catalog_mutator(bundle: Bundle, database_catalog: DatabaseCatalog) -> DatabaseCatalog: + return replace(database_catalog, ...) + + :param function: Function that mutates database_catalogs. + """ + from databricks.bundles.database_catalogs._models.database_catalog import ( + DatabaseCatalog, + ) + + return ResourceMutator(resource_type=DatabaseCatalog, function=function) diff --git a/python/databricks/bundles/core/_generated/database_instances.py b/python/databricks/bundles/core/_generated/database_instances.py new file mode 100644 index 00000000000..9352ce5a37f --- /dev/null +++ b/python/databricks/bundles/core/_generated/database_instances.py @@ -0,0 +1,126 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.database_instances._models.database_instance import ( + DatabaseInstance, + DatabaseInstanceParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.database_instances._models.database_instance import ( + DatabaseInstance, + ) + + return _ResourceType( + resource_type=DatabaseInstance, + singular_name="database_instance", + plural_name="database_instances", + ) + + +class _DatabaseInstanceResources: + """ + Generated database_instance accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def database_instances(self) -> dict[str, "DatabaseInstance"]: + return self._resources["database_instances"] + + def add_database_instance( + self, + resource_name: str, + database_instance: "DatabaseInstanceParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource database_instance to the collection of resources. Resource name must be unique across all database_instances. + + :param resource_name: unique identifier for the database_instance + :param database_instance: the database_instance to add, can be DatabaseInstance or dict + :param location: optional location of the database_instance in the source code + """ + from databricks.bundles.database_instances._models.database_instance import ( + DatabaseInstance, + ) + + database_instance = _transform(DatabaseInstance, database_instance) + path = ("resources", "database_instances", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["database_instances"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'database_instance'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["database_instances"][resource_name] = database_instance + + +@overload +def database_instance_mutator( + function: Callable[[Bundle, "DatabaseInstance"], "DatabaseInstance"], +) -> ResourceMutator["DatabaseInstance"]: ... + + +@overload +def database_instance_mutator( + function: Callable[["DatabaseInstance"], "DatabaseInstance"], +) -> ResourceMutator["DatabaseInstance"]: ... + + +def database_instance_mutator( + function: Callable, +) -> ResourceMutator["DatabaseInstance"]: + """ + Decorator for defining mutator for database_instances. Function should return a new instance of the database_instance + with the desired changes, instead of mutating the input database_instance. + + Example: + + .. code-block:: python + + @database_instance_mutator + def my_database_instance_mutator(bundle: Bundle, database_instance: DatabaseInstance) -> DatabaseInstance: + return replace(database_instance, ...) + + :param function: Function that mutates database_instances. + """ + from databricks.bundles.database_instances._models.database_instance import ( + DatabaseInstance, + ) + + return ResourceMutator(resource_type=DatabaseInstance, function=function) diff --git a/python/databricks/bundles/core/_generated/experiments.py b/python/databricks/bundles/core/_generated/experiments.py new file mode 100644 index 00000000000..ca0860f3155 --- /dev/null +++ b/python/databricks/bundles/core/_generated/experiments.py @@ -0,0 +1,126 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.experiments._models.mlflow_experiment import ( + MlflowExperiment, + MlflowExperimentParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.experiments._models.mlflow_experiment import ( + MlflowExperiment, + ) + + return _ResourceType( + resource_type=MlflowExperiment, + singular_name="mlflow_experiment", + plural_name="experiments", + ) + + +class _MlflowExperimentResources: + """ + Generated mlflow_experiment accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def experiments(self) -> dict[str, "MlflowExperiment"]: + return self._resources["experiments"] + + def add_mlflow_experiment( + self, + resource_name: str, + mlflow_experiment: "MlflowExperimentParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource mlflow_experiment to the collection of resources. Resource name must be unique across all experiments. + + :param resource_name: unique identifier for the mlflow_experiment + :param mlflow_experiment: the mlflow_experiment to add, can be MlflowExperiment or dict + :param location: optional location of the mlflow_experiment in the source code + """ + from databricks.bundles.experiments._models.mlflow_experiment import ( + MlflowExperiment, + ) + + mlflow_experiment = _transform(MlflowExperiment, mlflow_experiment) + path = ("resources", "experiments", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["experiments"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'mlflow_experiment'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["experiments"][resource_name] = mlflow_experiment + + +@overload +def mlflow_experiment_mutator( + function: Callable[[Bundle, "MlflowExperiment"], "MlflowExperiment"], +) -> ResourceMutator["MlflowExperiment"]: ... + + +@overload +def mlflow_experiment_mutator( + function: Callable[["MlflowExperiment"], "MlflowExperiment"], +) -> ResourceMutator["MlflowExperiment"]: ... + + +def mlflow_experiment_mutator( + function: Callable, +) -> ResourceMutator["MlflowExperiment"]: + """ + Decorator for defining mutator for experiments. Function should return a new instance of the mlflow_experiment + with the desired changes, instead of mutating the input mlflow_experiment. + + Example: + + .. code-block:: python + + @mlflow_experiment_mutator + def my_mlflow_experiment_mutator(bundle: Bundle, mlflow_experiment: MlflowExperiment) -> MlflowExperiment: + return replace(mlflow_experiment, ...) + + :param function: Function that mutates experiments. + """ + from databricks.bundles.experiments._models.mlflow_experiment import ( + MlflowExperiment, + ) + + return ResourceMutator(resource_type=MlflowExperiment, function=function) diff --git a/python/databricks/bundles/core/_generated/external_locations.py b/python/databricks/bundles/core/_generated/external_locations.py new file mode 100644 index 00000000000..d30243989a2 --- /dev/null +++ b/python/databricks/bundles/core/_generated/external_locations.py @@ -0,0 +1,126 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.external_locations._models.external_location import ( + ExternalLocation, + ExternalLocationParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.external_locations._models.external_location import ( + ExternalLocation, + ) + + return _ResourceType( + resource_type=ExternalLocation, + singular_name="external_location", + plural_name="external_locations", + ) + + +class _ExternalLocationResources: + """ + Generated external_location accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def external_locations(self) -> dict[str, "ExternalLocation"]: + return self._resources["external_locations"] + + def add_external_location( + self, + resource_name: str, + external_location: "ExternalLocationParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource external_location to the collection of resources. Resource name must be unique across all external_locations. + + :param resource_name: unique identifier for the external_location + :param external_location: the external_location to add, can be ExternalLocation or dict + :param location: optional location of the external_location in the source code + """ + from databricks.bundles.external_locations._models.external_location import ( + ExternalLocation, + ) + + external_location = _transform(ExternalLocation, external_location) + path = ("resources", "external_locations", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["external_locations"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'external_location'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["external_locations"][resource_name] = external_location + + +@overload +def external_location_mutator( + function: Callable[[Bundle, "ExternalLocation"], "ExternalLocation"], +) -> ResourceMutator["ExternalLocation"]: ... + + +@overload +def external_location_mutator( + function: Callable[["ExternalLocation"], "ExternalLocation"], +) -> ResourceMutator["ExternalLocation"]: ... + + +def external_location_mutator( + function: Callable, +) -> ResourceMutator["ExternalLocation"]: + """ + Decorator for defining mutator for external_locations. Function should return a new instance of the external_location + with the desired changes, instead of mutating the input external_location. + + Example: + + .. code-block:: python + + @external_location_mutator + def my_external_location_mutator(bundle: Bundle, external_location: ExternalLocation) -> ExternalLocation: + return replace(external_location, ...) + + :param function: Function that mutates external_locations. + """ + from databricks.bundles.external_locations._models.external_location import ( + ExternalLocation, + ) + + return ResourceMutator(resource_type=ExternalLocation, function=function) diff --git a/python/databricks/bundles/core/_generated/instance_pools.py b/python/databricks/bundles/core/_generated/instance_pools.py new file mode 100644 index 00000000000..0ce75fc3d2e --- /dev/null +++ b/python/databricks/bundles/core/_generated/instance_pools.py @@ -0,0 +1,118 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.instance_pools._models.instance_pool import ( + InstancePool, + InstancePoolParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.instance_pools._models.instance_pool import InstancePool + + return _ResourceType( + resource_type=InstancePool, + singular_name="instance_pool", + plural_name="instance_pools", + ) + + +class _InstancePoolResources: + """ + Generated instance_pool accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def instance_pools(self) -> dict[str, "InstancePool"]: + return self._resources["instance_pools"] + + def add_instance_pool( + self, + resource_name: str, + instance_pool: "InstancePoolParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource instance_pool to the collection of resources. Resource name must be unique across all instance_pools. + + :param resource_name: unique identifier for the instance_pool + :param instance_pool: the instance_pool to add, can be InstancePool or dict + :param location: optional location of the instance_pool in the source code + """ + from databricks.bundles.instance_pools._models.instance_pool import InstancePool + + instance_pool = _transform(InstancePool, instance_pool) + path = ("resources", "instance_pools", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["instance_pools"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'instance_pool'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["instance_pools"][resource_name] = instance_pool + + +@overload +def instance_pool_mutator( + function: Callable[[Bundle, "InstancePool"], "InstancePool"], +) -> ResourceMutator["InstancePool"]: ... + + +@overload +def instance_pool_mutator( + function: Callable[["InstancePool"], "InstancePool"], +) -> ResourceMutator["InstancePool"]: ... + + +def instance_pool_mutator(function: Callable) -> ResourceMutator["InstancePool"]: + """ + Decorator for defining mutator for instance_pools. Function should return a new instance of the instance_pool + with the desired changes, instead of mutating the input instance_pool. + + Example: + + .. code-block:: python + + @instance_pool_mutator + def my_instance_pool_mutator(bundle: Bundle, instance_pool: InstancePool) -> InstancePool: + return replace(instance_pool, ...) + + :param function: Function that mutates instance_pools. + """ + from databricks.bundles.instance_pools._models.instance_pool import InstancePool + + return ResourceMutator(resource_type=InstancePool, function=function) diff --git a/python/databricks/bundles/core/_generated/job_runs.py b/python/databricks/bundles/core/_generated/job_runs.py new file mode 100644 index 00000000000..243a27a931f --- /dev/null +++ b/python/databricks/bundles/core/_generated/job_runs.py @@ -0,0 +1,115 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.job_runs._models.job_run import JobRun, JobRunParam + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.job_runs._models.job_run import JobRun + + return _ResourceType( + resource_type=JobRun, + singular_name="job_run", + plural_name="job_runs", + ) + + +class _JobRunResources: + """ + Generated job_run accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def job_runs(self) -> dict[str, "JobRun"]: + return self._resources["job_runs"] + + def add_job_run( + self, + resource_name: str, + job_run: "JobRunParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource job_run to the collection of resources. Resource name must be unique across all job_runs. + + :param resource_name: unique identifier for the job_run + :param job_run: the job_run to add, can be JobRun or dict + :param location: optional location of the job_run in the source code + """ + from databricks.bundles.job_runs._models.job_run import JobRun + + job_run = _transform(JobRun, job_run) + path = ("resources", "job_runs", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["job_runs"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'job_run'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["job_runs"][resource_name] = job_run + + +@overload +def job_run_mutator( + function: Callable[[Bundle, "JobRun"], "JobRun"], +) -> ResourceMutator["JobRun"]: ... + + +@overload +def job_run_mutator( + function: Callable[["JobRun"], "JobRun"], +) -> ResourceMutator["JobRun"]: ... + + +def job_run_mutator(function: Callable) -> ResourceMutator["JobRun"]: + """ + Decorator for defining mutator for job_runs. Function should return a new instance of the job_run + with the desired changes, instead of mutating the input job_run. + + Example: + + .. code-block:: python + + @job_run_mutator + def my_job_run_mutator(bundle: Bundle, job_run: JobRun) -> JobRun: + return replace(job_run, ...) + + :param function: Function that mutates job_runs. + """ + from databricks.bundles.job_runs._models.job_run import JobRun + + return ResourceMutator(resource_type=JobRun, function=function) diff --git a/python/databricks/bundles/core/_generated/model_serving_endpoints.py b/python/databricks/bundles/core/_generated/model_serving_endpoints.py new file mode 100644 index 00000000000..56a9ecde661 --- /dev/null +++ b/python/databricks/bundles/core/_generated/model_serving_endpoints.py @@ -0,0 +1,130 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint import ( + ModelServingEndpoint, + ModelServingEndpointParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint import ( + ModelServingEndpoint, + ) + + return _ResourceType( + resource_type=ModelServingEndpoint, + singular_name="model_serving_endpoint", + plural_name="model_serving_endpoints", + ) + + +class _ModelServingEndpointResources: + """ + Generated model_serving_endpoint accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def model_serving_endpoints(self) -> dict[str, "ModelServingEndpoint"]: + return self._resources["model_serving_endpoints"] + + def add_model_serving_endpoint( + self, + resource_name: str, + model_serving_endpoint: "ModelServingEndpointParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource model_serving_endpoint to the collection of resources. Resource name must be unique across all model_serving_endpoints. + + :param resource_name: unique identifier for the model_serving_endpoint + :param model_serving_endpoint: the model_serving_endpoint to add, can be ModelServingEndpoint or dict + :param location: optional location of the model_serving_endpoint in the source code + """ + from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint import ( + ModelServingEndpoint, + ) + + model_serving_endpoint = _transform( + ModelServingEndpoint, model_serving_endpoint + ) + path = ("resources", "model_serving_endpoints", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["model_serving_endpoints"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'model_serving_endpoint'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["model_serving_endpoints"][resource_name] = ( + model_serving_endpoint + ) + + +@overload +def model_serving_endpoint_mutator( + function: Callable[[Bundle, "ModelServingEndpoint"], "ModelServingEndpoint"], +) -> ResourceMutator["ModelServingEndpoint"]: ... + + +@overload +def model_serving_endpoint_mutator( + function: Callable[["ModelServingEndpoint"], "ModelServingEndpoint"], +) -> ResourceMutator["ModelServingEndpoint"]: ... + + +def model_serving_endpoint_mutator( + function: Callable, +) -> ResourceMutator["ModelServingEndpoint"]: + """ + Decorator for defining mutator for model_serving_endpoints. Function should return a new instance of the model_serving_endpoint + with the desired changes, instead of mutating the input model_serving_endpoint. + + Example: + + .. code-block:: python + + @model_serving_endpoint_mutator + def my_model_serving_endpoint_mutator(bundle: Bundle, model_serving_endpoint: ModelServingEndpoint) -> ModelServingEndpoint: + return replace(model_serving_endpoint, ...) + + :param function: Function that mutates model_serving_endpoints. + """ + from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint import ( + ModelServingEndpoint, + ) + + return ResourceMutator(resource_type=ModelServingEndpoint, function=function) diff --git a/python/databricks/bundles/core/_generated/models.py b/python/databricks/bundles/core/_generated/models.py new file mode 100644 index 00000000000..df7a4c6d6a3 --- /dev/null +++ b/python/databricks/bundles/core/_generated/models.py @@ -0,0 +1,118 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.models._models.mlflow_model import ( + MlflowModel, + MlflowModelParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.models._models.mlflow_model import MlflowModel + + return _ResourceType( + resource_type=MlflowModel, + singular_name="mlflow_model", + plural_name="models", + ) + + +class _MlflowModelResources: + """ + Generated mlflow_model accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def models(self) -> dict[str, "MlflowModel"]: + return self._resources["models"] + + def add_mlflow_model( + self, + resource_name: str, + mlflow_model: "MlflowModelParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource mlflow_model to the collection of resources. Resource name must be unique across all models. + + :param resource_name: unique identifier for the mlflow_model + :param mlflow_model: the mlflow_model to add, can be MlflowModel or dict + :param location: optional location of the mlflow_model in the source code + """ + from databricks.bundles.models._models.mlflow_model import MlflowModel + + mlflow_model = _transform(MlflowModel, mlflow_model) + path = ("resources", "models", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["models"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'mlflow_model'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["models"][resource_name] = mlflow_model + + +@overload +def mlflow_model_mutator( + function: Callable[[Bundle, "MlflowModel"], "MlflowModel"], +) -> ResourceMutator["MlflowModel"]: ... + + +@overload +def mlflow_model_mutator( + function: Callable[["MlflowModel"], "MlflowModel"], +) -> ResourceMutator["MlflowModel"]: ... + + +def mlflow_model_mutator(function: Callable) -> ResourceMutator["MlflowModel"]: + """ + Decorator for defining mutator for models. Function should return a new instance of the mlflow_model + with the desired changes, instead of mutating the input mlflow_model. + + Example: + + .. code-block:: python + + @mlflow_model_mutator + def my_mlflow_model_mutator(bundle: Bundle, mlflow_model: MlflowModel) -> MlflowModel: + return replace(mlflow_model, ...) + + :param function: Function that mutates models. + """ + from databricks.bundles.models._models.mlflow_model import MlflowModel + + return ResourceMutator(resource_type=MlflowModel, function=function) diff --git a/python/databricks/bundles/core/_generated/quality_monitors.py b/python/databricks/bundles/core/_generated/quality_monitors.py new file mode 100644 index 00000000000..ba3f52a75ae --- /dev/null +++ b/python/databricks/bundles/core/_generated/quality_monitors.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.quality_monitors._models.quality_monitor import ( + QualityMonitor, + QualityMonitorParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.quality_monitors._models.quality_monitor import ( + QualityMonitor, + ) + + return _ResourceType( + resource_type=QualityMonitor, + singular_name="quality_monitor", + plural_name="quality_monitors", + ) + + +class _QualityMonitorResources: + """ + Generated quality_monitor accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def quality_monitors(self) -> dict[str, "QualityMonitor"]: + return self._resources["quality_monitors"] + + def add_quality_monitor( + self, + resource_name: str, + quality_monitor: "QualityMonitorParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource quality_monitor to the collection of resources. Resource name must be unique across all quality_monitors. + + :param resource_name: unique identifier for the quality_monitor + :param quality_monitor: the quality_monitor to add, can be QualityMonitor or dict + :param location: optional location of the quality_monitor in the source code + """ + from databricks.bundles.quality_monitors._models.quality_monitor import ( + QualityMonitor, + ) + + quality_monitor = _transform(QualityMonitor, quality_monitor) + path = ("resources", "quality_monitors", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["quality_monitors"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'quality_monitor'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["quality_monitors"][resource_name] = quality_monitor + + +@overload +def quality_monitor_mutator( + function: Callable[[Bundle, "QualityMonitor"], "QualityMonitor"], +) -> ResourceMutator["QualityMonitor"]: ... + + +@overload +def quality_monitor_mutator( + function: Callable[["QualityMonitor"], "QualityMonitor"], +) -> ResourceMutator["QualityMonitor"]: ... + + +def quality_monitor_mutator(function: Callable) -> ResourceMutator["QualityMonitor"]: + """ + Decorator for defining mutator for quality_monitors. Function should return a new instance of the quality_monitor + with the desired changes, instead of mutating the input quality_monitor. + + Example: + + .. code-block:: python + + @quality_monitor_mutator + def my_quality_monitor_mutator(bundle: Bundle, quality_monitor: QualityMonitor) -> QualityMonitor: + return replace(quality_monitor, ...) + + :param function: Function that mutates quality_monitors. + """ + from databricks.bundles.quality_monitors._models.quality_monitor import ( + QualityMonitor, + ) + + return ResourceMutator(resource_type=QualityMonitor, function=function) diff --git a/python/databricks/bundles/core/_generated/registered_models.py b/python/databricks/bundles/core/_generated/registered_models.py new file mode 100644 index 00000000000..cdc492beeb3 --- /dev/null +++ b/python/databricks/bundles/core/_generated/registered_models.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.registered_models._models.registered_model import ( + RegisteredModel, + RegisteredModelParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.registered_models._models.registered_model import ( + RegisteredModel, + ) + + return _ResourceType( + resource_type=RegisteredModel, + singular_name="registered_model", + plural_name="registered_models", + ) + + +class _RegisteredModelResources: + """ + Generated registered_model accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def registered_models(self) -> dict[str, "RegisteredModel"]: + return self._resources["registered_models"] + + def add_registered_model( + self, + resource_name: str, + registered_model: "RegisteredModelParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource registered_model to the collection of resources. Resource name must be unique across all registered_models. + + :param resource_name: unique identifier for the registered_model + :param registered_model: the registered_model to add, can be RegisteredModel or dict + :param location: optional location of the registered_model in the source code + """ + from databricks.bundles.registered_models._models.registered_model import ( + RegisteredModel, + ) + + registered_model = _transform(RegisteredModel, registered_model) + path = ("resources", "registered_models", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["registered_models"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'registered_model'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["registered_models"][resource_name] = registered_model + + +@overload +def registered_model_mutator( + function: Callable[[Bundle, "RegisteredModel"], "RegisteredModel"], +) -> ResourceMutator["RegisteredModel"]: ... + + +@overload +def registered_model_mutator( + function: Callable[["RegisteredModel"], "RegisteredModel"], +) -> ResourceMutator["RegisteredModel"]: ... + + +def registered_model_mutator(function: Callable) -> ResourceMutator["RegisteredModel"]: + """ + Decorator for defining mutator for registered_models. Function should return a new instance of the registered_model + with the desired changes, instead of mutating the input registered_model. + + Example: + + .. code-block:: python + + @registered_model_mutator + def my_registered_model_mutator(bundle: Bundle, registered_model: RegisteredModel) -> RegisteredModel: + return replace(registered_model, ...) + + :param function: Function that mutates registered_models. + """ + from databricks.bundles.registered_models._models.registered_model import ( + RegisteredModel, + ) + + return ResourceMutator(resource_type=RegisteredModel, function=function) diff --git a/python/databricks/bundles/core/_generated/secret_scopes.py b/python/databricks/bundles/core/_generated/secret_scopes.py new file mode 100644 index 00000000000..a8be3660a6a --- /dev/null +++ b/python/databricks/bundles/core/_generated/secret_scopes.py @@ -0,0 +1,118 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.secret_scopes._models.secret_scope import ( + SecretScope, + SecretScopeParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.secret_scopes._models.secret_scope import SecretScope + + return _ResourceType( + resource_type=SecretScope, + singular_name="secret_scope", + plural_name="secret_scopes", + ) + + +class _SecretScopeResources: + """ + Generated secret_scope accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def secret_scopes(self) -> dict[str, "SecretScope"]: + return self._resources["secret_scopes"] + + def add_secret_scope( + self, + resource_name: str, + secret_scope: "SecretScopeParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource secret_scope to the collection of resources. Resource name must be unique across all secret_scopes. + + :param resource_name: unique identifier for the secret_scope + :param secret_scope: the secret_scope to add, can be SecretScope or dict + :param location: optional location of the secret_scope in the source code + """ + from databricks.bundles.secret_scopes._models.secret_scope import SecretScope + + secret_scope = _transform(SecretScope, secret_scope) + path = ("resources", "secret_scopes", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["secret_scopes"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'secret_scope'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["secret_scopes"][resource_name] = secret_scope + + +@overload +def secret_scope_mutator( + function: Callable[[Bundle, "SecretScope"], "SecretScope"], +) -> ResourceMutator["SecretScope"]: ... + + +@overload +def secret_scope_mutator( + function: Callable[["SecretScope"], "SecretScope"], +) -> ResourceMutator["SecretScope"]: ... + + +def secret_scope_mutator(function: Callable) -> ResourceMutator["SecretScope"]: + """ + Decorator for defining mutator for secret_scopes. Function should return a new instance of the secret_scope + with the desired changes, instead of mutating the input secret_scope. + + Example: + + .. code-block:: python + + @secret_scope_mutator + def my_secret_scope_mutator(bundle: Bundle, secret_scope: SecretScope) -> SecretScope: + return replace(secret_scope, ...) + + :param function: Function that mutates secret_scopes. + """ + from databricks.bundles.secret_scopes._models.secret_scope import SecretScope + + return ResourceMutator(resource_type=SecretScope, function=function) diff --git a/python/databricks/bundles/core/_generated/sql_warehouses.py b/python/databricks/bundles/core/_generated/sql_warehouses.py new file mode 100644 index 00000000000..05f8bb0cf76 --- /dev/null +++ b/python/databricks/bundles/core/_generated/sql_warehouses.py @@ -0,0 +1,118 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.sql_warehouses._models.sql_warehouse import ( + SqlWarehouse, + SqlWarehouseParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.sql_warehouses._models.sql_warehouse import SqlWarehouse + + return _ResourceType( + resource_type=SqlWarehouse, + singular_name="sql_warehouse", + plural_name="sql_warehouses", + ) + + +class _SqlWarehouseResources: + """ + Generated sql_warehouse accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def sql_warehouses(self) -> dict[str, "SqlWarehouse"]: + return self._resources["sql_warehouses"] + + def add_sql_warehouse( + self, + resource_name: str, + sql_warehouse: "SqlWarehouseParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource sql_warehouse to the collection of resources. Resource name must be unique across all sql_warehouses. + + :param resource_name: unique identifier for the sql_warehouse + :param sql_warehouse: the sql_warehouse to add, can be SqlWarehouse or dict + :param location: optional location of the sql_warehouse in the source code + """ + from databricks.bundles.sql_warehouses._models.sql_warehouse import SqlWarehouse + + sql_warehouse = _transform(SqlWarehouse, sql_warehouse) + path = ("resources", "sql_warehouses", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["sql_warehouses"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'sql_warehouse'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["sql_warehouses"][resource_name] = sql_warehouse + + +@overload +def sql_warehouse_mutator( + function: Callable[[Bundle, "SqlWarehouse"], "SqlWarehouse"], +) -> ResourceMutator["SqlWarehouse"]: ... + + +@overload +def sql_warehouse_mutator( + function: Callable[["SqlWarehouse"], "SqlWarehouse"], +) -> ResourceMutator["SqlWarehouse"]: ... + + +def sql_warehouse_mutator(function: Callable) -> ResourceMutator["SqlWarehouse"]: + """ + Decorator for defining mutator for sql_warehouses. Function should return a new instance of the sql_warehouse + with the desired changes, instead of mutating the input sql_warehouse. + + Example: + + .. code-block:: python + + @sql_warehouse_mutator + def my_sql_warehouse_mutator(bundle: Bundle, sql_warehouse: SqlWarehouse) -> SqlWarehouse: + return replace(sql_warehouse, ...) + + :param function: Function that mutates sql_warehouses. + """ + from databricks.bundles.sql_warehouses._models.sql_warehouse import SqlWarehouse + + return ResourceMutator(resource_type=SqlWarehouse, function=function) diff --git a/python/databricks/bundles/core/_generated/synced_database_tables.py b/python/databricks/bundles/core/_generated/synced_database_tables.py new file mode 100644 index 00000000000..2d0c7e598c0 --- /dev/null +++ b/python/databricks/bundles/core/_generated/synced_database_tables.py @@ -0,0 +1,128 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.synced_database_tables._models.synced_database_table import ( + SyncedDatabaseTable, + SyncedDatabaseTableParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.synced_database_tables._models.synced_database_table import ( + SyncedDatabaseTable, + ) + + return _ResourceType( + resource_type=SyncedDatabaseTable, + singular_name="synced_database_table", + plural_name="synced_database_tables", + ) + + +class _SyncedDatabaseTableResources: + """ + Generated synced_database_table accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def synced_database_tables(self) -> dict[str, "SyncedDatabaseTable"]: + return self._resources["synced_database_tables"] + + def add_synced_database_table( + self, + resource_name: str, + synced_database_table: "SyncedDatabaseTableParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource synced_database_table to the collection of resources. Resource name must be unique across all synced_database_tables. + + :param resource_name: unique identifier for the synced_database_table + :param synced_database_table: the synced_database_table to add, can be SyncedDatabaseTable or dict + :param location: optional location of the synced_database_table in the source code + """ + from databricks.bundles.synced_database_tables._models.synced_database_table import ( + SyncedDatabaseTable, + ) + + synced_database_table = _transform(SyncedDatabaseTable, synced_database_table) + path = ("resources", "synced_database_tables", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["synced_database_tables"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'synced_database_table'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["synced_database_tables"][resource_name] = ( + synced_database_table + ) + + +@overload +def synced_database_table_mutator( + function: Callable[[Bundle, "SyncedDatabaseTable"], "SyncedDatabaseTable"], +) -> ResourceMutator["SyncedDatabaseTable"]: ... + + +@overload +def synced_database_table_mutator( + function: Callable[["SyncedDatabaseTable"], "SyncedDatabaseTable"], +) -> ResourceMutator["SyncedDatabaseTable"]: ... + + +def synced_database_table_mutator( + function: Callable, +) -> ResourceMutator["SyncedDatabaseTable"]: + """ + Decorator for defining mutator for synced_database_tables. Function should return a new instance of the synced_database_table + with the desired changes, instead of mutating the input synced_database_table. + + Example: + + .. code-block:: python + + @synced_database_table_mutator + def my_synced_database_table_mutator(bundle: Bundle, synced_database_table: SyncedDatabaseTable) -> SyncedDatabaseTable: + return replace(synced_database_table, ...) + + :param function: Function that mutates synced_database_tables. + """ + from databricks.bundles.synced_database_tables._models.synced_database_table import ( + SyncedDatabaseTable, + ) + + return ResourceMutator(resource_type=SyncedDatabaseTable, function=function) diff --git a/python/databricks/bundles/core/_generated/vector_search_endpoints.py b/python/databricks/bundles/core/_generated/vector_search_endpoints.py new file mode 100644 index 00000000000..839831dafc6 --- /dev/null +++ b/python/databricks/bundles/core/_generated/vector_search_endpoints.py @@ -0,0 +1,130 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint import ( + VectorSearchEndpoint, + VectorSearchEndpointParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint import ( + VectorSearchEndpoint, + ) + + return _ResourceType( + resource_type=VectorSearchEndpoint, + singular_name="vector_search_endpoint", + plural_name="vector_search_endpoints", + ) + + +class _VectorSearchEndpointResources: + """ + Generated vector_search_endpoint accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def vector_search_endpoints(self) -> dict[str, "VectorSearchEndpoint"]: + return self._resources["vector_search_endpoints"] + + def add_vector_search_endpoint( + self, + resource_name: str, + vector_search_endpoint: "VectorSearchEndpointParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource vector_search_endpoint to the collection of resources. Resource name must be unique across all vector_search_endpoints. + + :param resource_name: unique identifier for the vector_search_endpoint + :param vector_search_endpoint: the vector_search_endpoint to add, can be VectorSearchEndpoint or dict + :param location: optional location of the vector_search_endpoint in the source code + """ + from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint import ( + VectorSearchEndpoint, + ) + + vector_search_endpoint = _transform( + VectorSearchEndpoint, vector_search_endpoint + ) + path = ("resources", "vector_search_endpoints", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["vector_search_endpoints"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'vector_search_endpoint'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["vector_search_endpoints"][resource_name] = ( + vector_search_endpoint + ) + + +@overload +def vector_search_endpoint_mutator( + function: Callable[[Bundle, "VectorSearchEndpoint"], "VectorSearchEndpoint"], +) -> ResourceMutator["VectorSearchEndpoint"]: ... + + +@overload +def vector_search_endpoint_mutator( + function: Callable[["VectorSearchEndpoint"], "VectorSearchEndpoint"], +) -> ResourceMutator["VectorSearchEndpoint"]: ... + + +def vector_search_endpoint_mutator( + function: Callable, +) -> ResourceMutator["VectorSearchEndpoint"]: + """ + Decorator for defining mutator for vector_search_endpoints. Function should return a new instance of the vector_search_endpoint + with the desired changes, instead of mutating the input vector_search_endpoint. + + Example: + + .. code-block:: python + + @vector_search_endpoint_mutator + def my_vector_search_endpoint_mutator(bundle: Bundle, vector_search_endpoint: VectorSearchEndpoint) -> VectorSearchEndpoint: + return replace(vector_search_endpoint, ...) + + :param function: Function that mutates vector_search_endpoints. + """ + from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint import ( + VectorSearchEndpoint, + ) + + return ResourceMutator(resource_type=VectorSearchEndpoint, function=function) diff --git a/python/databricks/bundles/core/_generated/vector_search_indexes.py b/python/databricks/bundles/core/_generated/vector_search_indexes.py new file mode 100644 index 00000000000..7c84a0d00c8 --- /dev/null +++ b/python/databricks/bundles/core/_generated/vector_search_indexes.py @@ -0,0 +1,128 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.vector_search_indexes._models.vector_search_index import ( + VectorSearchIndex, + VectorSearchIndexParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.vector_search_indexes._models.vector_search_index import ( + VectorSearchIndex, + ) + + return _ResourceType( + resource_type=VectorSearchIndex, + singular_name="vector_search_index", + plural_name="vector_search_indexes", + ) + + +class _VectorSearchIndexResources: + """ + Generated vector_search_index accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def vector_search_indexes(self) -> dict[str, "VectorSearchIndex"]: + return self._resources["vector_search_indexes"] + + def add_vector_search_index( + self, + resource_name: str, + vector_search_index: "VectorSearchIndexParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource vector_search_index to the collection of resources. Resource name must be unique across all vector_search_indexes. + + :param resource_name: unique identifier for the vector_search_index + :param vector_search_index: the vector_search_index to add, can be VectorSearchIndex or dict + :param location: optional location of the vector_search_index in the source code + """ + from databricks.bundles.vector_search_indexes._models.vector_search_index import ( + VectorSearchIndex, + ) + + vector_search_index = _transform(VectorSearchIndex, vector_search_index) + path = ("resources", "vector_search_indexes", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["vector_search_indexes"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'vector_search_index'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["vector_search_indexes"][resource_name] = ( + vector_search_index + ) + + +@overload +def vector_search_index_mutator( + function: Callable[[Bundle, "VectorSearchIndex"], "VectorSearchIndex"], +) -> ResourceMutator["VectorSearchIndex"]: ... + + +@overload +def vector_search_index_mutator( + function: Callable[["VectorSearchIndex"], "VectorSearchIndex"], +) -> ResourceMutator["VectorSearchIndex"]: ... + + +def vector_search_index_mutator( + function: Callable, +) -> ResourceMutator["VectorSearchIndex"]: + """ + Decorator for defining mutator for vector_search_indexes. Function should return a new instance of the vector_search_index + with the desired changes, instead of mutating the input vector_search_index. + + Example: + + .. code-block:: python + + @vector_search_index_mutator + def my_vector_search_index_mutator(bundle: Bundle, vector_search_index: VectorSearchIndex) -> VectorSearchIndex: + return replace(vector_search_index, ...) + + :param function: Function that mutates vector_search_indexes. + """ + from databricks.bundles.vector_search_indexes._models.vector_search_index import ( + VectorSearchIndex, + ) + + return ResourceMutator(resource_type=VectorSearchIndex, function=function) diff --git a/python/databricks/bundles/database_catalogs/__init__.py b/python/databricks/bundles/database_catalogs/__init__.py new file mode 100644 index 00000000000..fdd1d167302 --- /dev/null +++ b/python/databricks/bundles/database_catalogs/__init__.py @@ -0,0 +1,22 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DatabaseCatalog", + "DatabaseCatalogDict", + "DatabaseCatalogParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", +] + + +from databricks.bundles.database_catalogs._models.database_catalog import ( + DatabaseCatalog, + DatabaseCatalogDict, + DatabaseCatalogParam, +) +from databricks.bundles.database_catalogs._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) diff --git a/python/databricks/bundles/database_catalogs/_models/database_catalog.py b/python/databricks/bundles/database_catalogs/_models/database_catalog.py new file mode 100644 index 00000000000..a224ac7a316 --- /dev/null +++ b/python/databricks/bundles/database_catalogs/_models/database_catalog.py @@ -0,0 +1,85 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.database_catalogs._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DatabaseCatalog(Resource): + """""" + + database_instance_name: VariableOr[str] + """ + [Public Preview] The name of the DatabaseInstance housing the database. + """ + + database_name: VariableOr[str] + """ + [Public Preview] The name of the database (in an instance) associated with the catalog. + """ + + name: VariableOr[str] + """ + [Public Preview] The name of the catalog in UC. + """ + + create_database_if_not_exists: VariableOrOptional[bool] = None + """ + [Public Preview] + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "DatabaseCatalogDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DatabaseCatalogDict": + return _transform_to_json_value(self) # type:ignore + + +class DatabaseCatalogDict(TypedDict, total=False): + """""" + + database_instance_name: VariableOr[str] + """ + [Public Preview] The name of the DatabaseInstance housing the database. + """ + + database_name: VariableOr[str] + """ + [Public Preview] The name of the database (in an instance) associated with the catalog. + """ + + name: VariableOr[str] + """ + [Public Preview] The name of the catalog in UC. + """ + + create_database_if_not_exists: VariableOrOptional[bool] + """ + [Public Preview] + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + +DatabaseCatalogParam = DatabaseCatalogDict | DatabaseCatalog diff --git a/python/databricks/bundles/database_catalogs/_models/lifecycle.py b/python/databricks/bundles/database_catalogs/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/database_catalogs/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/database_instances/__init__.py b/python/databricks/bundles/database_instances/__init__.py new file mode 100644 index 00000000000..13674b646a5 --- /dev/null +++ b/python/databricks/bundles/database_instances/__init__.py @@ -0,0 +1,52 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "CustomTag", + "CustomTagDict", + "CustomTagParam", + "DatabaseInstance", + "DatabaseInstanceDict", + "DatabaseInstanceParam", + "DatabaseInstanceRef", + "DatabaseInstanceRefDict", + "DatabaseInstanceRefParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "Permission", + "PermissionDict", + "PermissionLevel", + "PermissionLevelParam", + "PermissionParam", +] + + +from databricks.bundles.database_instances._models.custom_tag import ( + CustomTag, + CustomTagDict, + CustomTagParam, +) +from databricks.bundles.database_instances._models.database_instance import ( + DatabaseInstance, + DatabaseInstanceDict, + DatabaseInstanceParam, +) +from databricks.bundles.database_instances._models.database_instance_ref import ( + DatabaseInstanceRef, + DatabaseInstanceRefDict, + DatabaseInstanceRefParam, +) +from databricks.bundles.database_instances._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.database_instances._models.permission import ( + Permission, + PermissionDict, + PermissionParam, +) +from databricks.bundles.database_instances._models.permission_level import ( + PermissionLevel, + PermissionLevelParam, +) diff --git a/python/databricks/bundles/database_instances/_models/custom_tag.py b/python/databricks/bundles/database_instances/_models/custom_tag.py new file mode 100644 index 00000000000..e08eb459bf7 --- /dev/null +++ b/python/databricks/bundles/database_instances/_models/custom_tag.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class CustomTag: + """""" + + key: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] The key of the custom tag. + """ + + value: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] The value of the custom tag. + """ + + @classmethod + def from_dict(cls, value: "CustomTagDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "CustomTagDict": + return _transform_to_json_value(self) # type:ignore + + +class CustomTagDict(TypedDict, total=False): + """""" + + key: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] The key of the custom tag. + """ + + value: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] The value of the custom tag. + """ + + +CustomTagParam = CustomTagDict | CustomTag diff --git a/python/databricks/bundles/database_instances/_models/database_instance.py b/python/databricks/bundles/database_instances/_models/database_instance.py new file mode 100644 index 00000000000..beea60bfd1f --- /dev/null +++ b/python/databricks/bundles/database_instances/_models/database_instance.py @@ -0,0 +1,193 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.database_instances._models.custom_tag import ( + CustomTag, + CustomTagParam, +) +from databricks.bundles.database_instances._models.database_instance_ref import ( + DatabaseInstanceRef, + DatabaseInstanceRefParam, +) +from databricks.bundles.database_instances._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.database_instances._models.permission import ( + Permission, + PermissionParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DatabaseInstance(Resource): + """ + A DatabaseInstance represents a logical Postgres instance, comprised of both compute and storage. + """ + + name: VariableOr[str] + """ + [Public Preview] The name of the instance. This is the unique identifier for the instance. + """ + + capacity: VariableOrOptional[str] = None + """ + [Public Preview] The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". + """ + + custom_tags: VariableOrList[CustomTag] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Beta] Custom tags associated with the instance. This field is only included on create and update responses. + """ + + enable_pg_native_login: VariableOrOptional[bool] = None + """ + [Public Preview] Whether to enable PG native password login on the instance. Defaults to false. + """ + + enable_readable_secondaries: VariableOrOptional[bool] = None + """ + [Public Preview] Whether to enable secondaries to serve read-only traffic. Defaults to false. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + node_count: VariableOrOptional[int] = None + """ + [Public Preview] The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to + 1 primary and 0 secondaries. This field is input only, see effective_node_count for the output. + """ + + parent_instance_ref: VariableOrOptional[DatabaseInstanceRef] = None + """ + [Public Preview] The ref of the parent instance. This is only available if the instance is + child instance. + Input: For specifying the parent instance to create a child instance. Optional. + Output: Only populated if provided as input to create a child instance. + """ + + permissions: VariableOrList[Permission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + retention_window_in_days: VariableOrOptional[int] = None + """ + [Public Preview] The retention window for the instance. This is the time window in days + for which the historical data is retained. The default value is 7 days. + Valid values are 2 to 35 days. + """ + + stopped: VariableOrOptional[bool] = None + """ + [Public Preview] Whether to stop the instance. An input only param, see effective_stopped for the output. + """ + + usage_policy_id: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] The desired usage policy to associate with the instance. + """ + + @classmethod + def from_dict(cls, value: "DatabaseInstanceDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DatabaseInstanceDict": + return _transform_to_json_value(self) # type:ignore + + +class DatabaseInstanceDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + [Public Preview] The name of the instance. This is the unique identifier for the instance. + """ + + capacity: VariableOrOptional[str] + """ + [Public Preview] The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". + """ + + custom_tags: VariableOrList[CustomTagParam] + """ + :meta private: [EXPERIMENTAL] + + [Beta] Custom tags associated with the instance. This field is only included on create and update responses. + """ + + enable_pg_native_login: VariableOrOptional[bool] + """ + [Public Preview] Whether to enable PG native password login on the instance. Defaults to false. + """ + + enable_readable_secondaries: VariableOrOptional[bool] + """ + [Public Preview] Whether to enable secondaries to serve read-only traffic. Defaults to false. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + node_count: VariableOrOptional[int] + """ + [Public Preview] The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to + 1 primary and 0 secondaries. This field is input only, see effective_node_count for the output. + """ + + parent_instance_ref: VariableOrOptional[DatabaseInstanceRefParam] + """ + [Public Preview] The ref of the parent instance. This is only available if the instance is + child instance. + Input: For specifying the parent instance to create a child instance. Optional. + Output: Only populated if provided as input to create a child instance. + """ + + permissions: VariableOrList[PermissionParam] + """ + The permissions to apply to this resource. + """ + + retention_window_in_days: VariableOrOptional[int] + """ + [Public Preview] The retention window for the instance. This is the time window in days + for which the historical data is retained. The default value is 7 days. + Valid values are 2 to 35 days. + """ + + stopped: VariableOrOptional[bool] + """ + [Public Preview] Whether to stop the instance. An input only param, see effective_stopped for the output. + """ + + usage_policy_id: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] The desired usage policy to associate with the instance. + """ + + +DatabaseInstanceParam = DatabaseInstanceDict | DatabaseInstance diff --git a/python/databricks/bundles/database_instances/_models/database_instance_ref.py b/python/databricks/bundles/database_instances/_models/database_instance_ref.py new file mode 100644 index 00000000000..8c3e582f280 --- /dev/null +++ b/python/databricks/bundles/database_instances/_models/database_instance_ref.py @@ -0,0 +1,87 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DatabaseInstanceRef: + """ + DatabaseInstanceRef is a reference to a database instance. It is used in the + DatabaseInstance object to refer to the parent instance of an instance and + to refer the child instances of an instance. + To specify as a parent instance during creation of an instance, + the lsn and branch_time fields are optional. If not specified, the child + instance will be created from the latest lsn of the parent. + If both lsn and branch_time are specified, the lsn will be used to create + the child instance. + """ + + branch_time: VariableOrOptional[str] = None + """ + [Public Preview] Branch time of the ref database instance. + For a parent ref instance, this is the point in time on the parent instance from which the + instance was created. + For a child ref instance, this is the point in time on the instance from which the child + instance was created. + Input: For specifying the point in time to create a child instance. Optional. + Output: Only populated if provided as input to create a child instance. + """ + + lsn: VariableOrOptional[str] = None + """ + [Public Preview] User-specified WAL LSN of the ref database instance. + + Input: For specifying the WAL LSN to create a child instance. Optional. + Output: Only populated if provided as input to create a child instance. + """ + + name: VariableOrOptional[str] = None + """ + [Public Preview] Name of the ref database instance. + """ + + @classmethod + def from_dict(cls, value: "DatabaseInstanceRefDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DatabaseInstanceRefDict": + return _transform_to_json_value(self) # type:ignore + + +class DatabaseInstanceRefDict(TypedDict, total=False): + """""" + + branch_time: VariableOrOptional[str] + """ + [Public Preview] Branch time of the ref database instance. + For a parent ref instance, this is the point in time on the parent instance from which the + instance was created. + For a child ref instance, this is the point in time on the instance from which the child + instance was created. + Input: For specifying the point in time to create a child instance. Optional. + Output: Only populated if provided as input to create a child instance. + """ + + lsn: VariableOrOptional[str] + """ + [Public Preview] User-specified WAL LSN of the ref database instance. + + Input: For specifying the WAL LSN to create a child instance. Optional. + Output: Only populated if provided as input to create a child instance. + """ + + name: VariableOrOptional[str] + """ + [Public Preview] Name of the ref database instance. + """ + + +DatabaseInstanceRefParam = DatabaseInstanceRefDict | DatabaseInstanceRef diff --git a/python/databricks/bundles/database_instances/_models/lifecycle.py b/python/databricks/bundles/database_instances/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/database_instances/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/database_instances/_models/permission.py b/python/databricks/bundles/database_instances/_models/permission.py new file mode 100644 index 00000000000..da0f1e44ad2 --- /dev/null +++ b/python/databricks/bundles/database_instances/_models/permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.database_instances._models.permission_level import ( + PermissionLevel, + PermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Permission: + """""" + + level: VariableOr[PermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "PermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class PermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[PermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +PermissionParam = PermissionDict | Permission diff --git a/python/databricks/bundles/database_instances/_models/permission_level.py b/python/databricks/bundles/database_instances/_models/permission_level.py new file mode 100644 index 00000000000..c6111911b29 --- /dev/null +++ b/python/databricks/bundles/database_instances/_models/permission_level.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class PermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_RESTART = "CAN_RESTART" + CAN_ATTACH_TO = "CAN_ATTACH_TO" + IS_OWNER = "IS_OWNER" + CAN_MANAGE_RUN = "CAN_MANAGE_RUN" + CAN_VIEW = "CAN_VIEW" + CAN_READ = "CAN_READ" + CAN_RUN = "CAN_RUN" + CAN_EDIT = "CAN_EDIT" + CAN_USE = "CAN_USE" + CAN_MANAGE_STAGING_VERSIONS = "CAN_MANAGE_STAGING_VERSIONS" + CAN_MANAGE_PRODUCTION_VERSIONS = "CAN_MANAGE_PRODUCTION_VERSIONS" + CAN_EDIT_METADATA = "CAN_EDIT_METADATA" + CAN_VIEW_METADATA = "CAN_VIEW_METADATA" + CAN_BIND = "CAN_BIND" + CAN_QUERY = "CAN_QUERY" + CAN_MONITOR = "CAN_MONITOR" + CAN_CREATE = "CAN_CREATE" + CAN_MONITOR_ONLY = "CAN_MONITOR_ONLY" + CAN_CREATE_APP = "CAN_CREATE_APP" + + +PermissionLevelParam = ( + Literal[ + "CAN_MANAGE", + "CAN_RESTART", + "CAN_ATTACH_TO", + "IS_OWNER", + "CAN_MANAGE_RUN", + "CAN_VIEW", + "CAN_READ", + "CAN_RUN", + "CAN_EDIT", + "CAN_USE", + "CAN_MANAGE_STAGING_VERSIONS", + "CAN_MANAGE_PRODUCTION_VERSIONS", + "CAN_EDIT_METADATA", + "CAN_VIEW_METADATA", + "CAN_BIND", + "CAN_QUERY", + "CAN_MONITOR", + "CAN_CREATE", + "CAN_MONITOR_ONLY", + "CAN_CREATE_APP", + ] + | PermissionLevel +) diff --git a/python/databricks/bundles/experiments/__init__.py b/python/databricks/bundles/experiments/__init__.py new file mode 100644 index 00000000000..e1ae26cc521 --- /dev/null +++ b/python/databricks/bundles/experiments/__init__.py @@ -0,0 +1,60 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "ExperimentPermissionLevel", + "ExperimentPermissionLevelParam", + "ExperimentTag", + "ExperimentTagDict", + "ExperimentTagParam", + "ExperimentTraceLocation", + "ExperimentTraceLocationDict", + "ExperimentTraceLocationParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "MlflowExperiment", + "MlflowExperimentDict", + "MlflowExperimentParam", + "MlflowExperimentPermission", + "MlflowExperimentPermissionDict", + "MlflowExperimentPermissionParam", + "UcTraceLocation", + "UcTraceLocationDict", + "UcTraceLocationParam", +] + + +from databricks.bundles.experiments._models.experiment_permission_level import ( + ExperimentPermissionLevel, + ExperimentPermissionLevelParam, +) +from databricks.bundles.experiments._models.experiment_tag import ( + ExperimentTag, + ExperimentTagDict, + ExperimentTagParam, +) +from databricks.bundles.experiments._models.experiment_trace_location import ( + ExperimentTraceLocation, + ExperimentTraceLocationDict, + ExperimentTraceLocationParam, +) +from databricks.bundles.experiments._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.experiments._models.mlflow_experiment import ( + MlflowExperiment, + MlflowExperimentDict, + MlflowExperimentParam, +) +from databricks.bundles.experiments._models.mlflow_experiment_permission import ( + MlflowExperimentPermission, + MlflowExperimentPermissionDict, + MlflowExperimentPermissionParam, +) +from databricks.bundles.experiments._models.uc_trace_location import ( + UcTraceLocation, + UcTraceLocationDict, + UcTraceLocationParam, +) diff --git a/python/databricks/bundles/experiments/_models/experiment_permission_level.py b/python/databricks/bundles/experiments/_models/experiment_permission_level.py new file mode 100644 index 00000000000..056727ac92c --- /dev/null +++ b/python/databricks/bundles/experiments/_models/experiment_permission_level.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ExperimentPermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_EDIT = "CAN_EDIT" + CAN_READ = "CAN_READ" + + +ExperimentPermissionLevelParam = ( + Literal["CAN_MANAGE", "CAN_EDIT", "CAN_READ"] | ExperimentPermissionLevel +) diff --git a/python/databricks/bundles/experiments/_models/experiment_tag.py b/python/databricks/bundles/experiments/_models/experiment_tag.py new file mode 100644 index 00000000000..2c78a181b17 --- /dev/null +++ b/python/databricks/bundles/experiments/_models/experiment_tag.py @@ -0,0 +1,52 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ExperimentTag: + """ + A tag for an experiment. + """ + + key: VariableOrOptional[str] = None + """ + The tag key. + """ + + value: VariableOrOptional[str] = None + """ + The tag value. + """ + + @classmethod + def from_dict(cls, value: "ExperimentTagDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ExperimentTagDict": + return _transform_to_json_value(self) # type:ignore + + +class ExperimentTagDict(TypedDict, total=False): + """""" + + key: VariableOrOptional[str] + """ + The tag key. + """ + + value: VariableOrOptional[str] + """ + The tag value. + """ + + +ExperimentTagParam = ExperimentTagDict | ExperimentTag diff --git a/python/databricks/bundles/experiments/_models/experiment_trace_location.py b/python/databricks/bundles/experiments/_models/experiment_trace_location.py new file mode 100644 index 00000000000..cbc9dffb6cf --- /dev/null +++ b/python/databricks/bundles/experiments/_models/experiment_trace_location.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.experiments._models.uc_trace_location import ( + UcTraceLocation, + UcTraceLocationParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ExperimentTraceLocation: + """ + :meta private: [EXPERIMENTAL] + + The storage location for an experiment's traces. + """ + + uc_trace_location: VariableOrOptional[UcTraceLocation] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] A Unity Catalog schema where the experiment's traces are stored as + Delta tables. + """ + + @classmethod + def from_dict(cls, value: "ExperimentTraceLocationDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ExperimentTraceLocationDict": + return _transform_to_json_value(self) # type:ignore + + +class ExperimentTraceLocationDict(TypedDict, total=False): + """""" + + uc_trace_location: VariableOrOptional[UcTraceLocationParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] A Unity Catalog schema where the experiment's traces are stored as + Delta tables. + """ + + +ExperimentTraceLocationParam = ExperimentTraceLocationDict | ExperimentTraceLocation diff --git a/python/databricks/bundles/experiments/_models/lifecycle.py b/python/databricks/bundles/experiments/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/experiments/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/experiments/_models/mlflow_experiment.py b/python/databricks/bundles/experiments/_models/mlflow_experiment.py new file mode 100644 index 00000000000..8a9d5368e99 --- /dev/null +++ b/python/databricks/bundles/experiments/_models/mlflow_experiment.py @@ -0,0 +1,131 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.experiments._models.experiment_tag import ( + ExperimentTag, + ExperimentTagParam, +) +from databricks.bundles.experiments._models.experiment_trace_location import ( + ExperimentTraceLocation, + ExperimentTraceLocationParam, +) +from databricks.bundles.experiments._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.experiments._models.mlflow_experiment_permission import ( + MlflowExperimentPermission, + MlflowExperimentPermissionParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MlflowExperiment(Resource): + """""" + + name: VariableOr[str] + """ + Experiment name. + """ + + artifact_location: VariableOrOptional[str] = None + """ + Location where all artifacts for the experiment are stored. + If not provided, the remote server will select an appropriate default. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[MlflowExperimentPermission] = field( + default_factory=list + ) + """ + The permissions to apply to this resource. + """ + + tags: VariableOrList[ExperimentTag] = field(default_factory=list) + """ + A collection of tags to set on the experiment. Maximum tag size and number of tags per request + depends on the storage backend. All storage backends are guaranteed to support tag keys up + to 250 bytes in size and tag values up to 5000 bytes in size. All storage backends are also + guaranteed to support up to 20 tags per request. + """ + + trace_location: VariableOrOptional[ExperimentTraceLocation] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The location where the experiment's traces are stored. When set, the + underlying storage is provisioned and the experiment's traces are routed + to it. When unset, traces are stored in the default MLflow backend. This + field cannot be updated after the experiment is created. + """ + + @classmethod + def from_dict(cls, value: "MlflowExperimentDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MlflowExperimentDict": + return _transform_to_json_value(self) # type:ignore + + +class MlflowExperimentDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + Experiment name. + """ + + artifact_location: VariableOrOptional[str] + """ + Location where all artifacts for the experiment are stored. + If not provided, the remote server will select an appropriate default. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[MlflowExperimentPermissionParam] + """ + The permissions to apply to this resource. + """ + + tags: VariableOrList[ExperimentTagParam] + """ + A collection of tags to set on the experiment. Maximum tag size and number of tags per request + depends on the storage backend. All storage backends are guaranteed to support tag keys up + to 250 bytes in size and tag values up to 5000 bytes in size. All storage backends are also + guaranteed to support up to 20 tags per request. + """ + + trace_location: VariableOrOptional[ExperimentTraceLocationParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The location where the experiment's traces are stored. When set, the + underlying storage is provisioned and the experiment's traces are routed + to it. When unset, traces are stored in the default MLflow backend. This + field cannot be updated after the experiment is created. + """ + + +MlflowExperimentParam = MlflowExperimentDict | MlflowExperiment diff --git a/python/databricks/bundles/experiments/_models/mlflow_experiment_permission.py b/python/databricks/bundles/experiments/_models/mlflow_experiment_permission.py new file mode 100644 index 00000000000..041b02d91b3 --- /dev/null +++ b/python/databricks/bundles/experiments/_models/mlflow_experiment_permission.py @@ -0,0 +1,76 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.experiments._models.experiment_permission_level import ( + ExperimentPermissionLevel, + ExperimentPermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MlflowExperimentPermission: + """""" + + level: VariableOr[ExperimentPermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "MlflowExperimentPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MlflowExperimentPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class MlflowExperimentPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[ExperimentPermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +MlflowExperimentPermissionParam = ( + MlflowExperimentPermissionDict | MlflowExperimentPermission +) diff --git a/python/databricks/bundles/experiments/_models/uc_trace_location.py b/python/databricks/bundles/experiments/_models/uc_trace_location.py new file mode 100644 index 00000000000..b7b8148823e --- /dev/null +++ b/python/databricks/bundles/experiments/_models/uc_trace_location.py @@ -0,0 +1,87 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class UcTraceLocation: + """ + :meta private: [EXPERIMENTAL] + + A Unity Catalog trace storage location. Traces are stored as Delta tables + in the specified catalog and schema. + """ + + catalog: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The name of the Unity Catalog catalog. + """ + + schema: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The name of the Unity Catalog schema within `catalog`. + """ + + table_prefix: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The prefix for the trace tables, which are named + `{catalog}.{schema}.{table_prefix}_otel_*`. May only contain letters, + digits, and underscores, and may be at most 238 characters. When unset, a + server-generated prefix derived from the experiment ID is used and this + field stays empty on read; the resolved value is always available in + `effective_table_prefix`. + """ + + @classmethod + def from_dict(cls, value: "UcTraceLocationDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "UcTraceLocationDict": + return _transform_to_json_value(self) # type:ignore + + +class UcTraceLocationDict(TypedDict, total=False): + """""" + + catalog: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The name of the Unity Catalog catalog. + """ + + schema: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The name of the Unity Catalog schema within `catalog`. + """ + + table_prefix: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The prefix for the trace tables, which are named + `{catalog}.{schema}.{table_prefix}_otel_*`. May only contain letters, + digits, and underscores, and may be at most 238 characters. When unset, a + server-generated prefix derived from the experiment ID is used and this + field stays empty on read; the resolved value is always available in + `effective_table_prefix`. + """ + + +UcTraceLocationParam = UcTraceLocationDict | UcTraceLocation diff --git a/python/databricks/bundles/external_locations/__init__.py b/python/databricks/bundles/external_locations/__init__.py new file mode 100644 index 00000000000..d6aa3bf908c --- /dev/null +++ b/python/databricks/bundles/external_locations/__init__.py @@ -0,0 +1,90 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "AwsSqsQueue", + "AwsSqsQueueDict", + "AwsSqsQueueParam", + "AzureQueueStorage", + "AzureQueueStorageDict", + "AzureQueueStorageParam", + "EncryptionDetails", + "EncryptionDetailsDict", + "EncryptionDetailsParam", + "ExternalLocation", + "ExternalLocationDict", + "ExternalLocationParam", + "FileEventQueue", + "FileEventQueueDict", + "FileEventQueueParam", + "GcpPubsub", + "GcpPubsubDict", + "GcpPubsubParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "Privilege", + "PrivilegeAssignment", + "PrivilegeAssignmentDict", + "PrivilegeAssignmentParam", + "PrivilegeParam", + "SseEncryptionDetails", + "SseEncryptionDetailsAlgorithm", + "SseEncryptionDetailsAlgorithmParam", + "SseEncryptionDetailsDict", + "SseEncryptionDetailsParam", +] + + +from databricks.bundles.external_locations._models.aws_sqs_queue import ( + AwsSqsQueue, + AwsSqsQueueDict, + AwsSqsQueueParam, +) +from databricks.bundles.external_locations._models.azure_queue_storage import ( + AzureQueueStorage, + AzureQueueStorageDict, + AzureQueueStorageParam, +) +from databricks.bundles.external_locations._models.encryption_details import ( + EncryptionDetails, + EncryptionDetailsDict, + EncryptionDetailsParam, +) +from databricks.bundles.external_locations._models.external_location import ( + ExternalLocation, + ExternalLocationDict, + ExternalLocationParam, +) +from databricks.bundles.external_locations._models.file_event_queue import ( + FileEventQueue, + FileEventQueueDict, + FileEventQueueParam, +) +from databricks.bundles.external_locations._models.gcp_pubsub import ( + GcpPubsub, + GcpPubsubDict, + GcpPubsubParam, +) +from databricks.bundles.external_locations._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.external_locations._models.privilege import ( + Privilege, + PrivilegeParam, +) +from databricks.bundles.external_locations._models.privilege_assignment import ( + PrivilegeAssignment, + PrivilegeAssignmentDict, + PrivilegeAssignmentParam, +) +from databricks.bundles.external_locations._models.sse_encryption_details import ( + SseEncryptionDetails, + SseEncryptionDetailsDict, + SseEncryptionDetailsParam, +) +from databricks.bundles.external_locations._models.sse_encryption_details_algorithm import ( + SseEncryptionDetailsAlgorithm, + SseEncryptionDetailsAlgorithmParam, +) diff --git a/python/databricks/bundles/external_locations/_models/aws_sqs_queue.py b/python/databricks/bundles/external_locations/_models/aws_sqs_queue.py new file mode 100644 index 00000000000..53c7a0b7062 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/aws_sqs_queue.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AwsSqsQueue: + """""" + + queue_url: VariableOrOptional[str] = None + """ + The AQS queue url in the format https://sqs.{region}.amazonaws.com/{account id}/{queue name}. + Only required for provided_sqs. + """ + + @classmethod + def from_dict(cls, value: "AwsSqsQueueDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AwsSqsQueueDict": + return _transform_to_json_value(self) # type:ignore + + +class AwsSqsQueueDict(TypedDict, total=False): + """""" + + queue_url: VariableOrOptional[str] + """ + The AQS queue url in the format https://sqs.{region}.amazonaws.com/{account id}/{queue name}. + Only required for provided_sqs. + """ + + +AwsSqsQueueParam = AwsSqsQueueDict | AwsSqsQueue diff --git a/python/databricks/bundles/external_locations/_models/azure_queue_storage.py b/python/databricks/bundles/external_locations/_models/azure_queue_storage.py new file mode 100644 index 00000000000..a8d182421f7 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/azure_queue_storage.py @@ -0,0 +1,70 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AzureQueueStorage: + """""" + + queue_url: VariableOrOptional[str] = None + """ + The AQS queue url in the format https://{storage account}.queue.core.windows.net/{queue name} + Only required for provided_aqs. + """ + + resource_group: VariableOrOptional[str] = None + """ + Optional resource group for the queue, event grid subscription, and external location storage + account. + Only required for locations with a service principal storage credential + """ + + subscription_id: VariableOrOptional[str] = None + """ + Optional subscription id for the queue, event grid subscription, and external location storage + account. + Required for locations with a service principal storage credential + """ + + @classmethod + def from_dict(cls, value: "AzureQueueStorageDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AzureQueueStorageDict": + return _transform_to_json_value(self) # type:ignore + + +class AzureQueueStorageDict(TypedDict, total=False): + """""" + + queue_url: VariableOrOptional[str] + """ + The AQS queue url in the format https://{storage account}.queue.core.windows.net/{queue name} + Only required for provided_aqs. + """ + + resource_group: VariableOrOptional[str] + """ + Optional resource group for the queue, event grid subscription, and external location storage + account. + Only required for locations with a service principal storage credential + """ + + subscription_id: VariableOrOptional[str] + """ + Optional subscription id for the queue, event grid subscription, and external location storage + account. + Required for locations with a service principal storage credential + """ + + +AzureQueueStorageParam = AzureQueueStorageDict | AzureQueueStorage diff --git a/python/databricks/bundles/external_locations/_models/encryption_details.py b/python/databricks/bundles/external_locations/_models/encryption_details.py new file mode 100644 index 00000000000..d1b67fa76bd --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/encryption_details.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.external_locations._models.sse_encryption_details import ( + SseEncryptionDetails, + SseEncryptionDetailsParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EncryptionDetails: + """ + Encryption options that apply to clients connecting to cloud storage. + """ + + sse_encryption_details: VariableOrOptional[SseEncryptionDetails] = None + """ + Server-Side Encryption properties for clients communicating with AWS s3. + """ + + @classmethod + def from_dict(cls, value: "EncryptionDetailsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EncryptionDetailsDict": + return _transform_to_json_value(self) # type:ignore + + +class EncryptionDetailsDict(TypedDict, total=False): + """""" + + sse_encryption_details: VariableOrOptional[SseEncryptionDetailsParam] + """ + Server-Side Encryption properties for clients communicating with AWS s3. + """ + + +EncryptionDetailsParam = EncryptionDetailsDict | EncryptionDetails diff --git a/python/databricks/bundles/external_locations/_models/external_location.py b/python/databricks/bundles/external_locations/_models/external_location.py new file mode 100644 index 00000000000..ea72a5da3dd --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/external_location.py @@ -0,0 +1,173 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.external_locations._models.encryption_details import ( + EncryptionDetails, + EncryptionDetailsParam, +) +from databricks.bundles.external_locations._models.file_event_queue import ( + FileEventQueue, + FileEventQueueParam, +) +from databricks.bundles.external_locations._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.external_locations._models.privilege_assignment import ( + PrivilegeAssignment, + PrivilegeAssignmentParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ExternalLocation(Resource): + """""" + + credential_name: VariableOr[str] + """ + Name of the storage credential used with this location. + """ + + name: VariableOr[str] + """ + Name of the external location. + """ + + url: VariableOr[str] + """ + Path URL of the external location. + """ + + comment: VariableOrOptional[str] = None + """ + User-provided free-form text description. + """ + + enable_file_events: VariableOrOptional[bool] = None + """ + Whether to enable file events on this external location. Default to `true`. Set to `false` to disable file events. + The actual applied value may differ due to server-side defaults; check `effective_enable_file_events` for the effective state. + """ + + encryption_details: VariableOrOptional[EncryptionDetails] = None + """ + Encryption options that apply to clients connecting to cloud storage. + """ + + fallback: VariableOrOptional[bool] = None + """ + Indicates whether fallback mode is enabled for this external location. When fallback mode is enabled, the access to the location falls back to cluster credentials if UC credentials are not sufficient. + """ + + file_event_queue: VariableOrOptional[FileEventQueue] = None + """ + File event queue settings. If `enable_file_events` is not `false`, must be defined and have exactly one of the documented properties. + """ + + grants: VariableOrList[PrivilegeAssignment] = field(default_factory=list) + """ + The Unity Catalog privileges to grant to principals on this securable. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + read_only: VariableOrOptional[bool] = None + """ + Indicates whether the external location is read-only. + """ + + skip_validation: VariableOrOptional[bool] = None + """ + Skips validation of the storage credential associated with the external location. + """ + + @classmethod + def from_dict(cls, value: "ExternalLocationDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ExternalLocationDict": + return _transform_to_json_value(self) # type:ignore + + +class ExternalLocationDict(TypedDict, total=False): + """""" + + credential_name: VariableOr[str] + """ + Name of the storage credential used with this location. + """ + + name: VariableOr[str] + """ + Name of the external location. + """ + + url: VariableOr[str] + """ + Path URL of the external location. + """ + + comment: VariableOrOptional[str] + """ + User-provided free-form text description. + """ + + enable_file_events: VariableOrOptional[bool] + """ + Whether to enable file events on this external location. Default to `true`. Set to `false` to disable file events. + The actual applied value may differ due to server-side defaults; check `effective_enable_file_events` for the effective state. + """ + + encryption_details: VariableOrOptional[EncryptionDetailsParam] + """ + Encryption options that apply to clients connecting to cloud storage. + """ + + fallback: VariableOrOptional[bool] + """ + Indicates whether fallback mode is enabled for this external location. When fallback mode is enabled, the access to the location falls back to cluster credentials if UC credentials are not sufficient. + """ + + file_event_queue: VariableOrOptional[FileEventQueueParam] + """ + File event queue settings. If `enable_file_events` is not `false`, must be defined and have exactly one of the documented properties. + """ + + grants: VariableOrList[PrivilegeAssignmentParam] + """ + The Unity Catalog privileges to grant to principals on this securable. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + read_only: VariableOrOptional[bool] + """ + Indicates whether the external location is read-only. + """ + + skip_validation: VariableOrOptional[bool] + """ + Skips validation of the storage credential associated with the external location. + """ + + +ExternalLocationParam = ExternalLocationDict | ExternalLocation diff --git a/python/databricks/bundles/external_locations/_models/file_event_queue.py b/python/databricks/bundles/external_locations/_models/file_event_queue.py new file mode 100644 index 00000000000..78a791766cd --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/file_event_queue.py @@ -0,0 +1,66 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.external_locations._models.aws_sqs_queue import ( + AwsSqsQueue, + AwsSqsQueueParam, +) +from databricks.bundles.external_locations._models.azure_queue_storage import ( + AzureQueueStorage, + AzureQueueStorageParam, +) +from databricks.bundles.external_locations._models.gcp_pubsub import ( + GcpPubsub, + GcpPubsubParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class FileEventQueue: + """""" + + managed_aqs: VariableOrOptional[AzureQueueStorage] = None + + managed_pubsub: VariableOrOptional[GcpPubsub] = None + + managed_sqs: VariableOrOptional[AwsSqsQueue] = None + + provided_aqs: VariableOrOptional[AzureQueueStorage] = None + + provided_pubsub: VariableOrOptional[GcpPubsub] = None + + provided_sqs: VariableOrOptional[AwsSqsQueue] = None + + @classmethod + def from_dict(cls, value: "FileEventQueueDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "FileEventQueueDict": + return _transform_to_json_value(self) # type:ignore + + +class FileEventQueueDict(TypedDict, total=False): + """""" + + managed_aqs: VariableOrOptional[AzureQueueStorageParam] + + managed_pubsub: VariableOrOptional[GcpPubsubParam] + + managed_sqs: VariableOrOptional[AwsSqsQueueParam] + + provided_aqs: VariableOrOptional[AzureQueueStorageParam] + + provided_pubsub: VariableOrOptional[GcpPubsubParam] + + provided_sqs: VariableOrOptional[AwsSqsQueueParam] + + +FileEventQueueParam = FileEventQueueDict | FileEventQueue diff --git a/python/databricks/bundles/external_locations/_models/gcp_pubsub.py b/python/databricks/bundles/external_locations/_models/gcp_pubsub.py new file mode 100644 index 00000000000..926b27d2a55 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/gcp_pubsub.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class GcpPubsub: + """""" + + subscription_name: VariableOrOptional[str] = None + """ + The Pub/Sub subscription name in the format projects/{project}/subscriptions/{subscription name}. + Only required for provided_pubsub. + """ + + @classmethod + def from_dict(cls, value: "GcpPubsubDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "GcpPubsubDict": + return _transform_to_json_value(self) # type:ignore + + +class GcpPubsubDict(TypedDict, total=False): + """""" + + subscription_name: VariableOrOptional[str] + """ + The Pub/Sub subscription name in the format projects/{project}/subscriptions/{subscription name}. + Only required for provided_pubsub. + """ + + +GcpPubsubParam = GcpPubsubDict | GcpPubsub diff --git a/python/databricks/bundles/external_locations/_models/lifecycle.py b/python/databricks/bundles/external_locations/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/external_locations/_models/privilege.py b/python/databricks/bundles/external_locations/_models/privilege.py new file mode 100644 index 00000000000..21a52a2f112 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/privilege.py @@ -0,0 +1,116 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class Privilege(Enum): + SELECT = "SELECT" + READ_PRIVATE_FILES = "READ_PRIVATE_FILES" + WRITE_PRIVATE_FILES = "WRITE_PRIVATE_FILES" + CREATE = "CREATE" + USAGE = "USAGE" + USE_CATALOG = "USE_CATALOG" + USE_SCHEMA = "USE_SCHEMA" + CREATE_SCHEMA = "CREATE_SCHEMA" + CREATE_VIEW = "CREATE_VIEW" + CREATE_EXTERNAL_TABLE = "CREATE_EXTERNAL_TABLE" + CREATE_MATERIALIZED_VIEW = "CREATE_MATERIALIZED_VIEW" + CREATE_FUNCTION = "CREATE_FUNCTION" + CREATE_MODEL = "CREATE_MODEL" + CREATE_CATALOG = "CREATE_CATALOG" + CREATE_MANAGED_STORAGE = "CREATE_MANAGED_STORAGE" + CREATE_EXTERNAL_LOCATION = "CREATE_EXTERNAL_LOCATION" + CREATE_STORAGE_CREDENTIAL = "CREATE_STORAGE_CREDENTIAL" + CREATE_SERVICE_CREDENTIAL = "CREATE_SERVICE_CREDENTIAL" + ACCESS = "ACCESS" + CREATE_SHARE = "CREATE_SHARE" + CREATE_RECIPIENT = "CREATE_RECIPIENT" + CREATE_PROVIDER = "CREATE_PROVIDER" + USE_SHARE = "USE_SHARE" + USE_RECIPIENT = "USE_RECIPIENT" + USE_PROVIDER = "USE_PROVIDER" + USE_MARKETPLACE_ASSETS = "USE_MARKETPLACE_ASSETS" + SET_SHARE_PERMISSION = "SET_SHARE_PERMISSION" + MODIFY = "MODIFY" + REFRESH = "REFRESH" + EXECUTE = "EXECUTE" + READ_FILES = "READ_FILES" + WRITE_FILES = "WRITE_FILES" + CREATE_TABLE = "CREATE_TABLE" + ALL_PRIVILEGES = "ALL_PRIVILEGES" + CREATE_CONNECTION = "CREATE_CONNECTION" + USE_CONNECTION = "USE_CONNECTION" + APPLY_TAG = "APPLY_TAG" + CREATE_FOREIGN_CATALOG = "CREATE_FOREIGN_CATALOG" + CREATE_FOREIGN_SECURABLE = "CREATE_FOREIGN_SECURABLE" + MANAGE_ALLOWLIST = "MANAGE_ALLOWLIST" + CREATE_VOLUME = "CREATE_VOLUME" + CREATE_EXTERNAL_VOLUME = "CREATE_EXTERNAL_VOLUME" + READ_VOLUME = "READ_VOLUME" + WRITE_VOLUME = "WRITE_VOLUME" + MANAGE = "MANAGE" + BROWSE = "BROWSE" + CREATE_CLEAN_ROOM = "CREATE_CLEAN_ROOM" + MODIFY_CLEAN_ROOM = "MODIFY_CLEAN_ROOM" + EXECUTE_CLEAN_ROOM_TASK = "EXECUTE_CLEAN_ROOM_TASK" + EXTERNAL_USE_SCHEMA = "EXTERNAL_USE_SCHEMA" + READ_METADATA = "READ_METADATA" + + +PrivilegeParam = ( + Literal[ + "SELECT", + "READ_PRIVATE_FILES", + "WRITE_PRIVATE_FILES", + "CREATE", + "USAGE", + "USE_CATALOG", + "USE_SCHEMA", + "CREATE_SCHEMA", + "CREATE_VIEW", + "CREATE_EXTERNAL_TABLE", + "CREATE_MATERIALIZED_VIEW", + "CREATE_FUNCTION", + "CREATE_MODEL", + "CREATE_CATALOG", + "CREATE_MANAGED_STORAGE", + "CREATE_EXTERNAL_LOCATION", + "CREATE_STORAGE_CREDENTIAL", + "CREATE_SERVICE_CREDENTIAL", + "ACCESS", + "CREATE_SHARE", + "CREATE_RECIPIENT", + "CREATE_PROVIDER", + "USE_SHARE", + "USE_RECIPIENT", + "USE_PROVIDER", + "USE_MARKETPLACE_ASSETS", + "SET_SHARE_PERMISSION", + "MODIFY", + "REFRESH", + "EXECUTE", + "READ_FILES", + "WRITE_FILES", + "CREATE_TABLE", + "ALL_PRIVILEGES", + "CREATE_CONNECTION", + "USE_CONNECTION", + "APPLY_TAG", + "CREATE_FOREIGN_CATALOG", + "CREATE_FOREIGN_SECURABLE", + "MANAGE_ALLOWLIST", + "CREATE_VOLUME", + "CREATE_EXTERNAL_VOLUME", + "READ_VOLUME", + "WRITE_VOLUME", + "MANAGE", + "BROWSE", + "CREATE_CLEAN_ROOM", + "MODIFY_CLEAN_ROOM", + "EXECUTE_CLEAN_ROOM_TASK", + "EXTERNAL_USE_SCHEMA", + "READ_METADATA", + ] + | Privilege +) diff --git a/python/databricks/bundles/external_locations/_models/privilege_assignment.py b/python/databricks/bundles/external_locations/_models/privilege_assignment.py new file mode 100644 index 00000000000..f48f9511ac0 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/privilege_assignment.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.external_locations._models.privilege import ( + Privilege, + PrivilegeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PrivilegeAssignment: + """""" + + principal: VariableOrOptional[str] = None + """ + The principal (user email address or group name). + For deleted principals, `principal` is empty while `principal_id` is populated. + """ + + privileges: VariableOrList[Privilege] = field(default_factory=list) + """ + The privileges assigned to the principal. + """ + + @classmethod + def from_dict(cls, value: "PrivilegeAssignmentDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PrivilegeAssignmentDict": + return _transform_to_json_value(self) # type:ignore + + +class PrivilegeAssignmentDict(TypedDict, total=False): + """""" + + principal: VariableOrOptional[str] + """ + The principal (user email address or group name). + For deleted principals, `principal` is empty while `principal_id` is populated. + """ + + privileges: VariableOrList[PrivilegeParam] + """ + The privileges assigned to the principal. + """ + + +PrivilegeAssignmentParam = PrivilegeAssignmentDict | PrivilegeAssignment diff --git a/python/databricks/bundles/external_locations/_models/sse_encryption_details.py b/python/databricks/bundles/external_locations/_models/sse_encryption_details.py new file mode 100644 index 00000000000..339b98b8b26 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/sse_encryption_details.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.external_locations._models.sse_encryption_details_algorithm import ( + SseEncryptionDetailsAlgorithm, + SseEncryptionDetailsAlgorithmParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SseEncryptionDetails: + """ + Server-Side Encryption properties for clients communicating with AWS s3. + """ + + algorithm: VariableOrOptional[SseEncryptionDetailsAlgorithm] = None + """ + Sets the value of the 'x-amz-server-side-encryption' header in S3 request. + """ + + aws_kms_key_arn: VariableOrOptional[str] = None + """ + Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS". + Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header. + """ + + @classmethod + def from_dict(cls, value: "SseEncryptionDetailsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SseEncryptionDetailsDict": + return _transform_to_json_value(self) # type:ignore + + +class SseEncryptionDetailsDict(TypedDict, total=False): + """""" + + algorithm: VariableOrOptional[SseEncryptionDetailsAlgorithmParam] + """ + Sets the value of the 'x-amz-server-side-encryption' header in S3 request. + """ + + aws_kms_key_arn: VariableOrOptional[str] + """ + Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS". + Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header. + """ + + +SseEncryptionDetailsParam = SseEncryptionDetailsDict | SseEncryptionDetails diff --git a/python/databricks/bundles/external_locations/_models/sse_encryption_details_algorithm.py b/python/databricks/bundles/external_locations/_models/sse_encryption_details_algorithm.py new file mode 100644 index 00000000000..d5d63383a74 --- /dev/null +++ b/python/databricks/bundles/external_locations/_models/sse_encryption_details_algorithm.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SseEncryptionDetailsAlgorithm(Enum): + """ + SSE algorithm to use for encrypting S3 objects + """ + + AWS_SSE_S3 = "AWS_SSE_S3" + AWS_SSE_KMS = "AWS_SSE_KMS" + + +SseEncryptionDetailsAlgorithmParam = ( + Literal["AWS_SSE_S3", "AWS_SSE_KMS"] | SseEncryptionDetailsAlgorithm +) diff --git a/python/databricks/bundles/instance_pools/__init__.py b/python/databricks/bundles/instance_pools/__init__.py new file mode 100644 index 00000000000..2c5a0e1c4eb --- /dev/null +++ b/python/databricks/bundles/instance_pools/__init__.py @@ -0,0 +1,130 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DiskSpec", + "DiskSpecDict", + "DiskSpecParam", + "DiskType", + "DiskTypeAzureDiskVolumeType", + "DiskTypeAzureDiskVolumeTypeParam", + "DiskTypeDict", + "DiskTypeEbsVolumeType", + "DiskTypeEbsVolumeTypeParam", + "DiskTypeParam", + "DockerBasicAuth", + "DockerBasicAuthDict", + "DockerBasicAuthParam", + "DockerImage", + "DockerImageDict", + "DockerImageParam", + "GcpAvailability", + "GcpAvailabilityParam", + "InstancePool", + "InstancePoolAwsAttributes", + "InstancePoolAwsAttributesAvailability", + "InstancePoolAwsAttributesAvailabilityParam", + "InstancePoolAwsAttributesDict", + "InstancePoolAwsAttributesParam", + "InstancePoolAzureAttributes", + "InstancePoolAzureAttributesAvailability", + "InstancePoolAzureAttributesAvailabilityParam", + "InstancePoolAzureAttributesDict", + "InstancePoolAzureAttributesParam", + "InstancePoolDict", + "InstancePoolGcpAttributes", + "InstancePoolGcpAttributesDict", + "InstancePoolGcpAttributesParam", + "InstancePoolParam", + "InstancePoolPermission", + "InstancePoolPermissionDict", + "InstancePoolPermissionLevel", + "InstancePoolPermissionLevelParam", + "InstancePoolPermissionParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "NodeTypeFlexibility", + "NodeTypeFlexibilityDict", + "NodeTypeFlexibilityParam", +] + + +from databricks.bundles.instance_pools._models.disk_spec import ( + DiskSpec, + DiskSpecDict, + DiskSpecParam, +) +from databricks.bundles.instance_pools._models.disk_type import ( + DiskType, + DiskTypeDict, + DiskTypeParam, +) +from databricks.bundles.instance_pools._models.disk_type_azure_disk_volume_type import ( + DiskTypeAzureDiskVolumeType, + DiskTypeAzureDiskVolumeTypeParam, +) +from databricks.bundles.instance_pools._models.disk_type_ebs_volume_type import ( + DiskTypeEbsVolumeType, + DiskTypeEbsVolumeTypeParam, +) +from databricks.bundles.instance_pools._models.docker_basic_auth import ( + DockerBasicAuth, + DockerBasicAuthDict, + DockerBasicAuthParam, +) +from databricks.bundles.instance_pools._models.docker_image import ( + DockerImage, + DockerImageDict, + DockerImageParam, +) +from databricks.bundles.instance_pools._models.gcp_availability import ( + GcpAvailability, + GcpAvailabilityParam, +) +from databricks.bundles.instance_pools._models.instance_pool import ( + InstancePool, + InstancePoolDict, + InstancePoolParam, +) +from databricks.bundles.instance_pools._models.instance_pool_aws_attributes import ( + InstancePoolAwsAttributes, + InstancePoolAwsAttributesDict, + InstancePoolAwsAttributesParam, +) +from databricks.bundles.instance_pools._models.instance_pool_aws_attributes_availability import ( + InstancePoolAwsAttributesAvailability, + InstancePoolAwsAttributesAvailabilityParam, +) +from databricks.bundles.instance_pools._models.instance_pool_azure_attributes import ( + InstancePoolAzureAttributes, + InstancePoolAzureAttributesDict, + InstancePoolAzureAttributesParam, +) +from databricks.bundles.instance_pools._models.instance_pool_azure_attributes_availability import ( + InstancePoolAzureAttributesAvailability, + InstancePoolAzureAttributesAvailabilityParam, +) +from databricks.bundles.instance_pools._models.instance_pool_gcp_attributes import ( + InstancePoolGcpAttributes, + InstancePoolGcpAttributesDict, + InstancePoolGcpAttributesParam, +) +from databricks.bundles.instance_pools._models.instance_pool_permission import ( + InstancePoolPermission, + InstancePoolPermissionDict, + InstancePoolPermissionParam, +) +from databricks.bundles.instance_pools._models.instance_pool_permission_level import ( + InstancePoolPermissionLevel, + InstancePoolPermissionLevelParam, +) +from databricks.bundles.instance_pools._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.instance_pools._models.node_type_flexibility import ( + NodeTypeFlexibility, + NodeTypeFlexibilityDict, + NodeTypeFlexibilityParam, +) diff --git a/python/databricks/bundles/instance_pools/_models/disk_spec.py b/python/databricks/bundles/instance_pools/_models/disk_spec.py new file mode 100644 index 00000000000..b9edbb5d4e8 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/disk_spec.py @@ -0,0 +1,136 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.instance_pools._models.disk_type import DiskType, DiskTypeParam + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DiskSpec: + """ + Describes the disks that are launched for each instance in the spark cluster. + For example, if the cluster has 3 instances, each instance is configured to launch + 2 disks, 100 GiB each, then Databricks will launch a total of 6 disks, + 100 GiB each, for this cluster. + """ + + disk_count: VariableOrOptional[int] = None + """ + The number of disks launched for each instance: + - This feature is only enabled for supported node types. + - Users can choose up to the limit of the disks supported by the node type. + - For node types with no OS disk, at least one disk must be specified; + otherwise, cluster creation will fail. + + If disks are attached, Databricks will configure Spark to use only the disks for + scratch storage, because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no disks are attached, Databricks will configure Spark to use + instance store disks. + + Note: If disks are specified, then the Spark configuration + `spark.local.dir` will be overridden. + + Disks will be mounted at: + - For AWS: `/ebs0`, `/ebs1`, and etc. + - For Azure: `/remote_volume0`, `/remote_volume1`, and etc. + """ + + disk_iops: VariableOrOptional[int] = None + """ + The number of IOPS to provision for each attached disk. + """ + + disk_size: VariableOrOptional[int] = None + """ + The size of each disk (in GiB) launched for each instance. + Values must fall into the supported range for a particular instance type. + + For AWS: + - General Purpose SSD: 100 - 4096 GiB + - Throughput Optimized HDD: 500 - 4096 GiB + + For Azure: + - Premium LRS (SSD): 1 - 1023 GiB + - Standard LRS (HDD): 1- 1023 GiB + """ + + disk_throughput: VariableOrOptional[int] = None + """ + The disk throughput to provision for each attached disk, in MB per second. + """ + + disk_type: VariableOrOptional[DiskType] = None + """ + The type of disks that will be launched with this cluster. + """ + + @classmethod + def from_dict(cls, value: "DiskSpecDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DiskSpecDict": + return _transform_to_json_value(self) # type:ignore + + +class DiskSpecDict(TypedDict, total=False): + """""" + + disk_count: VariableOrOptional[int] + """ + The number of disks launched for each instance: + - This feature is only enabled for supported node types. + - Users can choose up to the limit of the disks supported by the node type. + - For node types with no OS disk, at least one disk must be specified; + otherwise, cluster creation will fail. + + If disks are attached, Databricks will configure Spark to use only the disks for + scratch storage, because heterogenously sized scratch devices can lead to inefficient disk + utilization. If no disks are attached, Databricks will configure Spark to use + instance store disks. + + Note: If disks are specified, then the Spark configuration + `spark.local.dir` will be overridden. + + Disks will be mounted at: + - For AWS: `/ebs0`, `/ebs1`, and etc. + - For Azure: `/remote_volume0`, `/remote_volume1`, and etc. + """ + + disk_iops: VariableOrOptional[int] + """ + The number of IOPS to provision for each attached disk. + """ + + disk_size: VariableOrOptional[int] + """ + The size of each disk (in GiB) launched for each instance. + Values must fall into the supported range for a particular instance type. + + For AWS: + - General Purpose SSD: 100 - 4096 GiB + - Throughput Optimized HDD: 500 - 4096 GiB + + For Azure: + - Premium LRS (SSD): 1 - 1023 GiB + - Standard LRS (HDD): 1- 1023 GiB + """ + + disk_throughput: VariableOrOptional[int] + """ + The disk throughput to provision for each attached disk, in MB per second. + """ + + disk_type: VariableOrOptional[DiskTypeParam] + """ + The type of disks that will be launched with this cluster. + """ + + +DiskSpecParam = DiskSpecDict | DiskSpec diff --git a/python/databricks/bundles/instance_pools/_models/disk_type.py b/python/databricks/bundles/instance_pools/_models/disk_type.py new file mode 100644 index 00000000000..752bf75bf78 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/disk_type.py @@ -0,0 +1,64 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.instance_pools._models.disk_type_azure_disk_volume_type import ( + DiskTypeAzureDiskVolumeType, + DiskTypeAzureDiskVolumeTypeParam, +) +from databricks.bundles.instance_pools._models.disk_type_ebs_volume_type import ( + DiskTypeEbsVolumeType, + DiskTypeEbsVolumeTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DiskType: + """ + Describes the disk type. + """ + + azure_disk_volume_type: VariableOrOptional[DiskTypeAzureDiskVolumeType] = None + """ + All Azure Disk types that Databricks supports. + See https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks + """ + + ebs_volume_type: VariableOrOptional[DiskTypeEbsVolumeType] = None + """ + All EBS volume types that Databricks supports. + See https://aws.amazon.com/ebs/details/ for details. + """ + + @classmethod + def from_dict(cls, value: "DiskTypeDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DiskTypeDict": + return _transform_to_json_value(self) # type:ignore + + +class DiskTypeDict(TypedDict, total=False): + """""" + + azure_disk_volume_type: VariableOrOptional[DiskTypeAzureDiskVolumeTypeParam] + """ + All Azure Disk types that Databricks supports. + See https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks + """ + + ebs_volume_type: VariableOrOptional[DiskTypeEbsVolumeTypeParam] + """ + All EBS volume types that Databricks supports. + See https://aws.amazon.com/ebs/details/ for details. + """ + + +DiskTypeParam = DiskTypeDict | DiskType diff --git a/python/databricks/bundles/instance_pools/_models/disk_type_azure_disk_volume_type.py b/python/databricks/bundles/instance_pools/_models/disk_type_azure_disk_volume_type.py new file mode 100644 index 00000000000..740ab2dd245 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/disk_type_azure_disk_volume_type.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class DiskTypeAzureDiskVolumeType(Enum): + """ + All Azure Disk types that Databricks supports. + See https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks + """ + + PREMIUM_LRS = "PREMIUM_LRS" + STANDARD_LRS = "STANDARD_LRS" + + +DiskTypeAzureDiskVolumeTypeParam = ( + Literal["PREMIUM_LRS", "STANDARD_LRS"] | DiskTypeAzureDiskVolumeType +) diff --git a/python/databricks/bundles/instance_pools/_models/disk_type_ebs_volume_type.py b/python/databricks/bundles/instance_pools/_models/disk_type_ebs_volume_type.py new file mode 100644 index 00000000000..cb5ae6b7a05 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/disk_type_ebs_volume_type.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class DiskTypeEbsVolumeType(Enum): + """ + All EBS volume types that Databricks supports. + See https://aws.amazon.com/ebs/details/ for details. + """ + + GENERAL_PURPOSE_SSD = "GENERAL_PURPOSE_SSD" + THROUGHPUT_OPTIMIZED_HDD = "THROUGHPUT_OPTIMIZED_HDD" + + +DiskTypeEbsVolumeTypeParam = ( + Literal["GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"] | DiskTypeEbsVolumeType +) diff --git a/python/databricks/bundles/instance_pools/_models/docker_basic_auth.py b/python/databricks/bundles/instance_pools/_models/docker_basic_auth.py new file mode 100644 index 00000000000..552ea90a83b --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/docker_basic_auth.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DockerBasicAuth: + """""" + + password: VariableOrOptional[str] = None + """ + Password of the user + """ + + username: VariableOrOptional[str] = None + """ + Name of the user + """ + + @classmethod + def from_dict(cls, value: "DockerBasicAuthDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DockerBasicAuthDict": + return _transform_to_json_value(self) # type:ignore + + +class DockerBasicAuthDict(TypedDict, total=False): + """""" + + password: VariableOrOptional[str] + """ + Password of the user + """ + + username: VariableOrOptional[str] + """ + Name of the user + """ + + +DockerBasicAuthParam = DockerBasicAuthDict | DockerBasicAuth diff --git a/python/databricks/bundles/instance_pools/_models/docker_image.py b/python/databricks/bundles/instance_pools/_models/docker_image.py new file mode 100644 index 00000000000..15b43d46554 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/docker_image.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.instance_pools._models.docker_basic_auth import ( + DockerBasicAuth, + DockerBasicAuthParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DockerImage: + """""" + + basic_auth: VariableOrOptional[DockerBasicAuth] = None + """ + Basic auth with username and password + """ + + url: VariableOrOptional[str] = None + """ + URL of the docker image. + """ + + @classmethod + def from_dict(cls, value: "DockerImageDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DockerImageDict": + return _transform_to_json_value(self) # type:ignore + + +class DockerImageDict(TypedDict, total=False): + """""" + + basic_auth: VariableOrOptional[DockerBasicAuthParam] + """ + Basic auth with username and password + """ + + url: VariableOrOptional[str] + """ + URL of the docker image. + """ + + +DockerImageParam = DockerImageDict | DockerImage diff --git a/python/databricks/bundles/instance_pools/_models/gcp_availability.py b/python/databricks/bundles/instance_pools/_models/gcp_availability.py new file mode 100644 index 00000000000..0d391b87fe3 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/gcp_availability.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class GcpAvailability(Enum): + """ + This field determines whether the instance pool will contain preemptible + VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + """ + + PREEMPTIBLE_GCP = "PREEMPTIBLE_GCP" + ON_DEMAND_GCP = "ON_DEMAND_GCP" + PREEMPTIBLE_WITH_FALLBACK_GCP = "PREEMPTIBLE_WITH_FALLBACK_GCP" + + +GcpAvailabilityParam = ( + Literal["PREEMPTIBLE_GCP", "ON_DEMAND_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"] + | GcpAvailability +) diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool.py b/python/databricks/bundles/instance_pools/_models/instance_pool.py new file mode 100644 index 00000000000..2b10f210284 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool.py @@ -0,0 +1,289 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrDict, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.instance_pools._models.disk_spec import DiskSpec, DiskSpecParam +from databricks.bundles.instance_pools._models.docker_image import ( + DockerImage, + DockerImageParam, +) +from databricks.bundles.instance_pools._models.instance_pool_aws_attributes import ( + InstancePoolAwsAttributes, + InstancePoolAwsAttributesParam, +) +from databricks.bundles.instance_pools._models.instance_pool_azure_attributes import ( + InstancePoolAzureAttributes, + InstancePoolAzureAttributesParam, +) +from databricks.bundles.instance_pools._models.instance_pool_gcp_attributes import ( + InstancePoolGcpAttributes, + InstancePoolGcpAttributesParam, +) +from databricks.bundles.instance_pools._models.instance_pool_permission import ( + InstancePoolPermission, + InstancePoolPermissionParam, +) +from databricks.bundles.instance_pools._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.instance_pools._models.node_type_flexibility import ( + NodeTypeFlexibility, + NodeTypeFlexibilityParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class InstancePool(Resource): + """""" + + instance_pool_name: VariableOr[str] + """ + Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100 + characters. + """ + + node_type_id: VariableOr[str] + """ + This field encodes, through a single value, the resources available to each of + the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + and optimized for memory or compute intensive workloads. A list of available node + types can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call. + """ + + aws_attributes: VariableOrOptional[InstancePoolAwsAttributes] = None + """ + Attributes related to instance pools running on Amazon Web Services. + If not specified at pool creation, a set of default values will be used. + """ + + azure_attributes: VariableOrOptional[InstancePoolAzureAttributes] = None + """ + Attributes related to instance pools running on Azure. + If not specified at pool creation, a set of default values will be used. + """ + + custom_tags: VariableOrDict[str] = field(default_factory=dict) + """ + Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS + instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + + - Currently, Databricks allows at most 45 custom tags + """ + + disk_spec: VariableOrOptional[DiskSpec] = None + """ + Defines the specification of the disks that will be attached to all spark containers. + """ + + enable_elastic_disk: VariableOrOptional[bool] = None + """ + Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire + additional disk space when its Spark workers are running low on disk space. In AWS, this + feature requires specific AWS permissions to function correctly - refer to the User Guide for + more details. + """ + + gcp_attributes: VariableOrOptional[InstancePoolGcpAttributes] = None + """ + Attributes related to instance pools running on Google Cloud Platform. + If not specified at pool creation, a set of default values will be used. + """ + + idle_instance_autotermination_minutes: VariableOrOptional[int] = None + """ + Automatically terminates the extra instances in the pool cache after they are inactive for this + time in minutes if min_idle_instances requirement is already met. If not set, the extra pool + instances will be automatically terminated after a default timeout. If specified, the + threshold must be between 0 and 10000 minutes. + Users can also set this value to 0 to instantly remove idle instances from the cache if + min cache size could still hold. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + max_capacity: VariableOrOptional[int] = None + """ + Maximum number of outstanding instances to keep in the pool, including both instances used by + clusters and idle instances. Clusters that require further instance provisioning will fail during + upsize requests. + """ + + min_idle_instances: VariableOrOptional[int] = None + """ + Minimum number of idle instances to keep in the instance pool + """ + + node_type_flexibility: VariableOrOptional[NodeTypeFlexibility] = None + """ + Flexible node type configuration for the pool. + """ + + permissions: VariableOrList[InstancePoolPermission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + preloaded_docker_images: VariableOrList[DockerImage] = field(default_factory=list) + """ + Custom Docker Image BYOC + """ + + preloaded_spark_versions: VariableOrList[str] = field(default_factory=list) + """ + A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started + with the preloaded Spark version will start faster. A list of available Spark versions + can be retrieved by using the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + """ + + remote_disk_throughput: VariableOrOptional[int] = None + """ + If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. + """ + + total_initial_remote_disk_size: VariableOrOptional[int] = None + """ + If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. + """ + + @classmethod + def from_dict(cls, value: "InstancePoolDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "InstancePoolDict": + return _transform_to_json_value(self) # type:ignore + + +class InstancePoolDict(TypedDict, total=False): + """""" + + instance_pool_name: VariableOr[str] + """ + Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100 + characters. + """ + + node_type_id: VariableOr[str] + """ + This field encodes, through a single value, the resources available to each of + the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + and optimized for memory or compute intensive workloads. A list of available node + types can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call. + """ + + aws_attributes: VariableOrOptional[InstancePoolAwsAttributesParam] + """ + Attributes related to instance pools running on Amazon Web Services. + If not specified at pool creation, a set of default values will be used. + """ + + azure_attributes: VariableOrOptional[InstancePoolAzureAttributesParam] + """ + Attributes related to instance pools running on Azure. + If not specified at pool creation, a set of default values will be used. + """ + + custom_tags: VariableOrDict[str] + """ + Additional tags for pool resources. Databricks will tag all pool resources (e.g., AWS + instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + + - Currently, Databricks allows at most 45 custom tags + """ + + disk_spec: VariableOrOptional[DiskSpecParam] + """ + Defines the specification of the disks that will be attached to all spark containers. + """ + + enable_elastic_disk: VariableOrOptional[bool] + """ + Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire + additional disk space when its Spark workers are running low on disk space. In AWS, this + feature requires specific AWS permissions to function correctly - refer to the User Guide for + more details. + """ + + gcp_attributes: VariableOrOptional[InstancePoolGcpAttributesParam] + """ + Attributes related to instance pools running on Google Cloud Platform. + If not specified at pool creation, a set of default values will be used. + """ + + idle_instance_autotermination_minutes: VariableOrOptional[int] + """ + Automatically terminates the extra instances in the pool cache after they are inactive for this + time in minutes if min_idle_instances requirement is already met. If not set, the extra pool + instances will be automatically terminated after a default timeout. If specified, the + threshold must be between 0 and 10000 minutes. + Users can also set this value to 0 to instantly remove idle instances from the cache if + min cache size could still hold. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + max_capacity: VariableOrOptional[int] + """ + Maximum number of outstanding instances to keep in the pool, including both instances used by + clusters and idle instances. Clusters that require further instance provisioning will fail during + upsize requests. + """ + + min_idle_instances: VariableOrOptional[int] + """ + Minimum number of idle instances to keep in the instance pool + """ + + node_type_flexibility: VariableOrOptional[NodeTypeFlexibilityParam] + """ + Flexible node type configuration for the pool. + """ + + permissions: VariableOrList[InstancePoolPermissionParam] + """ + The permissions to apply to this resource. + """ + + preloaded_docker_images: VariableOrList[DockerImageParam] + """ + Custom Docker Image BYOC + """ + + preloaded_spark_versions: VariableOrList[str] + """ + A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started + with the preloaded Spark version will start faster. A list of available Spark versions + can be retrieved by using the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + """ + + remote_disk_throughput: VariableOrOptional[int] + """ + If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. + """ + + total_initial_remote_disk_size: VariableOrOptional[int] + """ + If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. + """ + + +InstancePoolParam = InstancePoolDict | InstancePool diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes.py b/python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes.py new file mode 100644 index 00000000000..a67500571b9 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes.py @@ -0,0 +1,122 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.instance_pools._models.instance_pool_aws_attributes_availability import ( + InstancePoolAwsAttributesAvailability, + InstancePoolAwsAttributesAvailabilityParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class InstancePoolAwsAttributes: + """ + Attributes set during instance pool creation which are related to Amazon Web Services. + """ + + availability: VariableOrOptional[InstancePoolAwsAttributesAvailability] = None + """ + Availability type used for the spot nodes. + """ + + instance_profile_arn: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] All AWS instances belonging to the instance pool will have this instance profile. If omitted, instances + will initially be launched with the workspace's default instance profile. If defined, clusters that use the + pool will inherit the instance profile, and must not specify their own instance profile on cluster creation or + update. If the pool does not specify an instance profile, clusters using the pool may specify any instance profile. + The instance profile must have previously been added to the Databricks environment by an account administrator. + + This feature may only be available to certain customer plans. + """ + + spot_bid_price_percent: VariableOrOptional[int] = None + """ + Calculates the bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. + For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + instance, then the bid price is half of the price of + on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + When spot instances are requested for this cluster, only spot instances whose bid price + percentage matches this field will be considered. + Note that, for safety, we enforce this field to be no more than 10000. + """ + + zone_id: VariableOrOptional[str] = None + """ + Identifier for the availability zone/datacenter in which the cluster resides. + This string will be of a form like "us-west-2a". The provided availability + zone must be in the same region as the Databricks deployment. For example, "us-west-2a" + is not a valid zone id if the Databricks deployment resides in the "us-east-1" region. + This is an optional field at cluster creation, and if not specified, a default zone will be used. + The list of available zones as well as the default value can be found by using the + `List Zones` method. + """ + + @classmethod + def from_dict(cls, value: "InstancePoolAwsAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "InstancePoolAwsAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class InstancePoolAwsAttributesDict(TypedDict, total=False): + """""" + + availability: VariableOrOptional[InstancePoolAwsAttributesAvailabilityParam] + """ + Availability type used for the spot nodes. + """ + + instance_profile_arn: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] All AWS instances belonging to the instance pool will have this instance profile. If omitted, instances + will initially be launched with the workspace's default instance profile. If defined, clusters that use the + pool will inherit the instance profile, and must not specify their own instance profile on cluster creation or + update. If the pool does not specify an instance profile, clusters using the pool may specify any instance profile. + The instance profile must have previously been added to the Databricks environment by an account administrator. + + This feature may only be available to certain customer plans. + """ + + spot_bid_price_percent: VariableOrOptional[int] + """ + Calculates the bid price for AWS spot instances, as a percentage of the corresponding instance type's + on-demand price. + For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + instance, then the bid price is half of the price of + on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + When spot instances are requested for this cluster, only spot instances whose bid price + percentage matches this field will be considered. + Note that, for safety, we enforce this field to be no more than 10000. + """ + + zone_id: VariableOrOptional[str] + """ + Identifier for the availability zone/datacenter in which the cluster resides. + This string will be of a form like "us-west-2a". The provided availability + zone must be in the same region as the Databricks deployment. For example, "us-west-2a" + is not a valid zone id if the Databricks deployment resides in the "us-east-1" region. + This is an optional field at cluster creation, and if not specified, a default zone will be used. + The list of available zones as well as the default value can be found by using the + `List Zones` method. + """ + + +InstancePoolAwsAttributesParam = ( + InstancePoolAwsAttributesDict | InstancePoolAwsAttributes +) diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes_availability.py b/python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes_availability.py new file mode 100644 index 00000000000..5bc8a0350fa --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_aws_attributes_availability.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class InstancePoolAwsAttributesAvailability(Enum): + """ + The set of AWS availability types supported when setting up nodes for a cluster. + """ + + SPOT = "SPOT" + ON_DEMAND = "ON_DEMAND" + + +InstancePoolAwsAttributesAvailabilityParam = ( + Literal["SPOT", "ON_DEMAND"] | InstancePoolAwsAttributesAvailability +) diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes.py b/python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes.py new file mode 100644 index 00000000000..a080d5a5d7f --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes.py @@ -0,0 +1,100 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.instance_pools._models.instance_pool_azure_attributes_availability import ( + InstancePoolAzureAttributesAvailability, + InstancePoolAzureAttributesAvailabilityParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class InstancePoolAzureAttributes: + """ + Attributes set during instance pool creation which are related to Azure. + """ + + availability: VariableOrOptional[InstancePoolAzureAttributesAvailability] = None + """ + Availability type used for the spot nodes. + """ + + capacity_reservation_group: VariableOrOptional[str] = None + """ + The Azure capacity reservation group resource ID to use for launching VMs in this pool. + When specified, VMs will be launched using the provided capacity reservation. + + NOTE: Omitting this field will clear any existing configured capacity reservation group on the pool. + + Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + 1. Microsoft.Compute/capacityReservationGroups/read + 2. Microsoft.Compute/capacityReservationGroups/deploy/action + 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + + Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + """ + + spot_bid_max_price: VariableOrOptional[float] = None + """ + With variable pricing, you have option to set a max price, in US dollars (USD) + For example, the value 2 would be a max price of $2.00 USD per hour. + If you set the max price to be -1, the VM won't be evicted based on price. + The price for the VM will be the current price for spot or the price for a standard VM, + which ever is less, as long as there is capacity and quota available. + """ + + @classmethod + def from_dict(cls, value: "InstancePoolAzureAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "InstancePoolAzureAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class InstancePoolAzureAttributesDict(TypedDict, total=False): + """""" + + availability: VariableOrOptional[InstancePoolAzureAttributesAvailabilityParam] + """ + Availability type used for the spot nodes. + """ + + capacity_reservation_group: VariableOrOptional[str] + """ + The Azure capacity reservation group resource ID to use for launching VMs in this pool. + When specified, VMs will be launched using the provided capacity reservation. + + NOTE: Omitting this field will clear any existing configured capacity reservation group on the pool. + + Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + 1. Microsoft.Compute/capacityReservationGroups/read + 2. Microsoft.Compute/capacityReservationGroups/deploy/action + 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + + Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + """ + + spot_bid_max_price: VariableOrOptional[float] + """ + With variable pricing, you have option to set a max price, in US dollars (USD) + For example, the value 2 would be a max price of $2.00 USD per hour. + If you set the max price to be -1, the VM won't be evicted based on price. + The price for the VM will be the current price for spot or the price for a standard VM, + which ever is less, as long as there is capacity and quota available. + """ + + +InstancePoolAzureAttributesParam = ( + InstancePoolAzureAttributesDict | InstancePoolAzureAttributes +) diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes_availability.py b/python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes_availability.py new file mode 100644 index 00000000000..6d41fe997dd --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_azure_attributes_availability.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class InstancePoolAzureAttributesAvailability(Enum): + """ + The set of Azure availability types supported when setting up nodes for a cluster. + """ + + SPOT_AZURE = "SPOT_AZURE" + ON_DEMAND_AZURE = "ON_DEMAND_AZURE" + + +InstancePoolAzureAttributesAvailabilityParam = ( + Literal["SPOT_AZURE", "ON_DEMAND_AZURE"] | InstancePoolAzureAttributesAvailability +) diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_gcp_attributes.py b/python/databricks/bundles/instance_pools/_models/instance_pool_gcp_attributes.py new file mode 100644 index 00000000000..df34c5867a5 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_gcp_attributes.py @@ -0,0 +1,94 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.instance_pools._models.gcp_availability import ( + GcpAvailability, + GcpAvailabilityParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class InstancePoolGcpAttributes: + """ + Attributes set during instance pool creation which are related to GCP. + """ + + gcp_availability: VariableOrOptional[GcpAvailability] = None + """ + This field determines whether the instance pool will contain preemptible + VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + """ + + local_ssd_count: VariableOrOptional[int] = None + """ + If provided, each node in the instance pool will have this number of local SSDs attached. + Each local SSD is 375GB in size. Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + for the supported number of local SSDs for each instance type. + """ + + zone_id: VariableOrOptional[str] = None + """ + Identifier for the availability zone/datacenter in which the cluster resides. + This string will be of a form like "us-west1-a". The provided availability + zone must be in the same region as the Databricks workspace. For example, "us-west1-a" + is not a valid zone id if the Databricks workspace resides in the "us-east1" region. + This is an optional field at instance pool creation, and if not specified, a default zone will be used. + + This field can be one of the following: + - "HA" => High availability, spread nodes across availability zones for a Databricks deployment region + - A GCP availability zone => Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones (e.g. "us-west1-a"). + + If empty, Databricks picks an availability zone to schedule the cluster on. + """ + + @classmethod + def from_dict(cls, value: "InstancePoolGcpAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "InstancePoolGcpAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class InstancePoolGcpAttributesDict(TypedDict, total=False): + """""" + + gcp_availability: VariableOrOptional[GcpAvailabilityParam] + """ + This field determines whether the instance pool will contain preemptible + VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + """ + + local_ssd_count: VariableOrOptional[int] + """ + If provided, each node in the instance pool will have this number of local SSDs attached. + Each local SSD is 375GB in size. Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + for the supported number of local SSDs for each instance type. + """ + + zone_id: VariableOrOptional[str] + """ + Identifier for the availability zone/datacenter in which the cluster resides. + This string will be of a form like "us-west1-a". The provided availability + zone must be in the same region as the Databricks workspace. For example, "us-west1-a" + is not a valid zone id if the Databricks workspace resides in the "us-east1" region. + This is an optional field at instance pool creation, and if not specified, a default zone will be used. + + This field can be one of the following: + - "HA" => High availability, spread nodes across availability zones for a Databricks deployment region + - A GCP availability zone => Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones (e.g. "us-west1-a"). + + If empty, Databricks picks an availability zone to schedule the cluster on. + """ + + +InstancePoolGcpAttributesParam = ( + InstancePoolGcpAttributesDict | InstancePoolGcpAttributes +) diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_permission.py b/python/databricks/bundles/instance_pools/_models/instance_pool_permission.py new file mode 100644 index 00000000000..a81c2602aa6 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.instance_pools._models.instance_pool_permission_level import ( + InstancePoolPermissionLevel, + InstancePoolPermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class InstancePoolPermission: + """""" + + level: VariableOr[InstancePoolPermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "InstancePoolPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "InstancePoolPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class InstancePoolPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[InstancePoolPermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +InstancePoolPermissionParam = InstancePoolPermissionDict | InstancePoolPermission diff --git a/python/databricks/bundles/instance_pools/_models/instance_pool_permission_level.py b/python/databricks/bundles/instance_pools/_models/instance_pool_permission_level.py new file mode 100644 index 00000000000..bb0468b742c --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/instance_pool_permission_level.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class InstancePoolPermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_ATTACH_TO = "CAN_ATTACH_TO" + + +InstancePoolPermissionLevelParam = ( + Literal["CAN_MANAGE", "CAN_ATTACH_TO"] | InstancePoolPermissionLevel +) diff --git a/python/databricks/bundles/instance_pools/_models/lifecycle.py b/python/databricks/bundles/instance_pools/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/instance_pools/_models/node_type_flexibility.py b/python/databricks/bundles/instance_pools/_models/node_type_flexibility.py new file mode 100644 index 00000000000..aa582b763a8 --- /dev/null +++ b/python/databricks/bundles/instance_pools/_models/node_type_flexibility.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class NodeTypeFlexibility: + """ + Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. + """ + + alternate_node_type_ids: VariableOrList[str] = field(default_factory=list) + """ + A list of node type IDs to use as fallbacks when the primary node type is unavailable. + """ + + @classmethod + def from_dict(cls, value: "NodeTypeFlexibilityDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "NodeTypeFlexibilityDict": + return _transform_to_json_value(self) # type:ignore + + +class NodeTypeFlexibilityDict(TypedDict, total=False): + """""" + + alternate_node_type_ids: VariableOrList[str] + """ + A list of node type IDs to use as fallbacks when the primary node type is unavailable. + """ + + +NodeTypeFlexibilityParam = NodeTypeFlexibilityDict | NodeTypeFlexibility diff --git a/python/databricks/bundles/job_runs/__init__.py b/python/databricks/bundles/job_runs/__init__.py new file mode 100644 index 00000000000..093f2201409 --- /dev/null +++ b/python/databricks/bundles/job_runs/__init__.py @@ -0,0 +1,48 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "JobRun", + "JobRunDict", + "JobRunLifecycle", + "JobRunLifecycleDict", + "JobRunLifecycleParam", + "JobRunParam", + "JobRunTrigger", + "JobRunTriggerDict", + "JobRunTriggerParam", + "PerformanceTarget", + "PerformanceTargetParam", + "PipelineParams", + "PipelineParamsDict", + "PipelineParamsParam", + "QueueSettings", + "QueueSettingsDict", + "QueueSettingsParam", +] + + +from databricks.bundles.job_runs._models.job_run import JobRun, JobRunDict, JobRunParam +from databricks.bundles.job_runs._models.job_run_lifecycle import ( + JobRunLifecycle, + JobRunLifecycleDict, + JobRunLifecycleParam, +) +from databricks.bundles.job_runs._models.job_run_trigger import ( + JobRunTrigger, + JobRunTriggerDict, + JobRunTriggerParam, +) +from databricks.bundles.job_runs._models.performance_target import ( + PerformanceTarget, + PerformanceTargetParam, +) +from databricks.bundles.job_runs._models.pipeline_params import ( + PipelineParams, + PipelineParamsDict, + PipelineParamsParam, +) +from databricks.bundles.job_runs._models.queue_settings import ( + QueueSettings, + QueueSettingsDict, + QueueSettingsParam, +) diff --git a/python/databricks/bundles/job_runs/_models/job_run.py b/python/databricks/bundles/job_runs/_models/job_run.py new file mode 100644 index 00000000000..82397df768c --- /dev/null +++ b/python/databricks/bundles/job_runs/_models/job_run.py @@ -0,0 +1,136 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrDict, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.job_runs._models.job_run_lifecycle import ( + JobRunLifecycle, + JobRunLifecycleParam, +) +from databricks.bundles.job_runs._models.performance_target import ( + PerformanceTarget, + PerformanceTargetParam, +) +from databricks.bundles.job_runs._models.pipeline_params import ( + PipelineParams, + PipelineParamsParam, +) +from databricks.bundles.job_runs._models.queue_settings import ( + QueueSettings, + QueueSettingsParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class JobRun(Resource): + """""" + + job_id: VariableOr[int] + """ + The ID of the job to be executed + """ + + job_parameters: VariableOrDict[str] = field(default_factory=dict) + """ + Job-level parameters used in the run. for example `"param": "overriding_val"` + """ + + lifecycle: VariableOrOptional[JobRunLifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed and when the run re-fires. + """ + + only: VariableOrList[str] = field(default_factory=list) + """ + A list of task keys to run inside of the job. If this field is not provided, all tasks in the job will be run. + + Prefix a task key with `+` to also run its upstream tasks, or suffix it with `+` to also run its downstream tasks. + For example, `+my_task` runs `my_task` and everything upstream of it, `my_task+` runs `my_task` and everything + downstream of it, and `+my_task+` runs both. A task key with no `+` runs only that task. + """ + + performance_target: VariableOrOptional[PerformanceTarget] = None + """ + The performance mode on a serverless job. The performance target determines the level of compute performance or cost-efficiency for the run. This field overrides the performance target defined on the job level. + + * `STANDARD`: Enables cost-efficient execution of serverless workloads. + * `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance. + """ + + pipeline_params: VariableOrOptional[PipelineParams] = None + """ + Controls whether the pipeline should perform a full refresh + """ + + queue: VariableOrOptional[QueueSettings] = None + """ + The queue settings of the run. + """ + + @classmethod + def from_dict(cls, value: "JobRunDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "JobRunDict": + return _transform_to_json_value(self) # type:ignore + + +class JobRunDict(TypedDict, total=False): + """""" + + job_id: VariableOr[int] + """ + The ID of the job to be executed + """ + + job_parameters: VariableOrDict[str] + """ + Job-level parameters used in the run. for example `"param": "overriding_val"` + """ + + lifecycle: VariableOrOptional[JobRunLifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed and when the run re-fires. + """ + + only: VariableOrList[str] + """ + A list of task keys to run inside of the job. If this field is not provided, all tasks in the job will be run. + + Prefix a task key with `+` to also run its upstream tasks, or suffix it with `+` to also run its downstream tasks. + For example, `+my_task` runs `my_task` and everything upstream of it, `my_task+` runs `my_task` and everything + downstream of it, and `+my_task+` runs both. A task key with no `+` runs only that task. + """ + + performance_target: VariableOrOptional[PerformanceTargetParam] + """ + The performance mode on a serverless job. The performance target determines the level of compute performance or cost-efficiency for the run. This field overrides the performance target defined on the job level. + + * `STANDARD`: Enables cost-efficient execution of serverless workloads. + * `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance. + """ + + pipeline_params: VariableOrOptional[PipelineParamsParam] + """ + Controls whether the pipeline should perform a full refresh + """ + + queue: VariableOrOptional[QueueSettingsParam] + """ + The queue settings of the run. + """ + + +JobRunParam = JobRunDict | JobRun diff --git a/python/databricks/bundles/job_runs/_models/job_run_lifecycle.py b/python/databricks/bundles/job_runs/_models/job_run_lifecycle.py new file mode 100644 index 00000000000..cb673b0245d --- /dev/null +++ b/python/databricks/bundles/job_runs/_models/job_run_lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.job_runs._models.job_run_trigger import ( + JobRunTrigger, + JobRunTriggerParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class JobRunLifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + triggers: VariableOrList[JobRunTrigger] = field(default_factory=list) + """ + Conditions that re-fire this job run (in addition to configuration changes). + """ + + @classmethod + def from_dict(cls, value: "JobRunLifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "JobRunLifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class JobRunLifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + triggers: VariableOrList[JobRunTriggerParam] + """ + Conditions that re-fire this job run (in addition to configuration changes). + """ + + +JobRunLifecycleParam = JobRunLifecycleDict | JobRunLifecycle diff --git a/python/databricks/bundles/job_runs/_models/job_run_trigger.py b/python/databricks/bundles/job_runs/_models/job_run_trigger.py new file mode 100644 index 00000000000..50e7c0fe12c --- /dev/null +++ b/python/databricks/bundles/job_runs/_models/job_run_trigger.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class JobRunTrigger: + """""" + + on_bundle_deploy: VariableOrOptional[bool] = None + """ + If true, re-fire the run on every bundle deploy. Incompatible with lifecycle.prevent_destroy. + """ + + @classmethod + def from_dict(cls, value: "JobRunTriggerDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "JobRunTriggerDict": + return _transform_to_json_value(self) # type:ignore + + +class JobRunTriggerDict(TypedDict, total=False): + """""" + + on_bundle_deploy: VariableOrOptional[bool] + """ + If true, re-fire the run on every bundle deploy. Incompatible with lifecycle.prevent_destroy. + """ + + +JobRunTriggerParam = JobRunTriggerDict | JobRunTrigger diff --git a/python/databricks/bundles/job_runs/_models/performance_target.py b/python/databricks/bundles/job_runs/_models/performance_target.py new file mode 100644 index 00000000000..8dbe7e4a435 --- /dev/null +++ b/python/databricks/bundles/job_runs/_models/performance_target.py @@ -0,0 +1,20 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class PerformanceTarget(Enum): + """ + PerformanceTarget defines how performant (lower latency) or cost efficient the execution of run on serverless compute should be. + The performance mode on the job or pipeline should map to a performance setting that is passed to Cluster Manager + (see cluster-common PerformanceTarget). + """ + + PERFORMANCE_OPTIMIZED = "PERFORMANCE_OPTIMIZED" + STANDARD = "STANDARD" + + +PerformanceTargetParam = ( + Literal["PERFORMANCE_OPTIMIZED", "STANDARD"] | PerformanceTarget +) diff --git a/python/databricks/bundles/job_runs/_models/pipeline_params.py b/python/databricks/bundles/job_runs/_models/pipeline_params.py new file mode 100644 index 00000000000..ef2793b6580 --- /dev/null +++ b/python/databricks/bundles/job_runs/_models/pipeline_params.py @@ -0,0 +1,98 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PipelineParams: + """""" + + full_refresh: VariableOrOptional[bool] = None + """ + If true, triggers a full refresh on the spark declarative pipeline. + """ + + full_refresh_selection: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Beta] A list of tables to update with fullRefresh. + """ + + refresh_flow_selection: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Beta] Flow names to selectively refresh. These are unioned with other selective refresh + options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. + """ + + refresh_selection: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Beta] A list of tables to update without fullRefresh. + """ + + reset_checkpoint_selection: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Beta] A list of streaming flows to reset checkpoints without clearing data. + """ + + @classmethod + def from_dict(cls, value: "PipelineParamsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PipelineParamsDict": + return _transform_to_json_value(self) # type:ignore + + +class PipelineParamsDict(TypedDict, total=False): + """""" + + full_refresh: VariableOrOptional[bool] + """ + If true, triggers a full refresh on the spark declarative pipeline. + """ + + full_refresh_selection: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] A list of tables to update with fullRefresh. + """ + + refresh_flow_selection: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] Flow names to selectively refresh. These are unioned with other selective refresh + options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. + """ + + refresh_selection: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] A list of tables to update without fullRefresh. + """ + + reset_checkpoint_selection: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] A list of streaming flows to reset checkpoints without clearing data. + """ + + +PipelineParamsParam = PipelineParamsDict | PipelineParams diff --git a/python/databricks/bundles/job_runs/_models/queue_settings.py b/python/databricks/bundles/job_runs/_models/queue_settings.py new file mode 100644 index 00000000000..a72921aed96 --- /dev/null +++ b/python/databricks/bundles/job_runs/_models/queue_settings.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class QueueSettings: + """""" + + enabled: VariableOr[bool] + """ + If true, enable queueing for the job. This is a required field. + """ + + @classmethod + def from_dict(cls, value: "QueueSettingsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "QueueSettingsDict": + return _transform_to_json_value(self) # type:ignore + + +class QueueSettingsDict(TypedDict, total=False): + """""" + + enabled: VariableOr[bool] + """ + If true, enable queueing for the job. This is a required field. + """ + + +QueueSettingsParam = QueueSettingsDict | QueueSettings diff --git a/python/databricks/bundles/model_serving_endpoints/__init__.py b/python/databricks/bundles/model_serving_endpoints/__init__.py new file mode 100644 index 00000000000..0137c5e76b9 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/__init__.py @@ -0,0 +1,352 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Ai21LabsConfig", + "Ai21LabsConfigDict", + "Ai21LabsConfigParam", + "AiGatewayConfig", + "AiGatewayConfigDict", + "AiGatewayConfigParam", + "AiGatewayGuardrailParameters", + "AiGatewayGuardrailParametersDict", + "AiGatewayGuardrailParametersParam", + "AiGatewayGuardrailPiiBehavior", + "AiGatewayGuardrailPiiBehaviorBehavior", + "AiGatewayGuardrailPiiBehaviorBehaviorParam", + "AiGatewayGuardrailPiiBehaviorDict", + "AiGatewayGuardrailPiiBehaviorParam", + "AiGatewayGuardrails", + "AiGatewayGuardrailsDict", + "AiGatewayGuardrailsParam", + "AiGatewayInferenceTableConfig", + "AiGatewayInferenceTableConfigDict", + "AiGatewayInferenceTableConfigParam", + "AiGatewayRateLimit", + "AiGatewayRateLimitDict", + "AiGatewayRateLimitKey", + "AiGatewayRateLimitKeyParam", + "AiGatewayRateLimitParam", + "AiGatewayRateLimitRenewalPeriod", + "AiGatewayRateLimitRenewalPeriodParam", + "AiGatewayUsageTrackingConfig", + "AiGatewayUsageTrackingConfigDict", + "AiGatewayUsageTrackingConfigParam", + "AmazonBedrockConfig", + "AmazonBedrockConfigBedrockProvider", + "AmazonBedrockConfigBedrockProviderParam", + "AmazonBedrockConfigDict", + "AmazonBedrockConfigParam", + "AnthropicConfig", + "AnthropicConfigDict", + "AnthropicConfigParam", + "ApiKeyAuth", + "ApiKeyAuthDict", + "ApiKeyAuthParam", + "AutoCaptureConfigInput", + "AutoCaptureConfigInputDict", + "AutoCaptureConfigInputParam", + "BearerTokenAuth", + "BearerTokenAuthDict", + "BearerTokenAuthParam", + "CohereConfig", + "CohereConfigDict", + "CohereConfigParam", + "CustomProviderConfig", + "CustomProviderConfigDict", + "CustomProviderConfigParam", + "DatabricksModelServingConfig", + "DatabricksModelServingConfigDict", + "DatabricksModelServingConfigParam", + "EmailNotifications", + "EmailNotificationsDict", + "EmailNotificationsParam", + "EndpointCoreConfigInput", + "EndpointCoreConfigInputDict", + "EndpointCoreConfigInputParam", + "EndpointTag", + "EndpointTagDict", + "EndpointTagParam", + "ExternalModel", + "ExternalModelDict", + "ExternalModelParam", + "ExternalModelProvider", + "ExternalModelProviderParam", + "FallbackConfig", + "FallbackConfigDict", + "FallbackConfigParam", + "GoogleCloudVertexAiConfig", + "GoogleCloudVertexAiConfigDict", + "GoogleCloudVertexAiConfigParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "ModelServingEndpoint", + "ModelServingEndpointDict", + "ModelServingEndpointParam", + "ModelServingEndpointPermission", + "ModelServingEndpointPermissionDict", + "ModelServingEndpointPermissionParam", + "OpenAiConfig", + "OpenAiConfigDict", + "OpenAiConfigParam", + "PaLmConfig", + "PaLmConfigDict", + "PaLmConfigParam", + "RateLimit", + "RateLimitDict", + "RateLimitKey", + "RateLimitKeyParam", + "RateLimitParam", + "RateLimitRenewalPeriod", + "RateLimitRenewalPeriodParam", + "Route", + "RouteDict", + "RouteParam", + "ServedEntityInput", + "ServedEntityInputDict", + "ServedEntityInputParam", + "ServedModelInput", + "ServedModelInputDict", + "ServedModelInputParam", + "ServedModelInputWorkloadType", + "ServedModelInputWorkloadTypeParam", + "ServingEndpointPermissionLevel", + "ServingEndpointPermissionLevelParam", + "ServingModelWorkloadType", + "ServingModelWorkloadTypeParam", + "TelemetryConfig", + "TelemetryConfigDict", + "TelemetryConfigParam", + "TelemetryFeature", + "TelemetryFeatureParam", + "TelemetryInferenceTableConfig", + "TelemetryInferenceTableConfigDict", + "TelemetryInferenceTableConfigParam", + "TrafficConfig", + "TrafficConfigDict", + "TrafficConfigParam", + "UnityCatalogTableNames", + "UnityCatalogTableNamesDict", + "UnityCatalogTableNamesParam", +] + + +from databricks.bundles.model_serving_endpoints._models.ai21_labs_config import ( + Ai21LabsConfig, + Ai21LabsConfigDict, + Ai21LabsConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_config import ( + AiGatewayConfig, + AiGatewayConfigDict, + AiGatewayConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrail_parameters import ( + AiGatewayGuardrailParameters, + AiGatewayGuardrailParametersDict, + AiGatewayGuardrailParametersParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrail_pii_behavior import ( + AiGatewayGuardrailPiiBehavior, + AiGatewayGuardrailPiiBehaviorDict, + AiGatewayGuardrailPiiBehaviorParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrail_pii_behavior_behavior import ( + AiGatewayGuardrailPiiBehaviorBehavior, + AiGatewayGuardrailPiiBehaviorBehaviorParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrails import ( + AiGatewayGuardrails, + AiGatewayGuardrailsDict, + AiGatewayGuardrailsParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_inference_table_config import ( + AiGatewayInferenceTableConfig, + AiGatewayInferenceTableConfigDict, + AiGatewayInferenceTableConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_rate_limit import ( + AiGatewayRateLimit, + AiGatewayRateLimitDict, + AiGatewayRateLimitParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_rate_limit_key import ( + AiGatewayRateLimitKey, + AiGatewayRateLimitKeyParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_rate_limit_renewal_period import ( + AiGatewayRateLimitRenewalPeriod, + AiGatewayRateLimitRenewalPeriodParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_usage_tracking_config import ( + AiGatewayUsageTrackingConfig, + AiGatewayUsageTrackingConfigDict, + AiGatewayUsageTrackingConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.amazon_bedrock_config import ( + AmazonBedrockConfig, + AmazonBedrockConfigDict, + AmazonBedrockConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.amazon_bedrock_config_bedrock_provider import ( + AmazonBedrockConfigBedrockProvider, + AmazonBedrockConfigBedrockProviderParam, +) +from databricks.bundles.model_serving_endpoints._models.anthropic_config import ( + AnthropicConfig, + AnthropicConfigDict, + AnthropicConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.api_key_auth import ( + ApiKeyAuth, + ApiKeyAuthDict, + ApiKeyAuthParam, +) +from databricks.bundles.model_serving_endpoints._models.auto_capture_config_input import ( + AutoCaptureConfigInput, + AutoCaptureConfigInputDict, + AutoCaptureConfigInputParam, +) +from databricks.bundles.model_serving_endpoints._models.bearer_token_auth import ( + BearerTokenAuth, + BearerTokenAuthDict, + BearerTokenAuthParam, +) +from databricks.bundles.model_serving_endpoints._models.cohere_config import ( + CohereConfig, + CohereConfigDict, + CohereConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.custom_provider_config import ( + CustomProviderConfig, + CustomProviderConfigDict, + CustomProviderConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.databricks_model_serving_config import ( + DatabricksModelServingConfig, + DatabricksModelServingConfigDict, + DatabricksModelServingConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.email_notifications import ( + EmailNotifications, + EmailNotificationsDict, + EmailNotificationsParam, +) +from databricks.bundles.model_serving_endpoints._models.endpoint_core_config_input import ( + EndpointCoreConfigInput, + EndpointCoreConfigInputDict, + EndpointCoreConfigInputParam, +) +from databricks.bundles.model_serving_endpoints._models.endpoint_tag import ( + EndpointTag, + EndpointTagDict, + EndpointTagParam, +) +from databricks.bundles.model_serving_endpoints._models.external_model import ( + ExternalModel, + ExternalModelDict, + ExternalModelParam, +) +from databricks.bundles.model_serving_endpoints._models.external_model_provider import ( + ExternalModelProvider, + ExternalModelProviderParam, +) +from databricks.bundles.model_serving_endpoints._models.fallback_config import ( + FallbackConfig, + FallbackConfigDict, + FallbackConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.google_cloud_vertex_ai_config import ( + GoogleCloudVertexAiConfig, + GoogleCloudVertexAiConfigDict, + GoogleCloudVertexAiConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint import ( + ModelServingEndpoint, + ModelServingEndpointDict, + ModelServingEndpointParam, +) +from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint_permission import ( + ModelServingEndpointPermission, + ModelServingEndpointPermissionDict, + ModelServingEndpointPermissionParam, +) +from databricks.bundles.model_serving_endpoints._models.open_ai_config import ( + OpenAiConfig, + OpenAiConfigDict, + OpenAiConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.pa_lm_config import ( + PaLmConfig, + PaLmConfigDict, + PaLmConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.rate_limit import ( + RateLimit, + RateLimitDict, + RateLimitParam, +) +from databricks.bundles.model_serving_endpoints._models.rate_limit_key import ( + RateLimitKey, + RateLimitKeyParam, +) +from databricks.bundles.model_serving_endpoints._models.rate_limit_renewal_period import ( + RateLimitRenewalPeriod, + RateLimitRenewalPeriodParam, +) +from databricks.bundles.model_serving_endpoints._models.route import ( + Route, + RouteDict, + RouteParam, +) +from databricks.bundles.model_serving_endpoints._models.served_entity_input import ( + ServedEntityInput, + ServedEntityInputDict, + ServedEntityInputParam, +) +from databricks.bundles.model_serving_endpoints._models.served_model_input import ( + ServedModelInput, + ServedModelInputDict, + ServedModelInputParam, +) +from databricks.bundles.model_serving_endpoints._models.served_model_input_workload_type import ( + ServedModelInputWorkloadType, + ServedModelInputWorkloadTypeParam, +) +from databricks.bundles.model_serving_endpoints._models.serving_endpoint_permission_level import ( + ServingEndpointPermissionLevel, + ServingEndpointPermissionLevelParam, +) +from databricks.bundles.model_serving_endpoints._models.serving_model_workload_type import ( + ServingModelWorkloadType, + ServingModelWorkloadTypeParam, +) +from databricks.bundles.model_serving_endpoints._models.telemetry_config import ( + TelemetryConfig, + TelemetryConfigDict, + TelemetryConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.telemetry_feature import ( + TelemetryFeature, + TelemetryFeatureParam, +) +from databricks.bundles.model_serving_endpoints._models.telemetry_inference_table_config import ( + TelemetryInferenceTableConfig, + TelemetryInferenceTableConfigDict, + TelemetryInferenceTableConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.traffic_config import ( + TrafficConfig, + TrafficConfigDict, + TrafficConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.unity_catalog_table_names import ( + UnityCatalogTableNames, + UnityCatalogTableNamesDict, + UnityCatalogTableNamesParam, +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai21_labs_config.py b/python/databricks/bundles/model_serving_endpoints/_models/ai21_labs_config.py new file mode 100644 index 00000000000..af06b6f6f1e --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai21_labs_config.py @@ -0,0 +1,62 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Ai21LabsConfig: + """""" + + ai21labs_api_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for an AI21 Labs API key. If you + prefer to paste your API key directly, see `ai21labs_api_key_plaintext`. + You must provide an API key using one of the following fields: + `ai21labs_api_key` or `ai21labs_api_key_plaintext`. + """ + + ai21labs_api_key_plaintext: VariableOrOptional[str] = None + """ + An AI21 Labs API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `ai21labs_api_key`. You + must provide an API key using one of the following fields: + `ai21labs_api_key` or `ai21labs_api_key_plaintext`. + """ + + @classmethod + def from_dict(cls, value: "Ai21LabsConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "Ai21LabsConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class Ai21LabsConfigDict(TypedDict, total=False): + """""" + + ai21labs_api_key: VariableOrOptional[str] + """ + The Databricks secret key reference for an AI21 Labs API key. If you + prefer to paste your API key directly, see `ai21labs_api_key_plaintext`. + You must provide an API key using one of the following fields: + `ai21labs_api_key` or `ai21labs_api_key_plaintext`. + """ + + ai21labs_api_key_plaintext: VariableOrOptional[str] + """ + An AI21 Labs API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `ai21labs_api_key`. You + must provide an API key using one of the following fields: + `ai21labs_api_key` or `ai21labs_api_key_plaintext`. + """ + + +Ai21LabsConfigParam = Ai21LabsConfigDict | Ai21LabsConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_config.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_config.py new file mode 100644 index 00000000000..24a4a967599 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_config.py @@ -0,0 +1,106 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrails import ( + AiGatewayGuardrails, + AiGatewayGuardrailsParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_inference_table_config import ( + AiGatewayInferenceTableConfig, + AiGatewayInferenceTableConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_rate_limit import ( + AiGatewayRateLimit, + AiGatewayRateLimitParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_usage_tracking_config import ( + AiGatewayUsageTrackingConfig, + AiGatewayUsageTrackingConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.fallback_config import ( + FallbackConfig, + FallbackConfigParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayConfig: + """""" + + fallback_config: VariableOrOptional[FallbackConfig] = None + """ + Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served + entity fails with certain error codes, to increase availability. + """ + + guardrails: VariableOrOptional[AiGatewayGuardrails] = None + """ + [Public Preview] Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. + """ + + inference_table_config: VariableOrOptional[AiGatewayInferenceTableConfig] = None + """ + Configuration for payload logging using inference tables. + Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality. + """ + + rate_limits: VariableOrList[AiGatewayRateLimit] = field(default_factory=list) + """ + Configuration for rate limits which can be set to limit endpoint traffic. + """ + + usage_tracking_config: VariableOrOptional[AiGatewayUsageTrackingConfig] = None + """ + Configuration to enable usage tracking using system tables. + These tables allow you to monitor operational usage on endpoints and their associated costs. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayConfigDict(TypedDict, total=False): + """""" + + fallback_config: VariableOrOptional[FallbackConfigParam] + """ + Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served + entity fails with certain error codes, to increase availability. + """ + + guardrails: VariableOrOptional[AiGatewayGuardrailsParam] + """ + [Public Preview] Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. + """ + + inference_table_config: VariableOrOptional[AiGatewayInferenceTableConfigParam] + """ + Configuration for payload logging using inference tables. + Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality. + """ + + rate_limits: VariableOrList[AiGatewayRateLimitParam] + """ + Configuration for rate limits which can be set to limit endpoint traffic. + """ + + usage_tracking_config: VariableOrOptional[AiGatewayUsageTrackingConfigParam] + """ + Configuration to enable usage tracking using system tables. + These tables allow you to monitor operational usage on endpoints and their associated costs. + """ + + +AiGatewayConfigParam = AiGatewayConfigDict | AiGatewayConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_parameters.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_parameters.py new file mode 100644 index 00000000000..55b70a82669 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_parameters.py @@ -0,0 +1,80 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrail_pii_behavior import ( + AiGatewayGuardrailPiiBehavior, + AiGatewayGuardrailPiiBehaviorParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayGuardrailParameters: + """""" + + invalid_keywords: VariableOrList[str] = field(default_factory=list) + """ + [DEPRECATED] [Public Preview] List of invalid keywords. + AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content. + """ + + pii: VariableOrOptional[AiGatewayGuardrailPiiBehavior] = None + """ + [Public Preview] Configuration for guardrail PII filter. + """ + + safety: VariableOrOptional[bool] = None + """ + [Public Preview] Indicates whether the safety filter is enabled. + """ + + valid_topics: VariableOrList[str] = field(default_factory=list) + """ + [DEPRECATED] [Public Preview] The list of allowed topics. + Given a chat request, this guardrail flags the request if its topic is not in the allowed topics. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayGuardrailParametersDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayGuardrailParametersDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayGuardrailParametersDict(TypedDict, total=False): + """""" + + invalid_keywords: VariableOrList[str] + """ + [DEPRECATED] [Public Preview] List of invalid keywords. + AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content. + """ + + pii: VariableOrOptional[AiGatewayGuardrailPiiBehaviorParam] + """ + [Public Preview] Configuration for guardrail PII filter. + """ + + safety: VariableOrOptional[bool] + """ + [Public Preview] Indicates whether the safety filter is enabled. + """ + + valid_topics: VariableOrList[str] + """ + [DEPRECATED] [Public Preview] The list of allowed topics. + Given a chat request, this guardrail flags the request if its topic is not in the allowed topics. + """ + + +AiGatewayGuardrailParametersParam = ( + AiGatewayGuardrailParametersDict | AiGatewayGuardrailParameters +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior.py new file mode 100644 index 00000000000..577af194a55 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrail_pii_behavior_behavior import ( + AiGatewayGuardrailPiiBehaviorBehavior, + AiGatewayGuardrailPiiBehaviorBehaviorParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayGuardrailPiiBehavior: + """""" + + behavior: VariableOrOptional[AiGatewayGuardrailPiiBehaviorBehavior] = None + """ + [Public Preview] Configuration for input guardrail filters. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayGuardrailPiiBehaviorDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayGuardrailPiiBehaviorDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayGuardrailPiiBehaviorDict(TypedDict, total=False): + """""" + + behavior: VariableOrOptional[AiGatewayGuardrailPiiBehaviorBehaviorParam] + """ + [Public Preview] Configuration for input guardrail filters. + """ + + +AiGatewayGuardrailPiiBehaviorParam = ( + AiGatewayGuardrailPiiBehaviorDict | AiGatewayGuardrailPiiBehavior +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior_behavior.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior_behavior.py new file mode 100644 index 00000000000..bf9bf86fc68 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrail_pii_behavior_behavior.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AiGatewayGuardrailPiiBehaviorBehavior(Enum): + NONE = "NONE" + BLOCK = "BLOCK" + MASK = "MASK" + + +AiGatewayGuardrailPiiBehaviorBehaviorParam = ( + Literal["NONE", "BLOCK", "MASK"] | AiGatewayGuardrailPiiBehaviorBehavior +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrails.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrails.py new file mode 100644 index 00000000000..299859aa015 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_guardrails.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.ai_gateway_guardrail_parameters import ( + AiGatewayGuardrailParameters, + AiGatewayGuardrailParametersParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayGuardrails: + """""" + + input: VariableOrOptional[AiGatewayGuardrailParameters] = None + """ + [Public Preview] Configuration for input guardrail filters. + """ + + output: VariableOrOptional[AiGatewayGuardrailParameters] = None + """ + [Public Preview] Configuration for output guardrail filters. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayGuardrailsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayGuardrailsDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayGuardrailsDict(TypedDict, total=False): + """""" + + input: VariableOrOptional[AiGatewayGuardrailParametersParam] + """ + [Public Preview] Configuration for input guardrail filters. + """ + + output: VariableOrOptional[AiGatewayGuardrailParametersParam] + """ + [Public Preview] Configuration for output guardrail filters. + """ + + +AiGatewayGuardrailsParam = AiGatewayGuardrailsDict | AiGatewayGuardrails diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_inference_table_config.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_inference_table_config.py new file mode 100644 index 00000000000..a4d748dee3a --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_inference_table_config.py @@ -0,0 +1,78 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayInferenceTableConfig: + """""" + + catalog_name: VariableOrOptional[str] = None + """ + The name of the catalog in Unity Catalog. Required when enabling inference tables. + NOTE: On update, you have to disable inference table first in order to change the catalog name. + """ + + enabled: VariableOrOptional[bool] = None + """ + Indicates whether the inference table is enabled. + """ + + schema_name: VariableOrOptional[str] = None + """ + The name of the schema in Unity Catalog. Required when enabling inference tables. + NOTE: On update, you have to disable inference table first in order to change the schema name. + """ + + table_name_prefix: VariableOrOptional[str] = None + """ + The prefix of the table in Unity Catalog. + NOTE: On update, you have to disable inference table first in order to change the prefix name. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayInferenceTableConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayInferenceTableConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayInferenceTableConfigDict(TypedDict, total=False): + """""" + + catalog_name: VariableOrOptional[str] + """ + The name of the catalog in Unity Catalog. Required when enabling inference tables. + NOTE: On update, you have to disable inference table first in order to change the catalog name. + """ + + enabled: VariableOrOptional[bool] + """ + Indicates whether the inference table is enabled. + """ + + schema_name: VariableOrOptional[str] + """ + The name of the schema in Unity Catalog. Required when enabling inference tables. + NOTE: On update, you have to disable inference table first in order to change the schema name. + """ + + table_name_prefix: VariableOrOptional[str] + """ + The prefix of the table in Unity Catalog. + NOTE: On update, you have to disable inference table first in order to change the prefix name. + """ + + +AiGatewayInferenceTableConfigParam = ( + AiGatewayInferenceTableConfigDict | AiGatewayInferenceTableConfig +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit.py new file mode 100644 index 00000000000..5848e04f895 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit.py @@ -0,0 +1,90 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.ai_gateway_rate_limit_key import ( + AiGatewayRateLimitKey, + AiGatewayRateLimitKeyParam, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_rate_limit_renewal_period import ( + AiGatewayRateLimitRenewalPeriod, + AiGatewayRateLimitRenewalPeriodParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayRateLimit: + """""" + + renewal_period: VariableOr[AiGatewayRateLimitRenewalPeriod] + """ + Renewal period field for a rate limit. Currently, only 'minute' is supported. + """ + + calls: VariableOrOptional[int] = None + """ + Used to specify how many calls are allowed for a key within the renewal_period. + """ + + key: VariableOrOptional[AiGatewayRateLimitKey] = None + """ + Key field for a rate limit. Currently, 'user', 'user_group, 'service_principal', and 'endpoint' are supported, + with 'endpoint' being the default if not specified. + """ + + principal: VariableOrOptional[str] = None + """ + Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID. + """ + + tokens: VariableOrOptional[int] = None + """ + Used to specify how many tokens are allowed for a key within the renewal_period. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayRateLimitDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayRateLimitDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayRateLimitDict(TypedDict, total=False): + """""" + + renewal_period: VariableOr[AiGatewayRateLimitRenewalPeriodParam] + """ + Renewal period field for a rate limit. Currently, only 'minute' is supported. + """ + + calls: VariableOrOptional[int] + """ + Used to specify how many calls are allowed for a key within the renewal_period. + """ + + key: VariableOrOptional[AiGatewayRateLimitKeyParam] + """ + Key field for a rate limit. Currently, 'user', 'user_group, 'service_principal', and 'endpoint' are supported, + with 'endpoint' being the default if not specified. + """ + + principal: VariableOrOptional[str] + """ + Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID. + """ + + tokens: VariableOrOptional[int] + """ + Used to specify how many tokens are allowed for a key within the renewal_period. + """ + + +AiGatewayRateLimitParam = AiGatewayRateLimitDict | AiGatewayRateLimit diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_key.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_key.py new file mode 100644 index 00000000000..f166207b7e7 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_key.py @@ -0,0 +1,17 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AiGatewayRateLimitKey(Enum): + USER = "user" + ENDPOINT = "endpoint" + USER_GROUP = "user_group" + SERVICE_PRINCIPAL = "service_principal" + + +AiGatewayRateLimitKeyParam = ( + Literal["user", "endpoint", "user_group", "service_principal"] + | AiGatewayRateLimitKey +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_renewal_period.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_renewal_period.py new file mode 100644 index 00000000000..e315d878c83 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_rate_limit_renewal_period.py @@ -0,0 +1,13 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AiGatewayRateLimitRenewalPeriod(Enum): + MINUTE = "minute" + + +AiGatewayRateLimitRenewalPeriodParam = ( + Literal["minute"] | AiGatewayRateLimitRenewalPeriod +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_usage_tracking_config.py b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_usage_tracking_config.py new file mode 100644 index 00000000000..bd5b5dd2806 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/ai_gateway_usage_tracking_config.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AiGatewayUsageTrackingConfig: + """""" + + enabled: VariableOrOptional[bool] = None + """ + Whether to enable usage tracking. + """ + + @classmethod + def from_dict(cls, value: "AiGatewayUsageTrackingConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AiGatewayUsageTrackingConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class AiGatewayUsageTrackingConfigDict(TypedDict, total=False): + """""" + + enabled: VariableOrOptional[bool] + """ + Whether to enable usage tracking. + """ + + +AiGatewayUsageTrackingConfigParam = ( + AiGatewayUsageTrackingConfigDict | AiGatewayUsageTrackingConfig +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config.py b/python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config.py new file mode 100644 index 00000000000..09c6b0304b7 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config.py @@ -0,0 +1,148 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.amazon_bedrock_config_bedrock_provider import ( + AmazonBedrockConfigBedrockProvider, + AmazonBedrockConfigBedrockProviderParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AmazonBedrockConfig: + """""" + + aws_region: VariableOr[str] + """ + The AWS region to use. Bedrock has to be enabled there. + """ + + bedrock_provider: VariableOr[AmazonBedrockConfigBedrockProvider] + """ + The underlying provider in Amazon Bedrock. Supported values (case + insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. + """ + + aws_access_key_id: VariableOrOptional[str] = None + """ + The Databricks secret key reference for an AWS access key ID with + permissions to interact with Bedrock services. If you prefer to paste + your API key directly, see `aws_access_key_id_plaintext`. You must provide an API + key using one of the following fields: `aws_access_key_id` or + `aws_access_key_id_plaintext`. + """ + + aws_access_key_id_plaintext: VariableOrOptional[str] = None + """ + An AWS access key ID with permissions to interact with Bedrock services + provided as a plaintext string. If you prefer to reference your key using + Databricks Secrets, see `aws_access_key_id`. You must provide an API key + using one of the following fields: `aws_access_key_id` or + `aws_access_key_id_plaintext`. + """ + + aws_secret_access_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for an AWS secret access key paired + with the access key ID, with permissions to interact with Bedrock + services. If you prefer to paste your API key directly, see + `aws_secret_access_key_plaintext`. You must provide an API key using one + of the following fields: `aws_secret_access_key` or + `aws_secret_access_key_plaintext`. + """ + + aws_secret_access_key_plaintext: VariableOrOptional[str] = None + """ + An AWS secret access key paired with the access key ID, with permissions + to interact with Bedrock services provided as a plaintext string. If you + prefer to reference your key using Databricks Secrets, see + `aws_secret_access_key`. You must provide an API key using one of the + following fields: `aws_secret_access_key` or + `aws_secret_access_key_plaintext`. + """ + + instance_profile_arn: VariableOrOptional[str] = None + """ + ARN of the instance profile that the external model will use to access AWS resources. + You must authenticate using an instance profile or access keys. + If you prefer to authenticate using access keys, see `aws_access_key_id`, + `aws_access_key_id_plaintext`, `aws_secret_access_key` and `aws_secret_access_key_plaintext`. + """ + + @classmethod + def from_dict(cls, value: "AmazonBedrockConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AmazonBedrockConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class AmazonBedrockConfigDict(TypedDict, total=False): + """""" + + aws_region: VariableOr[str] + """ + The AWS region to use. Bedrock has to be enabled there. + """ + + bedrock_provider: VariableOr[AmazonBedrockConfigBedrockProviderParam] + """ + The underlying provider in Amazon Bedrock. Supported values (case + insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. + """ + + aws_access_key_id: VariableOrOptional[str] + """ + The Databricks secret key reference for an AWS access key ID with + permissions to interact with Bedrock services. If you prefer to paste + your API key directly, see `aws_access_key_id_plaintext`. You must provide an API + key using one of the following fields: `aws_access_key_id` or + `aws_access_key_id_plaintext`. + """ + + aws_access_key_id_plaintext: VariableOrOptional[str] + """ + An AWS access key ID with permissions to interact with Bedrock services + provided as a plaintext string. If you prefer to reference your key using + Databricks Secrets, see `aws_access_key_id`. You must provide an API key + using one of the following fields: `aws_access_key_id` or + `aws_access_key_id_plaintext`. + """ + + aws_secret_access_key: VariableOrOptional[str] + """ + The Databricks secret key reference for an AWS secret access key paired + with the access key ID, with permissions to interact with Bedrock + services. If you prefer to paste your API key directly, see + `aws_secret_access_key_plaintext`. You must provide an API key using one + of the following fields: `aws_secret_access_key` or + `aws_secret_access_key_plaintext`. + """ + + aws_secret_access_key_plaintext: VariableOrOptional[str] + """ + An AWS secret access key paired with the access key ID, with permissions + to interact with Bedrock services provided as a plaintext string. If you + prefer to reference your key using Databricks Secrets, see + `aws_secret_access_key`. You must provide an API key using one of the + following fields: `aws_secret_access_key` or + `aws_secret_access_key_plaintext`. + """ + + instance_profile_arn: VariableOrOptional[str] + """ + ARN of the instance profile that the external model will use to access AWS resources. + You must authenticate using an instance profile or access keys. + If you prefer to authenticate using access keys, see `aws_access_key_id`, + `aws_access_key_id_plaintext`, `aws_secret_access_key` and `aws_secret_access_key_plaintext`. + """ + + +AmazonBedrockConfigParam = AmazonBedrockConfigDict | AmazonBedrockConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config_bedrock_provider.py b/python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config_bedrock_provider.py new file mode 100644 index 00000000000..bc3de02a2e0 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/amazon_bedrock_config_bedrock_provider.py @@ -0,0 +1,17 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class AmazonBedrockConfigBedrockProvider(Enum): + ANTHROPIC = "anthropic" + COHERE = "cohere" + AI21LABS = "ai21labs" + AMAZON = "amazon" + + +AmazonBedrockConfigBedrockProviderParam = ( + Literal["anthropic", "cohere", "ai21labs", "amazon"] + | AmazonBedrockConfigBedrockProvider +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/anthropic_config.py b/python/databricks/bundles/model_serving_endpoints/_models/anthropic_config.py new file mode 100644 index 00000000000..97ab29711b0 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/anthropic_config.py @@ -0,0 +1,62 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AnthropicConfig: + """""" + + anthropic_api_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for an Anthropic API key. If you + prefer to paste your API key directly, see `anthropic_api_key_plaintext`. + You must provide an API key using one of the following fields: + `anthropic_api_key` or `anthropic_api_key_plaintext`. + """ + + anthropic_api_key_plaintext: VariableOrOptional[str] = None + """ + The Anthropic API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `anthropic_api_key`. You + must provide an API key using one of the following fields: + `anthropic_api_key` or `anthropic_api_key_plaintext`. + """ + + @classmethod + def from_dict(cls, value: "AnthropicConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AnthropicConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class AnthropicConfigDict(TypedDict, total=False): + """""" + + anthropic_api_key: VariableOrOptional[str] + """ + The Databricks secret key reference for an Anthropic API key. If you + prefer to paste your API key directly, see `anthropic_api_key_plaintext`. + You must provide an API key using one of the following fields: + `anthropic_api_key` or `anthropic_api_key_plaintext`. + """ + + anthropic_api_key_plaintext: VariableOrOptional[str] + """ + The Anthropic API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `anthropic_api_key`. You + must provide an API key using one of the following fields: + `anthropic_api_key` or `anthropic_api_key_plaintext`. + """ + + +AnthropicConfigParam = AnthropicConfigDict | AnthropicConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/api_key_auth.py b/python/databricks/bundles/model_serving_endpoints/_models/api_key_auth.py new file mode 100644 index 00000000000..a5a33f0aad5 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/api_key_auth.py @@ -0,0 +1,64 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ApiKeyAuth: + """""" + + key: VariableOr[str] + """ + The name of the API key parameter used for authentication. + """ + + value: VariableOrOptional[str] = None + """ + The Databricks secret key reference for an API Key. + If you prefer to paste your token directly, see `value_plaintext`. + """ + + value_plaintext: VariableOrOptional[str] = None + """ + The API Key provided as a plaintext string. If you prefer to reference your + token using Databricks Secrets, see `value`. + """ + + @classmethod + def from_dict(cls, value: "ApiKeyAuthDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ApiKeyAuthDict": + return _transform_to_json_value(self) # type:ignore + + +class ApiKeyAuthDict(TypedDict, total=False): + """""" + + key: VariableOr[str] + """ + The name of the API key parameter used for authentication. + """ + + value: VariableOrOptional[str] + """ + The Databricks secret key reference for an API Key. + If you prefer to paste your token directly, see `value_plaintext`. + """ + + value_plaintext: VariableOrOptional[str] + """ + The API Key provided as a plaintext string. If you prefer to reference your + token using Databricks Secrets, see `value`. + """ + + +ApiKeyAuthParam = ApiKeyAuthDict | ApiKeyAuth diff --git a/python/databricks/bundles/model_serving_endpoints/_models/auto_capture_config_input.py b/python/databricks/bundles/model_serving_endpoints/_models/auto_capture_config_input.py new file mode 100644 index 00000000000..b7e3a5820bb --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/auto_capture_config_input.py @@ -0,0 +1,73 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AutoCaptureConfigInput: + """ + [DEPRECATED] Deprecated: legacy inference table configuration. Please use AI Gateway inference tables instead. + See https://docs.databricks.com/aws/en/ai-gateway/inference-tables. + """ + + catalog_name: VariableOrOptional[str] = None + """ + The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if the inference table is already enabled. + """ + + enabled: VariableOrOptional[bool] = None + """ + Indicates whether the inference table is enabled. + """ + + schema_name: VariableOrOptional[str] = None + """ + The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if the inference table is already enabled. + """ + + table_name_prefix: VariableOrOptional[str] = None + """ + The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if the inference table is already enabled. + """ + + @classmethod + def from_dict(cls, value: "AutoCaptureConfigInputDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AutoCaptureConfigInputDict": + return _transform_to_json_value(self) # type:ignore + + +class AutoCaptureConfigInputDict(TypedDict, total=False): + """""" + + catalog_name: VariableOrOptional[str] + """ + The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if the inference table is already enabled. + """ + + enabled: VariableOrOptional[bool] + """ + Indicates whether the inference table is enabled. + """ + + schema_name: VariableOrOptional[str] + """ + The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if the inference table is already enabled. + """ + + table_name_prefix: VariableOrOptional[str] + """ + The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if the inference table is already enabled. + """ + + +AutoCaptureConfigInputParam = AutoCaptureConfigInputDict | AutoCaptureConfigInput diff --git a/python/databricks/bundles/model_serving_endpoints/_models/bearer_token_auth.py b/python/databricks/bundles/model_serving_endpoints/_models/bearer_token_auth.py new file mode 100644 index 00000000000..dc05f6c53c2 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/bearer_token_auth.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class BearerTokenAuth: + """""" + + token: VariableOrOptional[str] = None + """ + The Databricks secret key reference for a token. + If you prefer to paste your token directly, see `token_plaintext`. + """ + + token_plaintext: VariableOrOptional[str] = None + """ + The token provided as a plaintext string. If you prefer to reference your + token using Databricks Secrets, see `token`. + """ + + @classmethod + def from_dict(cls, value: "BearerTokenAuthDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "BearerTokenAuthDict": + return _transform_to_json_value(self) # type:ignore + + +class BearerTokenAuthDict(TypedDict, total=False): + """""" + + token: VariableOrOptional[str] + """ + The Databricks secret key reference for a token. + If you prefer to paste your token directly, see `token_plaintext`. + """ + + token_plaintext: VariableOrOptional[str] + """ + The token provided as a plaintext string. If you prefer to reference your + token using Databricks Secrets, see `token`. + """ + + +BearerTokenAuthParam = BearerTokenAuthDict | BearerTokenAuth diff --git a/python/databricks/bundles/model_serving_endpoints/_models/cohere_config.py b/python/databricks/bundles/model_serving_endpoints/_models/cohere_config.py new file mode 100644 index 00000000000..e70c767e9c2 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/cohere_config.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class CohereConfig: + """""" + + cohere_api_base: VariableOrOptional[str] = None + """ + This is an optional field to provide a customized base URL for the Cohere + API. If left unspecified, the standard Cohere base URL is used. + """ + + cohere_api_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for a Cohere API key. If you prefer + to paste your API key directly, see `cohere_api_key_plaintext`. You must + provide an API key using one of the following fields: `cohere_api_key` or + `cohere_api_key_plaintext`. + """ + + cohere_api_key_plaintext: VariableOrOptional[str] = None + """ + The Cohere API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `cohere_api_key`. You + must provide an API key using one of the following fields: + `cohere_api_key` or `cohere_api_key_plaintext`. + """ + + @classmethod + def from_dict(cls, value: "CohereConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "CohereConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class CohereConfigDict(TypedDict, total=False): + """""" + + cohere_api_base: VariableOrOptional[str] + """ + This is an optional field to provide a customized base URL for the Cohere + API. If left unspecified, the standard Cohere base URL is used. + """ + + cohere_api_key: VariableOrOptional[str] + """ + The Databricks secret key reference for a Cohere API key. If you prefer + to paste your API key directly, see `cohere_api_key_plaintext`. You must + provide an API key using one of the following fields: `cohere_api_key` or + `cohere_api_key_plaintext`. + """ + + cohere_api_key_plaintext: VariableOrOptional[str] + """ + The Cohere API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `cohere_api_key`. You + must provide an API key using one of the following fields: + `cohere_api_key` or `cohere_api_key_plaintext`. + """ + + +CohereConfigParam = CohereConfigDict | CohereConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/custom_provider_config.py b/python/databricks/bundles/model_serving_endpoints/_models/custom_provider_config.py new file mode 100644 index 00000000000..e50b61d00ff --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/custom_provider_config.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.api_key_auth import ( + ApiKeyAuth, + ApiKeyAuthParam, +) +from databricks.bundles.model_serving_endpoints._models.bearer_token_auth import ( + BearerTokenAuth, + BearerTokenAuthParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class CustomProviderConfig: + """ + Configs needed to create a custom provider model route. + """ + + custom_provider_url: VariableOr[str] + """ + This is a field to provide the URL of the custom provider API. + """ + + api_key_auth: VariableOrOptional[ApiKeyAuth] = None + """ + This is a field to provide API key authentication for the custom provider API. + You can only specify one authentication method. + """ + + bearer_token_auth: VariableOrOptional[BearerTokenAuth] = None + """ + This is a field to provide bearer token authentication for the custom provider API. + You can only specify one authentication method. + """ + + @classmethod + def from_dict(cls, value: "CustomProviderConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "CustomProviderConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class CustomProviderConfigDict(TypedDict, total=False): + """""" + + custom_provider_url: VariableOr[str] + """ + This is a field to provide the URL of the custom provider API. + """ + + api_key_auth: VariableOrOptional[ApiKeyAuthParam] + """ + This is a field to provide API key authentication for the custom provider API. + You can only specify one authentication method. + """ + + bearer_token_auth: VariableOrOptional[BearerTokenAuthParam] + """ + This is a field to provide bearer token authentication for the custom provider API. + You can only specify one authentication method. + """ + + +CustomProviderConfigParam = CustomProviderConfigDict | CustomProviderConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/databricks_model_serving_config.py b/python/databricks/bundles/model_serving_endpoints/_models/databricks_model_serving_config.py new file mode 100644 index 00000000000..72f17e7c5de --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/databricks_model_serving_config.py @@ -0,0 +1,84 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DatabricksModelServingConfig: + """""" + + databricks_workspace_url: VariableOr[str] + """ + The URL of the Databricks workspace containing the model serving endpoint + pointed to by this external model. + """ + + databricks_api_token: VariableOrOptional[str] = None + """ + The Databricks secret key reference for a Databricks API token that + corresponds to a user or service principal with Can Query access to the + model serving endpoint pointed to by this external model. If you prefer + to paste your API key directly, see `databricks_api_token_plaintext`. You + must provide an API key using one of the following fields: + `databricks_api_token` or `databricks_api_token_plaintext`. + """ + + databricks_api_token_plaintext: VariableOrOptional[str] = None + """ + The Databricks API token that corresponds to a user or service principal + with Can Query access to the model serving endpoint pointed to by this + external model provided as a plaintext string. If you prefer to reference + your key using Databricks Secrets, see `databricks_api_token`. You must + provide an API key using one of the following fields: + `databricks_api_token` or `databricks_api_token_plaintext`. + """ + + @classmethod + def from_dict(cls, value: "DatabricksModelServingConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DatabricksModelServingConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class DatabricksModelServingConfigDict(TypedDict, total=False): + """""" + + databricks_workspace_url: VariableOr[str] + """ + The URL of the Databricks workspace containing the model serving endpoint + pointed to by this external model. + """ + + databricks_api_token: VariableOrOptional[str] + """ + The Databricks secret key reference for a Databricks API token that + corresponds to a user or service principal with Can Query access to the + model serving endpoint pointed to by this external model. If you prefer + to paste your API key directly, see `databricks_api_token_plaintext`. You + must provide an API key using one of the following fields: + `databricks_api_token` or `databricks_api_token_plaintext`. + """ + + databricks_api_token_plaintext: VariableOrOptional[str] + """ + The Databricks API token that corresponds to a user or service principal + with Can Query access to the model serving endpoint pointed to by this + external model provided as a plaintext string. If you prefer to reference + your key using Databricks Secrets, see `databricks_api_token`. You must + provide an API key using one of the following fields: + `databricks_api_token` or `databricks_api_token_plaintext`. + """ + + +DatabricksModelServingConfigParam = ( + DatabricksModelServingConfigDict | DatabricksModelServingConfig +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/email_notifications.py b/python/databricks/bundles/model_serving_endpoints/_models/email_notifications.py new file mode 100644 index 00000000000..3eaeb0a8358 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/email_notifications.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EmailNotifications: + """""" + + on_update_failure: VariableOrList[str] = field(default_factory=list) + """ + A list of email addresses to be notified when an endpoint fails to update its configuration or state. + """ + + on_update_success: VariableOrList[str] = field(default_factory=list) + """ + A list of email addresses to be notified when an endpoint successfully updates its configuration or state. + """ + + @classmethod + def from_dict(cls, value: "EmailNotificationsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EmailNotificationsDict": + return _transform_to_json_value(self) # type:ignore + + +class EmailNotificationsDict(TypedDict, total=False): + """""" + + on_update_failure: VariableOrList[str] + """ + A list of email addresses to be notified when an endpoint fails to update its configuration or state. + """ + + on_update_success: VariableOrList[str] + """ + A list of email addresses to be notified when an endpoint successfully updates its configuration or state. + """ + + +EmailNotificationsParam = EmailNotificationsDict | EmailNotifications diff --git a/python/databricks/bundles/model_serving_endpoints/_models/endpoint_core_config_input.py b/python/databricks/bundles/model_serving_endpoints/_models/endpoint_core_config_input.py new file mode 100644 index 00000000000..b74a53e067d --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/endpoint_core_config_input.py @@ -0,0 +1,92 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.auto_capture_config_input import ( + AutoCaptureConfigInput, + AutoCaptureConfigInputParam, +) +from databricks.bundles.model_serving_endpoints._models.served_entity_input import ( + ServedEntityInput, + ServedEntityInputParam, +) +from databricks.bundles.model_serving_endpoints._models.served_model_input import ( + ServedModelInput, + ServedModelInputParam, +) +from databricks.bundles.model_serving_endpoints._models.traffic_config import ( + TrafficConfig, + TrafficConfigParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EndpointCoreConfigInput: + """""" + + auto_capture_config: VariableOrOptional[AutoCaptureConfigInput] = None + """ + [DEPRECATED] Configuration for legacy Inference Tables which automatically log requests and responses to Unity + Catalog. + Deprecated: please use AI Gateway inference tables instead. See + https://docs.databricks.com/aws/en/ai-gateway/inference-tables. + """ + + served_entities: VariableOrList[ServedEntityInput] = field(default_factory=list) + """ + The list of served entities under the serving endpoint config. + """ + + served_models: VariableOrList[ServedModelInput] = field(default_factory=list) + """ + (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. + """ + + traffic_config: VariableOrOptional[TrafficConfig] = None + """ + The traffic configuration associated with the serving endpoint config. + """ + + @classmethod + def from_dict(cls, value: "EndpointCoreConfigInputDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EndpointCoreConfigInputDict": + return _transform_to_json_value(self) # type:ignore + + +class EndpointCoreConfigInputDict(TypedDict, total=False): + """""" + + auto_capture_config: VariableOrOptional[AutoCaptureConfigInputParam] + """ + [DEPRECATED] Configuration for legacy Inference Tables which automatically log requests and responses to Unity + Catalog. + Deprecated: please use AI Gateway inference tables instead. See + https://docs.databricks.com/aws/en/ai-gateway/inference-tables. + """ + + served_entities: VariableOrList[ServedEntityInputParam] + """ + The list of served entities under the serving endpoint config. + """ + + served_models: VariableOrList[ServedModelInputParam] + """ + (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. + """ + + traffic_config: VariableOrOptional[TrafficConfigParam] + """ + The traffic configuration associated with the serving endpoint config. + """ + + +EndpointCoreConfigInputParam = EndpointCoreConfigInputDict | EndpointCoreConfigInput diff --git a/python/databricks/bundles/model_serving_endpoints/_models/endpoint_tag.py b/python/databricks/bundles/model_serving_endpoints/_models/endpoint_tag.py new file mode 100644 index 00000000000..ee2bc8943d1 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/endpoint_tag.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EndpointTag: + """""" + + key: VariableOr[str] + """ + Key field for a serving endpoint tag. + """ + + value: VariableOrOptional[str] = None + """ + Optional value field for a serving endpoint tag. + """ + + @classmethod + def from_dict(cls, value: "EndpointTagDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EndpointTagDict": + return _transform_to_json_value(self) # type:ignore + + +class EndpointTagDict(TypedDict, total=False): + """""" + + key: VariableOr[str] + """ + Key field for a serving endpoint tag. + """ + + value: VariableOrOptional[str] + """ + Optional value field for a serving endpoint tag. + """ + + +EndpointTagParam = EndpointTagDict | EndpointTag diff --git a/python/databricks/bundles/model_serving_endpoints/_models/external_model.py b/python/databricks/bundles/model_serving_endpoints/_models/external_model.py new file mode 100644 index 00000000000..0f2fe2a6224 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/external_model.py @@ -0,0 +1,194 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.ai21_labs_config import ( + Ai21LabsConfig, + Ai21LabsConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.amazon_bedrock_config import ( + AmazonBedrockConfig, + AmazonBedrockConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.anthropic_config import ( + AnthropicConfig, + AnthropicConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.cohere_config import ( + CohereConfig, + CohereConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.custom_provider_config import ( + CustomProviderConfig, + CustomProviderConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.databricks_model_serving_config import ( + DatabricksModelServingConfig, + DatabricksModelServingConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.external_model_provider import ( + ExternalModelProvider, + ExternalModelProviderParam, +) +from databricks.bundles.model_serving_endpoints._models.google_cloud_vertex_ai_config import ( + GoogleCloudVertexAiConfig, + GoogleCloudVertexAiConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.open_ai_config import ( + OpenAiConfig, + OpenAiConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.pa_lm_config import ( + PaLmConfig, + PaLmConfigParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ExternalModel: + """""" + + name: VariableOr[str] + """ + The name of the external model. + """ + + provider: VariableOr[ExternalModelProvider] + """ + The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', 'palm', and 'custom'. + """ + + task: VariableOr[str] + """ + The task type of the external model. + """ + + ai21labs_config: VariableOrOptional[Ai21LabsConfig] = None + """ + AI21Labs Config. Only required if the provider is 'ai21labs'. + """ + + amazon_bedrock_config: VariableOrOptional[AmazonBedrockConfig] = None + """ + Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. + """ + + anthropic_config: VariableOrOptional[AnthropicConfig] = None + """ + Anthropic Config. Only required if the provider is 'anthropic'. + """ + + cohere_config: VariableOrOptional[CohereConfig] = None + """ + Cohere Config. Only required if the provider is 'cohere'. + """ + + custom_provider_config: VariableOrOptional[CustomProviderConfig] = None + """ + Custom Provider Config. Only required if the provider is 'custom'. + """ + + databricks_model_serving_config: VariableOrOptional[ + DatabricksModelServingConfig + ] = None + """ + Databricks Model Serving Config. Only required if the provider is 'databricks-model-serving'. + """ + + google_cloud_vertex_ai_config: VariableOrOptional[GoogleCloudVertexAiConfig] = None + """ + Google Cloud Vertex AI Config. Only required if the provider is 'google-cloud-vertex-ai'. + """ + + openai_config: VariableOrOptional[OpenAiConfig] = None + """ + OpenAI Config. Only required if the provider is 'openai'. + """ + + palm_config: VariableOrOptional[PaLmConfig] = None + """ + PaLM Config. Only required if the provider is 'palm'. + """ + + @classmethod + def from_dict(cls, value: "ExternalModelDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ExternalModelDict": + return _transform_to_json_value(self) # type:ignore + + +class ExternalModelDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + The name of the external model. + """ + + provider: VariableOr[ExternalModelProviderParam] + """ + The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', 'palm', and 'custom'. + """ + + task: VariableOr[str] + """ + The task type of the external model. + """ + + ai21labs_config: VariableOrOptional[Ai21LabsConfigParam] + """ + AI21Labs Config. Only required if the provider is 'ai21labs'. + """ + + amazon_bedrock_config: VariableOrOptional[AmazonBedrockConfigParam] + """ + Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. + """ + + anthropic_config: VariableOrOptional[AnthropicConfigParam] + """ + Anthropic Config. Only required if the provider is 'anthropic'. + """ + + cohere_config: VariableOrOptional[CohereConfigParam] + """ + Cohere Config. Only required if the provider is 'cohere'. + """ + + custom_provider_config: VariableOrOptional[CustomProviderConfigParam] + """ + Custom Provider Config. Only required if the provider is 'custom'. + """ + + databricks_model_serving_config: VariableOrOptional[ + DatabricksModelServingConfigParam + ] + """ + Databricks Model Serving Config. Only required if the provider is 'databricks-model-serving'. + """ + + google_cloud_vertex_ai_config: VariableOrOptional[GoogleCloudVertexAiConfigParam] + """ + Google Cloud Vertex AI Config. Only required if the provider is 'google-cloud-vertex-ai'. + """ + + openai_config: VariableOrOptional[OpenAiConfigParam] + """ + OpenAI Config. Only required if the provider is 'openai'. + """ + + palm_config: VariableOrOptional[PaLmConfigParam] + """ + PaLM Config. Only required if the provider is 'palm'. + """ + + +ExternalModelParam = ExternalModelDict | ExternalModel diff --git a/python/databricks/bundles/model_serving_endpoints/_models/external_model_provider.py b/python/databricks/bundles/model_serving_endpoints/_models/external_model_provider.py new file mode 100644 index 00000000000..ee3ef3e0c08 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/external_model_provider.py @@ -0,0 +1,32 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ExternalModelProvider(Enum): + AI21LABS = "ai21labs" + ANTHROPIC = "anthropic" + AMAZON_BEDROCK = "amazon-bedrock" + COHERE = "cohere" + DATABRICKS_MODEL_SERVING = "databricks-model-serving" + GOOGLE_CLOUD_VERTEX_AI = "google-cloud-vertex-ai" + OPENAI = "openai" + PALM = "palm" + CUSTOM = "custom" + + +ExternalModelProviderParam = ( + Literal[ + "ai21labs", + "anthropic", + "amazon-bedrock", + "cohere", + "databricks-model-serving", + "google-cloud-vertex-ai", + "openai", + "palm", + "custom", + ] + | ExternalModelProvider +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/fallback_config.py b/python/databricks/bundles/model_serving_endpoints/_models/fallback_config.py new file mode 100644 index 00000000000..c96493b0982 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/fallback_config.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class FallbackConfig: + """""" + + enabled: VariableOr[bool] + """ + Whether to enable traffic fallback. When a served entity in the serving endpoint returns specific error + codes (e.g. 500), the request will automatically be round-robin attempted with other served entities in the same + endpoint, following the order of served entity list, until a successful response is returned. + If all attempts fail, return the last response with the error code. + """ + + @classmethod + def from_dict(cls, value: "FallbackConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "FallbackConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class FallbackConfigDict(TypedDict, total=False): + """""" + + enabled: VariableOr[bool] + """ + Whether to enable traffic fallback. When a served entity in the serving endpoint returns specific error + codes (e.g. 500), the request will automatically be round-robin attempted with other served entities in the same + endpoint, following the order of served entity list, until a successful response is returned. + If all attempts fail, return the last response with the error code. + """ + + +FallbackConfigParam = FallbackConfigDict | FallbackConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/google_cloud_vertex_ai_config.py b/python/databricks/bundles/model_serving_endpoints/_models/google_cloud_vertex_ai_config.py new file mode 100644 index 00000000000..5b8e3030f56 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/google_cloud_vertex_ai_config.py @@ -0,0 +1,110 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class GoogleCloudVertexAiConfig: + """""" + + project_id: VariableOr[str] + """ + This is the Google Cloud project id that the service account is + associated with. + """ + + region: VariableOr[str] + """ + This is the region for the Google Cloud Vertex AI Service. See [supported + regions] for more details. Some models are only available in specific + regions. + + [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations + """ + + private_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for a private key for the service + account which has access to the Google Cloud Vertex AI Service. See [Best + practices for managing service account keys]. If you prefer to paste your + API key directly, see `private_key_plaintext`. You must provide an API + key using one of the following fields: `private_key` or + `private_key_plaintext` + + [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys + """ + + private_key_plaintext: VariableOrOptional[str] = None + """ + The private key for the service account which has access to the Google + Cloud Vertex AI Service provided as a plaintext secret. See [Best + practices for managing service account keys]. If you prefer to reference + your key using Databricks Secrets, see `private_key`. You must provide an + API key using one of the following fields: `private_key` or + `private_key_plaintext`. + + [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys + """ + + @classmethod + def from_dict(cls, value: "GoogleCloudVertexAiConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "GoogleCloudVertexAiConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class GoogleCloudVertexAiConfigDict(TypedDict, total=False): + """""" + + project_id: VariableOr[str] + """ + This is the Google Cloud project id that the service account is + associated with. + """ + + region: VariableOr[str] + """ + This is the region for the Google Cloud Vertex AI Service. See [supported + regions] for more details. Some models are only available in specific + regions. + + [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations + """ + + private_key: VariableOrOptional[str] + """ + The Databricks secret key reference for a private key for the service + account which has access to the Google Cloud Vertex AI Service. See [Best + practices for managing service account keys]. If you prefer to paste your + API key directly, see `private_key_plaintext`. You must provide an API + key using one of the following fields: `private_key` or + `private_key_plaintext` + + [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys + """ + + private_key_plaintext: VariableOrOptional[str] + """ + The private key for the service account which has access to the Google + Cloud Vertex AI Service provided as a plaintext secret. See [Best + practices for managing service account keys]. If you prefer to reference + your key using Databricks Secrets, see `private_key`. You must provide an + API key using one of the following fields: `private_key` or + `private_key_plaintext`. + + [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys + """ + + +GoogleCloudVertexAiConfigParam = ( + GoogleCloudVertexAiConfigDict | GoogleCloudVertexAiConfig +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/lifecycle.py b/python/databricks/bundles/model_serving_endpoints/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint.py b/python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint.py new file mode 100644 index 00000000000..64ecfbd87d1 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint.py @@ -0,0 +1,185 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.model_serving_endpoints._models.ai_gateway_config import ( + AiGatewayConfig, + AiGatewayConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.email_notifications import ( + EmailNotifications, + EmailNotificationsParam, +) +from databricks.bundles.model_serving_endpoints._models.endpoint_core_config_input import ( + EndpointCoreConfigInput, + EndpointCoreConfigInputParam, +) +from databricks.bundles.model_serving_endpoints._models.endpoint_tag import ( + EndpointTag, + EndpointTagParam, +) +from databricks.bundles.model_serving_endpoints._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint_permission import ( + ModelServingEndpointPermission, + ModelServingEndpointPermissionParam, +) +from databricks.bundles.model_serving_endpoints._models.rate_limit import ( + RateLimit, + RateLimitParam, +) +from databricks.bundles.model_serving_endpoints._models.telemetry_config import ( + TelemetryConfig, + TelemetryConfigParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ModelServingEndpoint(Resource): + """""" + + name: VariableOr[str] + """ + The name of the serving endpoint. This field is required and must be unique across a Databricks workspace. + An endpoint name can consist of alphanumeric characters, dashes, and underscores. + """ + + ai_gateway: VariableOrOptional[AiGatewayConfig] = None + """ + The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. + """ + + budget_policy_id: VariableOrOptional[str] = None + """ + The budget policy to be applied to the serving endpoint. + """ + + config: VariableOrOptional[EndpointCoreConfigInput] = None + """ + The core config of the serving endpoint. + """ + + description: VariableOrOptional[str] = None + + email_notifications: VariableOrOptional[EmailNotifications] = None + """ + Email notification settings. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[ModelServingEndpointPermission] = field( + default_factory=list + ) + """ + The permissions to apply to this resource. + """ + + rate_limits: VariableOrList[RateLimit] = field(default_factory=list) + """ + [DEPRECATED] Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. + """ + + route_optimized: VariableOrOptional[bool] = None + """ + Enable route optimization for the serving endpoint. + """ + + tags: VariableOrList[EndpointTag] = field(default_factory=list) + """ + Tags to be attached to the serving endpoint and automatically propagated to billing logs. + """ + + telemetry_config: VariableOrOptional[TelemetryConfig] = None + """ + [Public Preview] Configuration for persisting endpoint telemetry (logs, traces, and metrics) to Unity Catalog tables. + """ + + @classmethod + def from_dict(cls, value: "ModelServingEndpointDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ModelServingEndpointDict": + return _transform_to_json_value(self) # type:ignore + + +class ModelServingEndpointDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + The name of the serving endpoint. This field is required and must be unique across a Databricks workspace. + An endpoint name can consist of alphanumeric characters, dashes, and underscores. + """ + + ai_gateway: VariableOrOptional[AiGatewayConfigParam] + """ + The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. + """ + + budget_policy_id: VariableOrOptional[str] + """ + The budget policy to be applied to the serving endpoint. + """ + + config: VariableOrOptional[EndpointCoreConfigInputParam] + """ + The core config of the serving endpoint. + """ + + description: VariableOrOptional[str] + + email_notifications: VariableOrOptional[EmailNotificationsParam] + """ + Email notification settings. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[ModelServingEndpointPermissionParam] + """ + The permissions to apply to this resource. + """ + + rate_limits: VariableOrList[RateLimitParam] + """ + [DEPRECATED] Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. + """ + + route_optimized: VariableOrOptional[bool] + """ + Enable route optimization for the serving endpoint. + """ + + tags: VariableOrList[EndpointTagParam] + """ + Tags to be attached to the serving endpoint and automatically propagated to billing logs. + """ + + telemetry_config: VariableOrOptional[TelemetryConfigParam] + """ + [Public Preview] Configuration for persisting endpoint telemetry (logs, traces, and metrics) to Unity Catalog tables. + """ + + +ModelServingEndpointParam = ModelServingEndpointDict | ModelServingEndpoint diff --git a/python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint_permission.py b/python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint_permission.py new file mode 100644 index 00000000000..82e2fdc054a --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/model_serving_endpoint_permission.py @@ -0,0 +1,76 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.serving_endpoint_permission_level import ( + ServingEndpointPermissionLevel, + ServingEndpointPermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ModelServingEndpointPermission: + """""" + + level: VariableOr[ServingEndpointPermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "ModelServingEndpointPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ModelServingEndpointPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class ModelServingEndpointPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[ServingEndpointPermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +ModelServingEndpointPermissionParam = ( + ModelServingEndpointPermissionDict | ModelServingEndpointPermission +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/open_ai_config.py b/python/databricks/bundles/model_serving_endpoints/_models/open_ai_config.py new file mode 100644 index 00000000000..e19a4eac665 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/open_ai_config.py @@ -0,0 +1,200 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class OpenAiConfig: + """ + Configs needed to create an OpenAI model route. + """ + + microsoft_entra_client_id: VariableOrOptional[str] = None + """ + This field is only required for Azure AD OpenAI and is the Microsoft + Entra Client ID. + """ + + microsoft_entra_client_secret: VariableOrOptional[str] = None + """ + The Databricks secret key reference for a client secret used for + Microsoft Entra ID authentication. If you prefer to paste your client + secret directly, see `microsoft_entra_client_secret_plaintext`. You must + provide an API key using one of the following fields: + `microsoft_entra_client_secret` or + `microsoft_entra_client_secret_plaintext`. + """ + + microsoft_entra_client_secret_plaintext: VariableOrOptional[str] = None + """ + The client secret used for Microsoft Entra ID authentication provided as + a plaintext string. If you prefer to reference your key using Databricks + Secrets, see `microsoft_entra_client_secret`. You must provide an API key + using one of the following fields: `microsoft_entra_client_secret` or + `microsoft_entra_client_secret_plaintext`. + """ + + microsoft_entra_tenant_id: VariableOrOptional[str] = None + """ + This field is only required for Azure AD OpenAI and is the Microsoft + Entra Tenant ID. + """ + + openai_api_base: VariableOrOptional[str] = None + """ + This is a field to provide a customized base URl for the OpenAI API. For + Azure OpenAI, this field is required, and is the base URL for the Azure + OpenAI API service provided by Azure. For other OpenAI API types, this + field is optional, and if left unspecified, the standard OpenAI base URL + is used. + """ + + openai_api_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for an OpenAI API key using the + OpenAI or Azure service. If you prefer to paste your API key directly, + see `openai_api_key_plaintext`. You must provide an API key using one of + the following fields: `openai_api_key` or `openai_api_key_plaintext`. + """ + + openai_api_key_plaintext: VariableOrOptional[str] = None + """ + The OpenAI API key using the OpenAI or Azure service provided as a + plaintext string. If you prefer to reference your key using Databricks + Secrets, see `openai_api_key`. You must provide an API key using one of + the following fields: `openai_api_key` or `openai_api_key_plaintext`. + """ + + openai_api_type: VariableOrOptional[str] = None + """ + This is an optional field to specify the type of OpenAI API to use. For + Azure OpenAI, this field is required, and adjust this parameter to + represent the preferred security access validation protocol. For access + token validation, use azure. For authentication using Azure Active + Directory (Azure AD) use, azuread. + """ + + openai_api_version: VariableOrOptional[str] = None + """ + This is an optional field to specify the OpenAI API version. For Azure + OpenAI, this field is required, and is the version of the Azure OpenAI + service to utilize, specified by a date. + """ + + openai_deployment_name: VariableOrOptional[str] = None + """ + This field is only required for Azure OpenAI and is the name of the + deployment resource for the Azure OpenAI service. + """ + + openai_organization: VariableOrOptional[str] = None + """ + This is an optional field to specify the organization in OpenAI or Azure + OpenAI. + """ + + @classmethod + def from_dict(cls, value: "OpenAiConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "OpenAiConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class OpenAiConfigDict(TypedDict, total=False): + """""" + + microsoft_entra_client_id: VariableOrOptional[str] + """ + This field is only required for Azure AD OpenAI and is the Microsoft + Entra Client ID. + """ + + microsoft_entra_client_secret: VariableOrOptional[str] + """ + The Databricks secret key reference for a client secret used for + Microsoft Entra ID authentication. If you prefer to paste your client + secret directly, see `microsoft_entra_client_secret_plaintext`. You must + provide an API key using one of the following fields: + `microsoft_entra_client_secret` or + `microsoft_entra_client_secret_plaintext`. + """ + + microsoft_entra_client_secret_plaintext: VariableOrOptional[str] + """ + The client secret used for Microsoft Entra ID authentication provided as + a plaintext string. If you prefer to reference your key using Databricks + Secrets, see `microsoft_entra_client_secret`. You must provide an API key + using one of the following fields: `microsoft_entra_client_secret` or + `microsoft_entra_client_secret_plaintext`. + """ + + microsoft_entra_tenant_id: VariableOrOptional[str] + """ + This field is only required for Azure AD OpenAI and is the Microsoft + Entra Tenant ID. + """ + + openai_api_base: VariableOrOptional[str] + """ + This is a field to provide a customized base URl for the OpenAI API. For + Azure OpenAI, this field is required, and is the base URL for the Azure + OpenAI API service provided by Azure. For other OpenAI API types, this + field is optional, and if left unspecified, the standard OpenAI base URL + is used. + """ + + openai_api_key: VariableOrOptional[str] + """ + The Databricks secret key reference for an OpenAI API key using the + OpenAI or Azure service. If you prefer to paste your API key directly, + see `openai_api_key_plaintext`. You must provide an API key using one of + the following fields: `openai_api_key` or `openai_api_key_plaintext`. + """ + + openai_api_key_plaintext: VariableOrOptional[str] + """ + The OpenAI API key using the OpenAI or Azure service provided as a + plaintext string. If you prefer to reference your key using Databricks + Secrets, see `openai_api_key`. You must provide an API key using one of + the following fields: `openai_api_key` or `openai_api_key_plaintext`. + """ + + openai_api_type: VariableOrOptional[str] + """ + This is an optional field to specify the type of OpenAI API to use. For + Azure OpenAI, this field is required, and adjust this parameter to + represent the preferred security access validation protocol. For access + token validation, use azure. For authentication using Azure Active + Directory (Azure AD) use, azuread. + """ + + openai_api_version: VariableOrOptional[str] + """ + This is an optional field to specify the OpenAI API version. For Azure + OpenAI, this field is required, and is the version of the Azure OpenAI + service to utilize, specified by a date. + """ + + openai_deployment_name: VariableOrOptional[str] + """ + This field is only required for Azure OpenAI and is the name of the + deployment resource for the Azure OpenAI service. + """ + + openai_organization: VariableOrOptional[str] + """ + This is an optional field to specify the organization in OpenAI or Azure + OpenAI. + """ + + +OpenAiConfigParam = OpenAiConfigDict | OpenAiConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/pa_lm_config.py b/python/databricks/bundles/model_serving_endpoints/_models/pa_lm_config.py new file mode 100644 index 00000000000..98e5c572687 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/pa_lm_config.py @@ -0,0 +1,62 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PaLmConfig: + """""" + + palm_api_key: VariableOrOptional[str] = None + """ + The Databricks secret key reference for a PaLM API key. If you prefer to + paste your API key directly, see `palm_api_key_plaintext`. You must + provide an API key using one of the following fields: `palm_api_key` or + `palm_api_key_plaintext`. + """ + + palm_api_key_plaintext: VariableOrOptional[str] = None + """ + The PaLM API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `palm_api_key`. You must + provide an API key using one of the following fields: `palm_api_key` or + `palm_api_key_plaintext`. + """ + + @classmethod + def from_dict(cls, value: "PaLmConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PaLmConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class PaLmConfigDict(TypedDict, total=False): + """""" + + palm_api_key: VariableOrOptional[str] + """ + The Databricks secret key reference for a PaLM API key. If you prefer to + paste your API key directly, see `palm_api_key_plaintext`. You must + provide an API key using one of the following fields: `palm_api_key` or + `palm_api_key_plaintext`. + """ + + palm_api_key_plaintext: VariableOrOptional[str] + """ + The PaLM API key provided as a plaintext string. If you prefer to + reference your key using Databricks Secrets, see `palm_api_key`. You must + provide an API key using one of the following fields: `palm_api_key` or + `palm_api_key_plaintext`. + """ + + +PaLmConfigParam = PaLmConfigDict | PaLmConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/rate_limit.py b/python/databricks/bundles/model_serving_endpoints/_models/rate_limit.py new file mode 100644 index 00000000000..5a0192df8ce --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/rate_limit.py @@ -0,0 +1,70 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.rate_limit_key import ( + RateLimitKey, + RateLimitKeyParam, +) +from databricks.bundles.model_serving_endpoints._models.rate_limit_renewal_period import ( + RateLimitRenewalPeriod, + RateLimitRenewalPeriodParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class RateLimit: + """ + [DEPRECATED] + """ + + calls: VariableOr[int] + """ + Used to specify how many calls are allowed for a key within the renewal_period. + """ + + renewal_period: VariableOr[RateLimitRenewalPeriod] + """ + Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported. + """ + + key: VariableOrOptional[RateLimitKey] = None + """ + Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified. + """ + + @classmethod + def from_dict(cls, value: "RateLimitDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "RateLimitDict": + return _transform_to_json_value(self) # type:ignore + + +class RateLimitDict(TypedDict, total=False): + """""" + + calls: VariableOr[int] + """ + Used to specify how many calls are allowed for a key within the renewal_period. + """ + + renewal_period: VariableOr[RateLimitRenewalPeriodParam] + """ + Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported. + """ + + key: VariableOrOptional[RateLimitKeyParam] + """ + Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified. + """ + + +RateLimitParam = RateLimitDict | RateLimit diff --git a/python/databricks/bundles/model_serving_endpoints/_models/rate_limit_key.py b/python/databricks/bundles/model_serving_endpoints/_models/rate_limit_key.py new file mode 100644 index 00000000000..b6ebe9db1c4 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/rate_limit_key.py @@ -0,0 +1,16 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RateLimitKey(Enum): + """ + [DEPRECATED] + """ + + USER = "user" + ENDPOINT = "endpoint" + + +RateLimitKeyParam = Literal["user", "endpoint"] | RateLimitKey diff --git a/python/databricks/bundles/model_serving_endpoints/_models/rate_limit_renewal_period.py b/python/databricks/bundles/model_serving_endpoints/_models/rate_limit_renewal_period.py new file mode 100644 index 00000000000..81f900bf39f --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/rate_limit_renewal_period.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RateLimitRenewalPeriod(Enum): + """ + [DEPRECATED] + """ + + MINUTE = "minute" + + +RateLimitRenewalPeriodParam = Literal["minute"] | RateLimitRenewalPeriod diff --git a/python/databricks/bundles/model_serving_endpoints/_models/route.py b/python/databricks/bundles/model_serving_endpoints/_models/route.py new file mode 100644 index 00000000000..eba4336b0fc --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/route.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Route: + """""" + + traffic_percentage: VariableOr[int] + """ + The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive. + """ + + served_entity_name: VariableOrOptional[str] = None + + served_model_name: VariableOrOptional[str] = None + """ + The name of the served model this route configures traffic for. + """ + + @classmethod + def from_dict(cls, value: "RouteDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "RouteDict": + return _transform_to_json_value(self) # type:ignore + + +class RouteDict(TypedDict, total=False): + """""" + + traffic_percentage: VariableOr[int] + """ + The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive. + """ + + served_entity_name: VariableOrOptional[str] + + served_model_name: VariableOrOptional[str] + """ + The name of the served model this route configures traffic for. + """ + + +RouteParam = RouteDict | Route diff --git a/python/databricks/bundles/model_serving_endpoints/_models/served_entity_input.py b/python/databricks/bundles/model_serving_endpoints/_models/served_entity_input.py new file mode 100644 index 00000000000..e40050ca3e6 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/served_entity_input.py @@ -0,0 +1,186 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrDict, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.external_model import ( + ExternalModel, + ExternalModelParam, +) +from databricks.bundles.model_serving_endpoints._models.serving_model_workload_type import ( + ServingModelWorkloadType, + ServingModelWorkloadTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ServedEntityInput: + """""" + + burst_scaling_enabled: VariableOrOptional[bool] = None + """ + [Public Preview] Whether burst scaling is enabled. When enabled (default), the endpoint can automatically + scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint + maintains fixed capacity at provisioned_model_units. + """ + + entity_name: VariableOrOptional[str] = None + """ + The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**. + """ + + entity_version: VariableOrOptional[str] = None + + environment_vars: VariableOrDict[str] = field(default_factory=dict) + """ + An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}` + """ + + external_model: VariableOrOptional[ExternalModel] = None + """ + The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with the latter set being used for custom model serving for a Databricks registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same. + """ + + instance_profile_arn: VariableOrOptional[str] = None + """ + [Public Preview] ARN of the instance profile that the served entity uses to access AWS resources. + """ + + max_provisioned_concurrency: VariableOrOptional[int] = None + """ + The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified. + """ + + max_provisioned_throughput: VariableOrOptional[int] = None + """ + The maximum tokens per second that the endpoint can scale up to. + """ + + min_provisioned_concurrency: VariableOrOptional[int] = None + """ + The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified. + """ + + min_provisioned_throughput: VariableOrOptional[int] = None + """ + The minimum tokens per second that the endpoint can scale down to. + """ + + name: VariableOrOptional[str] = None + """ + The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. + """ + + provisioned_model_units: VariableOrOptional[int] = None + """ + [Public Preview] The number of model units provisioned. + """ + + scale_to_zero_enabled: VariableOrOptional[bool] = None + """ + Whether the compute resources for the served entity should scale down to zero. + """ + + workload_size: VariableOrOptional[str] = None + """ + The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified. + """ + + workload_type: VariableOrOptional[ServingModelWorkloadType] = None + """ + The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types](https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). + """ + + @classmethod + def from_dict(cls, value: "ServedEntityInputDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ServedEntityInputDict": + return _transform_to_json_value(self) # type:ignore + + +class ServedEntityInputDict(TypedDict, total=False): + """""" + + burst_scaling_enabled: VariableOrOptional[bool] + """ + [Public Preview] Whether burst scaling is enabled. When enabled (default), the endpoint can automatically + scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint + maintains fixed capacity at provisioned_model_units. + """ + + entity_name: VariableOrOptional[str] + """ + The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**. + """ + + entity_version: VariableOrOptional[str] + + environment_vars: VariableOrDict[str] + """ + An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}` + """ + + external_model: VariableOrOptional[ExternalModelParam] + """ + The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with the latter set being used for custom model serving for a Databricks registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same. + """ + + instance_profile_arn: VariableOrOptional[str] + """ + [Public Preview] ARN of the instance profile that the served entity uses to access AWS resources. + """ + + max_provisioned_concurrency: VariableOrOptional[int] + """ + The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified. + """ + + max_provisioned_throughput: VariableOrOptional[int] + """ + The maximum tokens per second that the endpoint can scale up to. + """ + + min_provisioned_concurrency: VariableOrOptional[int] + """ + The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified. + """ + + min_provisioned_throughput: VariableOrOptional[int] + """ + The minimum tokens per second that the endpoint can scale down to. + """ + + name: VariableOrOptional[str] + """ + The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. + """ + + provisioned_model_units: VariableOrOptional[int] + """ + [Public Preview] The number of model units provisioned. + """ + + scale_to_zero_enabled: VariableOrOptional[bool] + """ + Whether the compute resources for the served entity should scale down to zero. + """ + + workload_size: VariableOrOptional[str] + """ + The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified. + """ + + workload_type: VariableOrOptional[ServingModelWorkloadTypeParam] + """ + The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types](https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). + """ + + +ServedEntityInputParam = ServedEntityInputDict | ServedEntityInput diff --git a/python/databricks/bundles/model_serving_endpoints/_models/served_model_input.py b/python/databricks/bundles/model_serving_endpoints/_models/served_model_input.py new file mode 100644 index 00000000000..90c98757af5 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/served_model_input.py @@ -0,0 +1,170 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrDict, + VariableOrOptional, +) +from databricks.bundles.model_serving_endpoints._models.served_model_input_workload_type import ( + ServedModelInputWorkloadType, + ServedModelInputWorkloadTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ServedModelInput: + """""" + + model_name: VariableOr[str] + + model_version: VariableOr[str] + + scale_to_zero_enabled: VariableOr[bool] + """ + Whether the compute resources for the served entity should scale down to zero. + """ + + burst_scaling_enabled: VariableOrOptional[bool] = None + """ + [Public Preview] Whether burst scaling is enabled. When enabled (default), the endpoint can automatically + scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint + maintains fixed capacity at provisioned_model_units. + """ + + environment_vars: VariableOrDict[str] = field(default_factory=dict) + """ + An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}` + """ + + instance_profile_arn: VariableOrOptional[str] = None + """ + [Public Preview] ARN of the instance profile that the served entity uses to access AWS resources. + """ + + max_provisioned_concurrency: VariableOrOptional[int] = None + """ + The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified. + """ + + max_provisioned_throughput: VariableOrOptional[int] = None + """ + The maximum tokens per second that the endpoint can scale up to. + """ + + min_provisioned_concurrency: VariableOrOptional[int] = None + """ + The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified. + """ + + min_provisioned_throughput: VariableOrOptional[int] = None + """ + The minimum tokens per second that the endpoint can scale down to. + """ + + name: VariableOrOptional[str] = None + """ + The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. + """ + + provisioned_model_units: VariableOrOptional[int] = None + """ + [Public Preview] The number of model units provisioned. + """ + + workload_size: VariableOrOptional[str] = None + """ + The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified. + """ + + workload_type: VariableOrOptional[ServedModelInputWorkloadType] = None + """ + The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types](https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). + """ + + @classmethod + def from_dict(cls, value: "ServedModelInputDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ServedModelInputDict": + return _transform_to_json_value(self) # type:ignore + + +class ServedModelInputDict(TypedDict, total=False): + """""" + + model_name: VariableOr[str] + + model_version: VariableOr[str] + + scale_to_zero_enabled: VariableOr[bool] + """ + Whether the compute resources for the served entity should scale down to zero. + """ + + burst_scaling_enabled: VariableOrOptional[bool] + """ + [Public Preview] Whether burst scaling is enabled. When enabled (default), the endpoint can automatically + scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint + maintains fixed capacity at provisioned_model_units. + """ + + environment_vars: VariableOrDict[str] + """ + An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to Databricks secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}` + """ + + instance_profile_arn: VariableOrOptional[str] + """ + [Public Preview] ARN of the instance profile that the served entity uses to access AWS resources. + """ + + max_provisioned_concurrency: VariableOrOptional[int] + """ + The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified. + """ + + max_provisioned_throughput: VariableOrOptional[int] + """ + The maximum tokens per second that the endpoint can scale up to. + """ + + min_provisioned_concurrency: VariableOrOptional[int] + """ + The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified. + """ + + min_provisioned_throughput: VariableOrOptional[int] + """ + The minimum tokens per second that the endpoint can scale down to. + """ + + name: VariableOrOptional[str] + """ + The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. + """ + + provisioned_model_units: VariableOrOptional[int] + """ + [Public Preview] The number of model units provisioned. + """ + + workload_size: VariableOrOptional[str] + """ + The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified. + """ + + workload_type: VariableOrOptional[ServedModelInputWorkloadTypeParam] + """ + The workload type of the served entity. The workload type selects which type of compute to use in the endpoint. The default value for this parameter is "CPU". For deep learning workloads, GPU acceleration is available by selecting workload types like GPU_SMALL and others. See the available [GPU types](https://docs.databricks.com/en/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). + """ + + +ServedModelInputParam = ServedModelInputDict | ServedModelInput diff --git a/python/databricks/bundles/model_serving_endpoints/_models/served_model_input_workload_type.py b/python/databricks/bundles/model_serving_endpoints/_models/served_model_input_workload_type.py new file mode 100644 index 00000000000..87f62c41e34 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/served_model_input_workload_type.py @@ -0,0 +1,36 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ServedModelInputWorkloadType(Enum): + """ + Please keep this in sync with workload types in InferenceEndpointEntities.scala. + """ + + CPU = "CPU" + GPU_MEDIUM = "GPU_MEDIUM" + GPU_SMALL = "GPU_SMALL" + GPU_LARGE = "GPU_LARGE" + MULTIGPU_MEDIUM = "MULTIGPU_MEDIUM" + CPU_LARGE = "CPU_LARGE" + GPU_XLARGE_8 = "GPU_XLARGE_8" + GPU_XLARGE = "GPU_XLARGE" + CPU_MEDIUM = "CPU_MEDIUM" + + +ServedModelInputWorkloadTypeParam = ( + Literal[ + "CPU", + "GPU_MEDIUM", + "GPU_SMALL", + "GPU_LARGE", + "MULTIGPU_MEDIUM", + "CPU_LARGE", + "GPU_XLARGE_8", + "GPU_XLARGE", + "CPU_MEDIUM", + ] + | ServedModelInputWorkloadType +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/serving_endpoint_permission_level.py b/python/databricks/bundles/model_serving_endpoints/_models/serving_endpoint_permission_level.py new file mode 100644 index 00000000000..d9d75992c54 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/serving_endpoint_permission_level.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ServingEndpointPermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_QUERY = "CAN_QUERY" + CAN_VIEW = "CAN_VIEW" + + +ServingEndpointPermissionLevelParam = ( + Literal["CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"] | ServingEndpointPermissionLevel +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/serving_model_workload_type.py b/python/databricks/bundles/model_serving_endpoints/_models/serving_model_workload_type.py new file mode 100644 index 00000000000..04b513e77a7 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/serving_model_workload_type.py @@ -0,0 +1,36 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ServingModelWorkloadType(Enum): + """ + Please keep this in sync with workload types in InferenceEndpointEntities.scala. + """ + + CPU = "CPU" + GPU_MEDIUM = "GPU_MEDIUM" + GPU_SMALL = "GPU_SMALL" + GPU_LARGE = "GPU_LARGE" + MULTIGPU_MEDIUM = "MULTIGPU_MEDIUM" + CPU_LARGE = "CPU_LARGE" + GPU_XLARGE_8 = "GPU_XLARGE_8" + GPU_XLARGE = "GPU_XLARGE" + CPU_MEDIUM = "CPU_MEDIUM" + + +ServingModelWorkloadTypeParam = ( + Literal[ + "CPU", + "GPU_MEDIUM", + "GPU_SMALL", + "GPU_LARGE", + "MULTIGPU_MEDIUM", + "CPU_LARGE", + "GPU_XLARGE_8", + "GPU_XLARGE", + "CPU_MEDIUM", + ] + | ServingModelWorkloadType +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/telemetry_config.py b/python/databricks/bundles/model_serving_endpoints/_models/telemetry_config.py new file mode 100644 index 00000000000..cffb10c2642 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/telemetry_config.py @@ -0,0 +1,90 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.model_serving_endpoints._models.telemetry_feature import ( + TelemetryFeature, + TelemetryFeatureParam, +) +from databricks.bundles.model_serving_endpoints._models.telemetry_inference_table_config import ( + TelemetryInferenceTableConfig, + TelemetryInferenceTableConfigParam, +) +from databricks.bundles.model_serving_endpoints._models.unity_catalog_table_names import ( + UnityCatalogTableNames, + UnityCatalogTableNamesParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class TelemetryConfig: + """""" + + enabled_telemetry_features: VariableOrList[TelemetryFeature] = field( + default_factory=list + ) + """ + [Public Preview] The telemetry signals to enable for this endpoint. If empty or omitted, all signals are + enabled; otherwise only the listed signals are enabled. + """ + + inference_table_config: VariableOrOptional[TelemetryInferenceTableConfig] = None + """ + [Public Preview] Configuration for inference table payload logging, including sampling. + """ + + table_names: VariableOrOptional[UnityCatalogTableNames] = None + """ + [Public Preview] The Unity Catalog tables to which endpoint telemetry (logs, traces, and metrics) is exported. + Provide this to create a new telemetry profile for the endpoint from the given tables. + """ + + telemetry_profile_id: VariableOrOptional[str] = None + """ + [Public Preview] The ID of an existing telemetry profile to apply to this endpoint. Provide this to reuse a + telemetry profile that has already been created, instead of specifying table_names. + """ + + @classmethod + def from_dict(cls, value: "TelemetryConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "TelemetryConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class TelemetryConfigDict(TypedDict, total=False): + """""" + + enabled_telemetry_features: VariableOrList[TelemetryFeatureParam] + """ + [Public Preview] The telemetry signals to enable for this endpoint. If empty or omitted, all signals are + enabled; otherwise only the listed signals are enabled. + """ + + inference_table_config: VariableOrOptional[TelemetryInferenceTableConfigParam] + """ + [Public Preview] Configuration for inference table payload logging, including sampling. + """ + + table_names: VariableOrOptional[UnityCatalogTableNamesParam] + """ + [Public Preview] The Unity Catalog tables to which endpoint telemetry (logs, traces, and metrics) is exported. + Provide this to create a new telemetry profile for the endpoint from the given tables. + """ + + telemetry_profile_id: VariableOrOptional[str] + """ + [Public Preview] The ID of an existing telemetry profile to apply to this endpoint. Provide this to reuse a + telemetry profile that has already been created, instead of specifying table_names. + """ + + +TelemetryConfigParam = TelemetryConfigDict | TelemetryConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/telemetry_feature.py b/python/databricks/bundles/model_serving_endpoints/_models/telemetry_feature.py new file mode 100644 index 00000000000..2d74f666c07 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/telemetry_feature.py @@ -0,0 +1,27 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class TelemetryFeature(Enum): + """ + A telemetry signal that a serving endpoint can export to Unity Catalog. Use these values to + select which signals the endpoint exports. + """ + + TELEMETRY_FEATURE_LOGS = "TELEMETRY_FEATURE_LOGS" + TELEMETRY_FEATURE_TRACES = "TELEMETRY_FEATURE_TRACES" + TELEMETRY_FEATURE_METRICS = "TELEMETRY_FEATURE_METRICS" + TELEMETRY_FEATURE_INFERENCE_TABLE = "TELEMETRY_FEATURE_INFERENCE_TABLE" + + +TelemetryFeatureParam = ( + Literal[ + "TELEMETRY_FEATURE_LOGS", + "TELEMETRY_FEATURE_TRACES", + "TELEMETRY_FEATURE_METRICS", + "TELEMETRY_FEATURE_INFERENCE_TABLE", + ] + | TelemetryFeature +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/telemetry_inference_table_config.py b/python/databricks/bundles/model_serving_endpoints/_models/telemetry_inference_table_config.py new file mode 100644 index 00000000000..9153a4c49ac --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/telemetry_inference_table_config.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class TelemetryInferenceTableConfig: + """ + Inference table payload logging configuration + """ + + sampling_fraction: VariableOrOptional[float] = None + """ + [Public Preview] Fraction of requests sampled for payload logging, in the range [0.0, 1.0], where 1.0 logs all requests. + """ + + @classmethod + def from_dict(cls, value: "TelemetryInferenceTableConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "TelemetryInferenceTableConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class TelemetryInferenceTableConfigDict(TypedDict, total=False): + """""" + + sampling_fraction: VariableOrOptional[float] + """ + [Public Preview] Fraction of requests sampled for payload logging, in the range [0.0, 1.0], where 1.0 logs all requests. + """ + + +TelemetryInferenceTableConfigParam = ( + TelemetryInferenceTableConfigDict | TelemetryInferenceTableConfig +) diff --git a/python/databricks/bundles/model_serving_endpoints/_models/traffic_config.py b/python/databricks/bundles/model_serving_endpoints/_models/traffic_config.py new file mode 100644 index 00000000000..d25a5c87fef --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/traffic_config.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList +from databricks.bundles.model_serving_endpoints._models.route import ( + Route, + RouteParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class TrafficConfig: + """""" + + routes: VariableOrList[Route] = field(default_factory=list) + """ + The list of routes that define traffic to each served entity. + """ + + @classmethod + def from_dict(cls, value: "TrafficConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "TrafficConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class TrafficConfigDict(TypedDict, total=False): + """""" + + routes: VariableOrList[RouteParam] + """ + The list of routes that define traffic to each served entity. + """ + + +TrafficConfigParam = TrafficConfigDict | TrafficConfig diff --git a/python/databricks/bundles/model_serving_endpoints/_models/unity_catalog_table_names.py b/python/databricks/bundles/model_serving_endpoints/_models/unity_catalog_table_names.py new file mode 100644 index 00000000000..5cf8a32d821 --- /dev/null +++ b/python/databricks/bundles/model_serving_endpoints/_models/unity_catalog_table_names.py @@ -0,0 +1,78 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class UnityCatalogTableNames: + """""" + + annotations_table: VariableOrOptional[str] = None + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported annotations. + """ + + logs_table: VariableOrOptional[str] = None + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported logs. + """ + + metrics_table: VariableOrOptional[str] = None + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported metrics. + """ + + traces_table: VariableOrOptional[str] = None + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported traces (spans). + """ + + @classmethod + def from_dict(cls, value: "UnityCatalogTableNamesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "UnityCatalogTableNamesDict": + return _transform_to_json_value(self) # type:ignore + + +class UnityCatalogTableNamesDict(TypedDict, total=False): + """""" + + annotations_table: VariableOrOptional[str] + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported annotations. + """ + + logs_table: VariableOrOptional[str] + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported logs. + """ + + metrics_table: VariableOrOptional[str] + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported metrics. + """ + + traces_table: VariableOrOptional[str] + """ + [Public Preview] The full three-level Unity Catalog name (catalog.schema.table) of the table that receives + exported traces (spans). + """ + + +UnityCatalogTableNamesParam = UnityCatalogTableNamesDict | UnityCatalogTableNames diff --git a/python/databricks/bundles/models/__init__.py b/python/databricks/bundles/models/__init__.py new file mode 100644 index 00000000000..a3469f1689e --- /dev/null +++ b/python/databricks/bundles/models/__init__.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "MlflowModel", + "MlflowModelDict", + "MlflowModelParam", + "MlflowModelPermission", + "MlflowModelPermissionDict", + "MlflowModelPermissionParam", + "ModelTag", + "ModelTagDict", + "ModelTagParam", + "RegisteredModelPermissionLevel", + "RegisteredModelPermissionLevelParam", +] + + +from databricks.bundles.models._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.models._models.mlflow_model import ( + MlflowModel, + MlflowModelDict, + MlflowModelParam, +) +from databricks.bundles.models._models.mlflow_model_permission import ( + MlflowModelPermission, + MlflowModelPermissionDict, + MlflowModelPermissionParam, +) +from databricks.bundles.models._models.model_tag import ( + ModelTag, + ModelTagDict, + ModelTagParam, +) +from databricks.bundles.models._models.registered_model_permission_level import ( + RegisteredModelPermissionLevel, + RegisteredModelPermissionLevelParam, +) diff --git a/python/databricks/bundles/models/_models/lifecycle.py b/python/databricks/bundles/models/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/models/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/models/_models/mlflow_model.py b/python/databricks/bundles/models/_models/mlflow_model.py new file mode 100644 index 00000000000..390f1155f2c --- /dev/null +++ b/python/databricks/bundles/models/_models/mlflow_model.py @@ -0,0 +1,91 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.models._models.lifecycle import Lifecycle, LifecycleParam +from databricks.bundles.models._models.mlflow_model_permission import ( + MlflowModelPermission, + MlflowModelPermissionParam, +) +from databricks.bundles.models._models.model_tag import ModelTag, ModelTagParam + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MlflowModel(Resource): + """""" + + name: VariableOr[str] + """ + Register models under this name + """ + + description: VariableOrOptional[str] = None + """ + Optional description for registered model. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[MlflowModelPermission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + tags: VariableOrList[ModelTag] = field(default_factory=list) + """ + Additional metadata for registered model. + """ + + @classmethod + def from_dict(cls, value: "MlflowModelDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MlflowModelDict": + return _transform_to_json_value(self) # type:ignore + + +class MlflowModelDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + Register models under this name + """ + + description: VariableOrOptional[str] + """ + Optional description for registered model. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[MlflowModelPermissionParam] + """ + The permissions to apply to this resource. + """ + + tags: VariableOrList[ModelTagParam] + """ + Additional metadata for registered model. + """ + + +MlflowModelParam = MlflowModelDict | MlflowModel diff --git a/python/databricks/bundles/models/_models/mlflow_model_permission.py b/python/databricks/bundles/models/_models/mlflow_model_permission.py new file mode 100644 index 00000000000..367cbfd4a3a --- /dev/null +++ b/python/databricks/bundles/models/_models/mlflow_model_permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.models._models.registered_model_permission_level import ( + RegisteredModelPermissionLevel, + RegisteredModelPermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MlflowModelPermission: + """""" + + level: VariableOr[RegisteredModelPermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "MlflowModelPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MlflowModelPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class MlflowModelPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[RegisteredModelPermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +MlflowModelPermissionParam = MlflowModelPermissionDict | MlflowModelPermission diff --git a/python/databricks/bundles/models/_models/model_tag.py b/python/databricks/bundles/models/_models/model_tag.py new file mode 100644 index 00000000000..b434ad05552 --- /dev/null +++ b/python/databricks/bundles/models/_models/model_tag.py @@ -0,0 +1,52 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ModelTag: + """ + Tag for a registered model + """ + + key: VariableOrOptional[str] = None + """ + The tag key. + """ + + value: VariableOrOptional[str] = None + """ + The tag value. + """ + + @classmethod + def from_dict(cls, value: "ModelTagDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ModelTagDict": + return _transform_to_json_value(self) # type:ignore + + +class ModelTagDict(TypedDict, total=False): + """""" + + key: VariableOrOptional[str] + """ + The tag key. + """ + + value: VariableOrOptional[str] + """ + The tag value. + """ + + +ModelTagParam = ModelTagDict | ModelTag diff --git a/python/databricks/bundles/models/_models/registered_model_permission_level.py b/python/databricks/bundles/models/_models/registered_model_permission_level.py new file mode 100644 index 00000000000..1344b5d5e48 --- /dev/null +++ b/python/databricks/bundles/models/_models/registered_model_permission_level.py @@ -0,0 +1,28 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RegisteredModelPermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_MANAGE_PRODUCTION_VERSIONS = "CAN_MANAGE_PRODUCTION_VERSIONS" + CAN_MANAGE_STAGING_VERSIONS = "CAN_MANAGE_STAGING_VERSIONS" + CAN_EDIT = "CAN_EDIT" + CAN_READ = "CAN_READ" + + +RegisteredModelPermissionLevelParam = ( + Literal[ + "CAN_MANAGE", + "CAN_MANAGE_PRODUCTION_VERSIONS", + "CAN_MANAGE_STAGING_VERSIONS", + "CAN_EDIT", + "CAN_READ", + ] + | RegisteredModelPermissionLevel +) diff --git a/python/databricks/bundles/quality_monitors/__init__.py b/python/databricks/bundles/quality_monitors/__init__.py new file mode 100644 index 00000000000..ad0902bfcf6 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/__init__.py @@ -0,0 +1,104 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "MonitorCronSchedule", + "MonitorCronScheduleDict", + "MonitorCronScheduleParam", + "MonitorCronSchedulePauseStatus", + "MonitorCronSchedulePauseStatusParam", + "MonitorDataClassificationConfig", + "MonitorDataClassificationConfigDict", + "MonitorDataClassificationConfigParam", + "MonitorDestination", + "MonitorDestinationDict", + "MonitorDestinationParam", + "MonitorInferenceLog", + "MonitorInferenceLogDict", + "MonitorInferenceLogParam", + "MonitorInferenceLogProblemType", + "MonitorInferenceLogProblemTypeParam", + "MonitorMetric", + "MonitorMetricDict", + "MonitorMetricParam", + "MonitorMetricType", + "MonitorMetricTypeParam", + "MonitorNotifications", + "MonitorNotificationsDict", + "MonitorNotificationsParam", + "MonitorSnapshot", + "MonitorSnapshotDict", + "MonitorSnapshotParam", + "MonitorTimeSeries", + "MonitorTimeSeriesDict", + "MonitorTimeSeriesParam", + "QualityMonitor", + "QualityMonitorDict", + "QualityMonitorParam", +] + + +from databricks.bundles.quality_monitors._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.quality_monitors._models.monitor_cron_schedule import ( + MonitorCronSchedule, + MonitorCronScheduleDict, + MonitorCronScheduleParam, +) +from databricks.bundles.quality_monitors._models.monitor_cron_schedule_pause_status import ( + MonitorCronSchedulePauseStatus, + MonitorCronSchedulePauseStatusParam, +) +from databricks.bundles.quality_monitors._models.monitor_data_classification_config import ( + MonitorDataClassificationConfig, + MonitorDataClassificationConfigDict, + MonitorDataClassificationConfigParam, +) +from databricks.bundles.quality_monitors._models.monitor_destination import ( + MonitorDestination, + MonitorDestinationDict, + MonitorDestinationParam, +) +from databricks.bundles.quality_monitors._models.monitor_inference_log import ( + MonitorInferenceLog, + MonitorInferenceLogDict, + MonitorInferenceLogParam, +) +from databricks.bundles.quality_monitors._models.monitor_inference_log_problem_type import ( + MonitorInferenceLogProblemType, + MonitorInferenceLogProblemTypeParam, +) +from databricks.bundles.quality_monitors._models.monitor_metric import ( + MonitorMetric, + MonitorMetricDict, + MonitorMetricParam, +) +from databricks.bundles.quality_monitors._models.monitor_metric_type import ( + MonitorMetricType, + MonitorMetricTypeParam, +) +from databricks.bundles.quality_monitors._models.monitor_notifications import ( + MonitorNotifications, + MonitorNotificationsDict, + MonitorNotificationsParam, +) +from databricks.bundles.quality_monitors._models.monitor_snapshot import ( + MonitorSnapshot, + MonitorSnapshotDict, + MonitorSnapshotParam, +) +from databricks.bundles.quality_monitors._models.monitor_time_series import ( + MonitorTimeSeries, + MonitorTimeSeriesDict, + MonitorTimeSeriesParam, +) +from databricks.bundles.quality_monitors._models.quality_monitor import ( + QualityMonitor, + QualityMonitorDict, + QualityMonitorParam, +) diff --git a/python/databricks/bundles/quality_monitors/_models/lifecycle.py b/python/databricks/bundles/quality_monitors/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule.py b/python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule.py new file mode 100644 index 00000000000..02a8de80077 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule.py @@ -0,0 +1,64 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.quality_monitors._models.monitor_cron_schedule_pause_status import ( + MonitorCronSchedulePauseStatus, + MonitorCronSchedulePauseStatusParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorCronSchedule: + """""" + + quartz_cron_expression: VariableOr[str] + """ + The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html). + """ + + timezone_id: VariableOr[str] + """ + The timezone id (e.g., ``PST``) in which to evaluate the quartz expression. + """ + + pause_status: VariableOrOptional[MonitorCronSchedulePauseStatus] = None + """ + Read only field that indicates whether a schedule is paused or not. + """ + + @classmethod + def from_dict(cls, value: "MonitorCronScheduleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorCronScheduleDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorCronScheduleDict(TypedDict, total=False): + """""" + + quartz_cron_expression: VariableOr[str] + """ + The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html). + """ + + timezone_id: VariableOr[str] + """ + The timezone id (e.g., ``PST``) in which to evaluate the quartz expression. + """ + + pause_status: VariableOrOptional[MonitorCronSchedulePauseStatusParam] + """ + Read only field that indicates whether a schedule is paused or not. + """ + + +MonitorCronScheduleParam = MonitorCronScheduleDict | MonitorCronSchedule diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule_pause_status.py b/python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule_pause_status.py new file mode 100644 index 00000000000..69b5dd3666b --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_cron_schedule_pause_status.py @@ -0,0 +1,20 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class MonitorCronSchedulePauseStatus(Enum): + """ + Source link: https://src.dev.databricks.com/databricks/universe/-/blob/elastic-spark-common/api/messages/schedule.proto + Monitoring workflow schedule pause status. + """ + + UNSPECIFIED = "UNSPECIFIED" + UNPAUSED = "UNPAUSED" + PAUSED = "PAUSED" + + +MonitorCronSchedulePauseStatusParam = ( + Literal["UNSPECIFIED", "UNPAUSED", "PAUSED"] | MonitorCronSchedulePauseStatus +) diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_data_classification_config.py b/python/databricks/bundles/quality_monitors/_models/monitor_data_classification_config.py new file mode 100644 index 00000000000..cda4e643683 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_data_classification_config.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorDataClassificationConfig: + """ + :meta private: [EXPERIMENTAL] + + Data classification related configuration. + """ + + enabled: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Whether to enable data classification. + """ + + @classmethod + def from_dict(cls, value: "MonitorDataClassificationConfigDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorDataClassificationConfigDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorDataClassificationConfigDict(TypedDict, total=False): + """""" + + enabled: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Whether to enable data classification. + """ + + +MonitorDataClassificationConfigParam = ( + MonitorDataClassificationConfigDict | MonitorDataClassificationConfig +) diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_destination.py b/python/databricks/bundles/quality_monitors/_models/monitor_destination.py new file mode 100644 index 00000000000..2f4f5b1d37f --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_destination.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorDestination: + """""" + + email_addresses: VariableOrList[str] = field(default_factory=list) + """ + The list of email addresses to send the notification to. A maximum of 5 email addresses is supported. + """ + + @classmethod + def from_dict(cls, value: "MonitorDestinationDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorDestinationDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorDestinationDict(TypedDict, total=False): + """""" + + email_addresses: VariableOrList[str] + """ + The list of email addresses to send the notification to. A maximum of 5 email addresses is supported. + """ + + +MonitorDestinationParam = MonitorDestinationDict | MonitorDestination diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_inference_log.py b/python/databricks/bundles/quality_monitors/_models/monitor_inference_log.py new file mode 100644 index 00000000000..24b6ea70e87 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_inference_log.py @@ -0,0 +1,108 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.quality_monitors._models.monitor_inference_log_problem_type import ( + MonitorInferenceLogProblemType, + MonitorInferenceLogProblemTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorInferenceLog: + """""" + + model_id_col: VariableOr[str] + """ + Column for the model identifier. + """ + + prediction_col: VariableOr[str] + """ + Column for the prediction. + """ + + problem_type: VariableOr[MonitorInferenceLogProblemType] + """ + Problem type the model aims to solve. + """ + + timestamp_col: VariableOr[str] + """ + Column for the timestamp. + """ + + granularities: VariableOrList[str] = field(default_factory=list) + """ + Granularities for aggregating data into time windows based on their timestamp. Valid values are 5 minutes, 30 minutes, 1 hour, 1 day, n weeks, 1 month, or 1 year. + """ + + label_col: VariableOrOptional[str] = None + """ + Column for the label. + """ + + prediction_proba_col: VariableOrOptional[str] = None + """ + Column for prediction probabilities + """ + + @classmethod + def from_dict(cls, value: "MonitorInferenceLogDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorInferenceLogDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorInferenceLogDict(TypedDict, total=False): + """""" + + model_id_col: VariableOr[str] + """ + Column for the model identifier. + """ + + prediction_col: VariableOr[str] + """ + Column for the prediction. + """ + + problem_type: VariableOr[MonitorInferenceLogProblemTypeParam] + """ + Problem type the model aims to solve. + """ + + timestamp_col: VariableOr[str] + """ + Column for the timestamp. + """ + + granularities: VariableOrList[str] + """ + Granularities for aggregating data into time windows based on their timestamp. Valid values are 5 minutes, 30 minutes, 1 hour, 1 day, n weeks, 1 month, or 1 year. + """ + + label_col: VariableOrOptional[str] + """ + Column for the label. + """ + + prediction_proba_col: VariableOrOptional[str] + """ + Column for prediction probabilities + """ + + +MonitorInferenceLogParam = MonitorInferenceLogDict | MonitorInferenceLog diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_inference_log_problem_type.py b/python/databricks/bundles/quality_monitors/_models/monitor_inference_log_problem_type.py new file mode 100644 index 00000000000..42d8569619b --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_inference_log_problem_type.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class MonitorInferenceLogProblemType(Enum): + PROBLEM_TYPE_CLASSIFICATION = "PROBLEM_TYPE_CLASSIFICATION" + PROBLEM_TYPE_REGRESSION = "PROBLEM_TYPE_REGRESSION" + + +MonitorInferenceLogProblemTypeParam = ( + Literal["PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"] + | MonitorInferenceLogProblemType +) diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_metric.py b/python/databricks/bundles/quality_monitors/_models/monitor_metric.py new file mode 100644 index 00000000000..cb7f876dae8 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_metric.py @@ -0,0 +1,100 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrList +from databricks.bundles.quality_monitors._models.monitor_metric_type import ( + MonitorMetricType, + MonitorMetricTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorMetric: + """ + Custom metric definition. + """ + + definition: VariableOr[str] + """ + Jinja template for a SQL expression that specifies how to compute the metric. See [create metric definition](https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition). + """ + + name: VariableOr[str] + """ + Name of the metric in the output tables. + """ + + output_data_type: VariableOr[str] + """ + The output type of the custom metric. + """ + + type: VariableOr[MonitorMetricType] + """ + Can only be one of ``"CUSTOM_METRIC_TYPE_AGGREGATE"``, ``"CUSTOM_METRIC_TYPE_DERIVED"``, or ``"CUSTOM_METRIC_TYPE_DRIFT"``. + The ``"CUSTOM_METRIC_TYPE_AGGREGATE"`` and ``"CUSTOM_METRIC_TYPE_DERIVED"`` metrics + are computed on a single table, whereas the ``"CUSTOM_METRIC_TYPE_DRIFT"`` compare metrics across + baseline and input table, or across the two consecutive time windows. + - CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table + - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics + - CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics + """ + + input_columns: VariableOrList[str] = field(default_factory=list) + """ + A list of column names in the input table the metric should be computed for. + Can use ``":table"`` to indicate that the metric needs information from multiple columns. + """ + + @classmethod + def from_dict(cls, value: "MonitorMetricDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorMetricDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorMetricDict(TypedDict, total=False): + """""" + + definition: VariableOr[str] + """ + Jinja template for a SQL expression that specifies how to compute the metric. See [create metric definition](https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition). + """ + + name: VariableOr[str] + """ + Name of the metric in the output tables. + """ + + output_data_type: VariableOr[str] + """ + The output type of the custom metric. + """ + + type: VariableOr[MonitorMetricTypeParam] + """ + Can only be one of ``"CUSTOM_METRIC_TYPE_AGGREGATE"``, ``"CUSTOM_METRIC_TYPE_DERIVED"``, or ``"CUSTOM_METRIC_TYPE_DRIFT"``. + The ``"CUSTOM_METRIC_TYPE_AGGREGATE"`` and ``"CUSTOM_METRIC_TYPE_DERIVED"`` metrics + are computed on a single table, whereas the ``"CUSTOM_METRIC_TYPE_DRIFT"`` compare metrics across + baseline and input table, or across the two consecutive time windows. + - CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table + - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics + - CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics + """ + + input_columns: VariableOrList[str] + """ + A list of column names in the input table the metric should be computed for. + Can use ``":table"`` to indicate that the metric needs information from multiple columns. + """ + + +MonitorMetricParam = MonitorMetricDict | MonitorMetric diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_metric_type.py b/python/databricks/bundles/quality_monitors/_models/monitor_metric_type.py new file mode 100644 index 00000000000..4c70c089a0f --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_metric_type.py @@ -0,0 +1,30 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class MonitorMetricType(Enum): + """ + Can only be one of ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"``, ``\"CUSTOM_METRIC_TYPE_DERIVED\"``, or ``\"CUSTOM_METRIC_TYPE_DRIFT\"``. + The ``\"CUSTOM_METRIC_TYPE_AGGREGATE\"`` and ``\"CUSTOM_METRIC_TYPE_DERIVED\"`` metrics + are computed on a single table, whereas the ``\"CUSTOM_METRIC_TYPE_DRIFT\"`` compare metrics across + baseline and input table, or across the two consecutive time windows. + - CUSTOM_METRIC_TYPE_AGGREGATE: only depend on the existing columns in your table + - CUSTOM_METRIC_TYPE_DERIVED: depend on previously computed aggregate metrics + - CUSTOM_METRIC_TYPE_DRIFT: depend on previously computed aggregate or derived metrics + """ + + CUSTOM_METRIC_TYPE_AGGREGATE = "CUSTOM_METRIC_TYPE_AGGREGATE" + CUSTOM_METRIC_TYPE_DERIVED = "CUSTOM_METRIC_TYPE_DERIVED" + CUSTOM_METRIC_TYPE_DRIFT = "CUSTOM_METRIC_TYPE_DRIFT" + + +MonitorMetricTypeParam = ( + Literal[ + "CUSTOM_METRIC_TYPE_AGGREGATE", + "CUSTOM_METRIC_TYPE_DERIVED", + "CUSTOM_METRIC_TYPE_DRIFT", + ] + | MonitorMetricType +) diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_notifications.py b/python/databricks/bundles/quality_monitors/_models/monitor_notifications.py new file mode 100644 index 00000000000..007b3ae64e4 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_notifications.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.quality_monitors._models.monitor_destination import ( + MonitorDestination, + MonitorDestinationParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorNotifications: + """""" + + on_failure: VariableOrOptional[MonitorDestination] = None + """ + Destinations to send notifications on failure/timeout. + """ + + on_new_classification_tag_detected: VariableOrOptional[MonitorDestination] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Destinations to send notifications on new classification tag detected. + """ + + @classmethod + def from_dict(cls, value: "MonitorNotificationsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorNotificationsDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorNotificationsDict(TypedDict, total=False): + """""" + + on_failure: VariableOrOptional[MonitorDestinationParam] + """ + Destinations to send notifications on failure/timeout. + """ + + on_new_classification_tag_detected: VariableOrOptional[MonitorDestinationParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Destinations to send notifications on new classification tag detected. + """ + + +MonitorNotificationsParam = MonitorNotificationsDict | MonitorNotifications diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_snapshot.py b/python/databricks/bundles/quality_monitors/_models/monitor_snapshot.py new file mode 100644 index 00000000000..4cc39dcb9d0 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_snapshot.py @@ -0,0 +1,31 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorSnapshot: + """ + Snapshot analysis configuration + """ + + @classmethod + def from_dict(cls, value: "MonitorSnapshotDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorSnapshotDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorSnapshotDict(TypedDict, total=False): + """""" + + +MonitorSnapshotParam = MonitorSnapshotDict | MonitorSnapshot diff --git a/python/databricks/bundles/quality_monitors/_models/monitor_time_series.py b/python/databricks/bundles/quality_monitors/_models/monitor_time_series.py new file mode 100644 index 00000000000..29f3b950a0e --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/monitor_time_series.py @@ -0,0 +1,52 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrList + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonitorTimeSeries: + """ + Time series analysis configuration. + """ + + timestamp_col: VariableOr[str] + """ + Column for the timestamp. + """ + + granularities: VariableOrList[str] = field(default_factory=list) + """ + Granularities for aggregating data into time windows based on their timestamp. Valid values are 5 minutes, 30 minutes, 1 hour, 1 day, n weeks, 1 month, or 1 year. + """ + + @classmethod + def from_dict(cls, value: "MonitorTimeSeriesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonitorTimeSeriesDict": + return _transform_to_json_value(self) # type:ignore + + +class MonitorTimeSeriesDict(TypedDict, total=False): + """""" + + timestamp_col: VariableOr[str] + """ + Column for the timestamp. + """ + + granularities: VariableOrList[str] + """ + Granularities for aggregating data into time windows based on their timestamp. Valid values are 5 minutes, 30 minutes, 1 hour, 1 day, n weeks, 1 month, or 1 year. + """ + + +MonitorTimeSeriesParam = MonitorTimeSeriesDict | MonitorTimeSeries diff --git a/python/databricks/bundles/quality_monitors/_models/quality_monitor.py b/python/databricks/bundles/quality_monitors/_models/quality_monitor.py new file mode 100644 index 00000000000..d2c22518503 --- /dev/null +++ b/python/databricks/bundles/quality_monitors/_models/quality_monitor.py @@ -0,0 +1,239 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.quality_monitors._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.quality_monitors._models.monitor_cron_schedule import ( + MonitorCronSchedule, + MonitorCronScheduleParam, +) +from databricks.bundles.quality_monitors._models.monitor_data_classification_config import ( + MonitorDataClassificationConfig, + MonitorDataClassificationConfigParam, +) +from databricks.bundles.quality_monitors._models.monitor_inference_log import ( + MonitorInferenceLog, + MonitorInferenceLogParam, +) +from databricks.bundles.quality_monitors._models.monitor_metric import ( + MonitorMetric, + MonitorMetricParam, +) +from databricks.bundles.quality_monitors._models.monitor_notifications import ( + MonitorNotifications, + MonitorNotificationsParam, +) +from databricks.bundles.quality_monitors._models.monitor_snapshot import ( + MonitorSnapshot, + MonitorSnapshotParam, +) +from databricks.bundles.quality_monitors._models.monitor_time_series import ( + MonitorTimeSeries, + MonitorTimeSeriesParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class QualityMonitor(Resource): + """""" + + assets_dir: VariableOr[str] + """ + [Create:REQ Update:IGN] Field for specifying the absolute path to a custom directory to store data-monitoring + assets. Normally prepopulated to a default user location via UI and Python APIs. + """ + + output_schema_name: VariableOr[str] + """ + [Create:REQ Update:REQ] Schema where output tables are created. Needs to be in 2-level format {catalog}.{schema} + """ + + table_name: VariableOr[str] + + baseline_table_name: VariableOrOptional[str] = None + """ + [Create:OPT Update:OPT] Baseline table name. + Baseline data is used to compute drift from the data in the monitored `table_name`. + The baseline table and the monitored table shall have the same schema. + """ + + custom_metrics: VariableOrList[MonitorMetric] = field(default_factory=list) + """ + [Create:OPT Update:OPT] Custom metrics. + """ + + data_classification_config: VariableOrOptional[MonitorDataClassificationConfig] = ( + None + ) + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] [Create:OPT Update:OPT] Data classification related config. + """ + + inference_log: VariableOrOptional[MonitorInferenceLog] = None + + latest_monitor_failure_msg: VariableOrOptional[str] = None + """ + [Create:ERR Update:IGN] The latest error message for a monitor failure. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + notifications: VariableOrOptional[MonitorNotifications] = None + """ + [Create:OPT Update:OPT] Field for specifying notification settings. + """ + + schedule: VariableOrOptional[MonitorCronSchedule] = None + """ + [Create:OPT Update:OPT] The monitor schedule. + """ + + skip_builtin_dashboard: VariableOrOptional[bool] = None + """ + Whether to skip creating a default dashboard summarizing data quality metrics. + """ + + slicing_exprs: VariableOrList[str] = field(default_factory=list) + """ + [Create:OPT Update:OPT] List of column expressions to slice data with for targeted analysis. The data is grouped by + each expression independently, resulting in a separate slice for each predicate and its + complements. For example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the following + slices: two slices for `col_2 > 10` (True and False), and one slice per unique value in + `col1`. For high-cardinality columns, only the top 100 unique values by frequency will + generate slices. + """ + + snapshot: VariableOrOptional[MonitorSnapshot] = None + """ + Configuration for monitoring snapshot tables. + """ + + time_series: VariableOrOptional[MonitorTimeSeries] = None + """ + Configuration for monitoring time series tables. + """ + + warehouse_id: VariableOrOptional[str] = None + """ + Optional argument to specify the warehouse for dashboard creation. If not specified, the first running + warehouse will be used. + """ + + @classmethod + def from_dict(cls, value: "QualityMonitorDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "QualityMonitorDict": + return _transform_to_json_value(self) # type:ignore + + +class QualityMonitorDict(TypedDict, total=False): + """""" + + assets_dir: VariableOr[str] + """ + [Create:REQ Update:IGN] Field for specifying the absolute path to a custom directory to store data-monitoring + assets. Normally prepopulated to a default user location via UI and Python APIs. + """ + + output_schema_name: VariableOr[str] + """ + [Create:REQ Update:REQ] Schema where output tables are created. Needs to be in 2-level format {catalog}.{schema} + """ + + table_name: VariableOr[str] + + baseline_table_name: VariableOrOptional[str] + """ + [Create:OPT Update:OPT] Baseline table name. + Baseline data is used to compute drift from the data in the monitored `table_name`. + The baseline table and the monitored table shall have the same schema. + """ + + custom_metrics: VariableOrList[MonitorMetricParam] + """ + [Create:OPT Update:OPT] Custom metrics. + """ + + data_classification_config: VariableOrOptional[MonitorDataClassificationConfigParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] [Create:OPT Update:OPT] Data classification related config. + """ + + inference_log: VariableOrOptional[MonitorInferenceLogParam] + + latest_monitor_failure_msg: VariableOrOptional[str] + """ + [Create:ERR Update:IGN] The latest error message for a monitor failure. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + notifications: VariableOrOptional[MonitorNotificationsParam] + """ + [Create:OPT Update:OPT] Field for specifying notification settings. + """ + + schedule: VariableOrOptional[MonitorCronScheduleParam] + """ + [Create:OPT Update:OPT] The monitor schedule. + """ + + skip_builtin_dashboard: VariableOrOptional[bool] + """ + Whether to skip creating a default dashboard summarizing data quality metrics. + """ + + slicing_exprs: VariableOrList[str] + """ + [Create:OPT Update:OPT] List of column expressions to slice data with for targeted analysis. The data is grouped by + each expression independently, resulting in a separate slice for each predicate and its + complements. For example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the following + slices: two slices for `col_2 > 10` (True and False), and one slice per unique value in + `col1`. For high-cardinality columns, only the top 100 unique values by frequency will + generate slices. + """ + + snapshot: VariableOrOptional[MonitorSnapshotParam] + """ + Configuration for monitoring snapshot tables. + """ + + time_series: VariableOrOptional[MonitorTimeSeriesParam] + """ + Configuration for monitoring time series tables. + """ + + warehouse_id: VariableOrOptional[str] + """ + Optional argument to specify the warehouse for dashboard creation. If not specified, the first running + warehouse will be used. + """ + + +QualityMonitorParam = QualityMonitorDict | QualityMonitor diff --git a/python/databricks/bundles/registered_models/__init__.py b/python/databricks/bundles/registered_models/__init__.py new file mode 100644 index 00000000000..a7ae3ba9ef3 --- /dev/null +++ b/python/databricks/bundles/registered_models/__init__.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "Privilege", + "PrivilegeAssignment", + "PrivilegeAssignmentDict", + "PrivilegeAssignmentParam", + "PrivilegeParam", + "RegisteredModel", + "RegisteredModelAlias", + "RegisteredModelAliasDict", + "RegisteredModelAliasParam", + "RegisteredModelDict", + "RegisteredModelParam", +] + + +from databricks.bundles.registered_models._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.registered_models._models.privilege import ( + Privilege, + PrivilegeParam, +) +from databricks.bundles.registered_models._models.privilege_assignment import ( + PrivilegeAssignment, + PrivilegeAssignmentDict, + PrivilegeAssignmentParam, +) +from databricks.bundles.registered_models._models.registered_model import ( + RegisteredModel, + RegisteredModelDict, + RegisteredModelParam, +) +from databricks.bundles.registered_models._models.registered_model_alias import ( + RegisteredModelAlias, + RegisteredModelAliasDict, + RegisteredModelAliasParam, +) diff --git a/python/databricks/bundles/registered_models/_models/lifecycle.py b/python/databricks/bundles/registered_models/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/registered_models/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/registered_models/_models/privilege.py b/python/databricks/bundles/registered_models/_models/privilege.py new file mode 100644 index 00000000000..21a52a2f112 --- /dev/null +++ b/python/databricks/bundles/registered_models/_models/privilege.py @@ -0,0 +1,116 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class Privilege(Enum): + SELECT = "SELECT" + READ_PRIVATE_FILES = "READ_PRIVATE_FILES" + WRITE_PRIVATE_FILES = "WRITE_PRIVATE_FILES" + CREATE = "CREATE" + USAGE = "USAGE" + USE_CATALOG = "USE_CATALOG" + USE_SCHEMA = "USE_SCHEMA" + CREATE_SCHEMA = "CREATE_SCHEMA" + CREATE_VIEW = "CREATE_VIEW" + CREATE_EXTERNAL_TABLE = "CREATE_EXTERNAL_TABLE" + CREATE_MATERIALIZED_VIEW = "CREATE_MATERIALIZED_VIEW" + CREATE_FUNCTION = "CREATE_FUNCTION" + CREATE_MODEL = "CREATE_MODEL" + CREATE_CATALOG = "CREATE_CATALOG" + CREATE_MANAGED_STORAGE = "CREATE_MANAGED_STORAGE" + CREATE_EXTERNAL_LOCATION = "CREATE_EXTERNAL_LOCATION" + CREATE_STORAGE_CREDENTIAL = "CREATE_STORAGE_CREDENTIAL" + CREATE_SERVICE_CREDENTIAL = "CREATE_SERVICE_CREDENTIAL" + ACCESS = "ACCESS" + CREATE_SHARE = "CREATE_SHARE" + CREATE_RECIPIENT = "CREATE_RECIPIENT" + CREATE_PROVIDER = "CREATE_PROVIDER" + USE_SHARE = "USE_SHARE" + USE_RECIPIENT = "USE_RECIPIENT" + USE_PROVIDER = "USE_PROVIDER" + USE_MARKETPLACE_ASSETS = "USE_MARKETPLACE_ASSETS" + SET_SHARE_PERMISSION = "SET_SHARE_PERMISSION" + MODIFY = "MODIFY" + REFRESH = "REFRESH" + EXECUTE = "EXECUTE" + READ_FILES = "READ_FILES" + WRITE_FILES = "WRITE_FILES" + CREATE_TABLE = "CREATE_TABLE" + ALL_PRIVILEGES = "ALL_PRIVILEGES" + CREATE_CONNECTION = "CREATE_CONNECTION" + USE_CONNECTION = "USE_CONNECTION" + APPLY_TAG = "APPLY_TAG" + CREATE_FOREIGN_CATALOG = "CREATE_FOREIGN_CATALOG" + CREATE_FOREIGN_SECURABLE = "CREATE_FOREIGN_SECURABLE" + MANAGE_ALLOWLIST = "MANAGE_ALLOWLIST" + CREATE_VOLUME = "CREATE_VOLUME" + CREATE_EXTERNAL_VOLUME = "CREATE_EXTERNAL_VOLUME" + READ_VOLUME = "READ_VOLUME" + WRITE_VOLUME = "WRITE_VOLUME" + MANAGE = "MANAGE" + BROWSE = "BROWSE" + CREATE_CLEAN_ROOM = "CREATE_CLEAN_ROOM" + MODIFY_CLEAN_ROOM = "MODIFY_CLEAN_ROOM" + EXECUTE_CLEAN_ROOM_TASK = "EXECUTE_CLEAN_ROOM_TASK" + EXTERNAL_USE_SCHEMA = "EXTERNAL_USE_SCHEMA" + READ_METADATA = "READ_METADATA" + + +PrivilegeParam = ( + Literal[ + "SELECT", + "READ_PRIVATE_FILES", + "WRITE_PRIVATE_FILES", + "CREATE", + "USAGE", + "USE_CATALOG", + "USE_SCHEMA", + "CREATE_SCHEMA", + "CREATE_VIEW", + "CREATE_EXTERNAL_TABLE", + "CREATE_MATERIALIZED_VIEW", + "CREATE_FUNCTION", + "CREATE_MODEL", + "CREATE_CATALOG", + "CREATE_MANAGED_STORAGE", + "CREATE_EXTERNAL_LOCATION", + "CREATE_STORAGE_CREDENTIAL", + "CREATE_SERVICE_CREDENTIAL", + "ACCESS", + "CREATE_SHARE", + "CREATE_RECIPIENT", + "CREATE_PROVIDER", + "USE_SHARE", + "USE_RECIPIENT", + "USE_PROVIDER", + "USE_MARKETPLACE_ASSETS", + "SET_SHARE_PERMISSION", + "MODIFY", + "REFRESH", + "EXECUTE", + "READ_FILES", + "WRITE_FILES", + "CREATE_TABLE", + "ALL_PRIVILEGES", + "CREATE_CONNECTION", + "USE_CONNECTION", + "APPLY_TAG", + "CREATE_FOREIGN_CATALOG", + "CREATE_FOREIGN_SECURABLE", + "MANAGE_ALLOWLIST", + "CREATE_VOLUME", + "CREATE_EXTERNAL_VOLUME", + "READ_VOLUME", + "WRITE_VOLUME", + "MANAGE", + "BROWSE", + "CREATE_CLEAN_ROOM", + "MODIFY_CLEAN_ROOM", + "EXECUTE_CLEAN_ROOM_TASK", + "EXTERNAL_USE_SCHEMA", + "READ_METADATA", + ] + | Privilege +) diff --git a/python/databricks/bundles/registered_models/_models/privilege_assignment.py b/python/databricks/bundles/registered_models/_models/privilege_assignment.py new file mode 100644 index 00000000000..10ef2d094f8 --- /dev/null +++ b/python/databricks/bundles/registered_models/_models/privilege_assignment.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.registered_models._models.privilege import ( + Privilege, + PrivilegeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PrivilegeAssignment: + """""" + + principal: VariableOrOptional[str] = None + """ + The principal (user email address or group name). + For deleted principals, `principal` is empty while `principal_id` is populated. + """ + + privileges: VariableOrList[Privilege] = field(default_factory=list) + """ + The privileges assigned to the principal. + """ + + @classmethod + def from_dict(cls, value: "PrivilegeAssignmentDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PrivilegeAssignmentDict": + return _transform_to_json_value(self) # type:ignore + + +class PrivilegeAssignmentDict(TypedDict, total=False): + """""" + + principal: VariableOrOptional[str] + """ + The principal (user email address or group name). + For deleted principals, `principal` is empty while `principal_id` is populated. + """ + + privileges: VariableOrList[PrivilegeParam] + """ + The privileges assigned to the principal. + """ + + +PrivilegeAssignmentParam = PrivilegeAssignmentDict | PrivilegeAssignment diff --git a/python/databricks/bundles/registered_models/_models/registered_model.py b/python/databricks/bundles/registered_models/_models/registered_model.py new file mode 100644 index 00000000000..08cf2ea45ae --- /dev/null +++ b/python/databricks/bundles/registered_models/_models/registered_model.py @@ -0,0 +1,193 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.registered_models._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.registered_models._models.privilege_assignment import ( + PrivilegeAssignment, + PrivilegeAssignmentParam, +) +from databricks.bundles.registered_models._models.registered_model_alias import ( + RegisteredModelAlias, + RegisteredModelAliasParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class RegisteredModel(Resource): + """""" + + aliases: VariableOrList[RegisteredModelAlias] = field(default_factory=list) + """ + List of aliases associated with the registered model + """ + + catalog_name: VariableOrOptional[str] = None + """ + The name of the catalog where the schema and the registered model reside + """ + + comment: VariableOrOptional[str] = None + """ + The comment attached to the registered model + """ + + created_at: VariableOrOptional[int] = None + """ + Creation timestamp of the registered model in milliseconds since the Unix epoch + """ + + created_by: VariableOrOptional[str] = None + """ + The identifier of the user who created the registered model + """ + + full_name: VariableOrOptional[str] = None + """ + The three-level (fully qualified) name of the registered model + """ + + grants: VariableOrList[PrivilegeAssignment] = field(default_factory=list) + """ + The Unity Catalog privileges to grant to principals on this securable. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + metastore_id: VariableOrOptional[str] = None + """ + The unique identifier of the metastore + """ + + name: VariableOrOptional[str] = None + """ + The name of the registered model + """ + + owner: VariableOrOptional[str] = None + """ + The identifier of the user who owns the registered model + """ + + schema_name: VariableOrOptional[str] = None + """ + The name of the schema where the registered model resides + """ + + storage_location: VariableOrOptional[str] = None + """ + The storage location on the cloud under which model version data files are stored + """ + + updated_at: VariableOrOptional[int] = None + """ + Last-update timestamp of the registered model in milliseconds since the Unix epoch + """ + + updated_by: VariableOrOptional[str] = None + """ + The identifier of the user who updated the registered model last time + """ + + @classmethod + def from_dict(cls, value: "RegisteredModelDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "RegisteredModelDict": + return _transform_to_json_value(self) # type:ignore + + +class RegisteredModelDict(TypedDict, total=False): + """""" + + aliases: VariableOrList[RegisteredModelAliasParam] + """ + List of aliases associated with the registered model + """ + + catalog_name: VariableOrOptional[str] + """ + The name of the catalog where the schema and the registered model reside + """ + + comment: VariableOrOptional[str] + """ + The comment attached to the registered model + """ + + created_at: VariableOrOptional[int] + """ + Creation timestamp of the registered model in milliseconds since the Unix epoch + """ + + created_by: VariableOrOptional[str] + """ + The identifier of the user who created the registered model + """ + + full_name: VariableOrOptional[str] + """ + The three-level (fully qualified) name of the registered model + """ + + grants: VariableOrList[PrivilegeAssignmentParam] + """ + The Unity Catalog privileges to grant to principals on this securable. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + metastore_id: VariableOrOptional[str] + """ + The unique identifier of the metastore + """ + + name: VariableOrOptional[str] + """ + The name of the registered model + """ + + owner: VariableOrOptional[str] + """ + The identifier of the user who owns the registered model + """ + + schema_name: VariableOrOptional[str] + """ + The name of the schema where the registered model resides + """ + + storage_location: VariableOrOptional[str] + """ + The storage location on the cloud under which model version data files are stored + """ + + updated_at: VariableOrOptional[int] + """ + Last-update timestamp of the registered model in milliseconds since the Unix epoch + """ + + updated_by: VariableOrOptional[str] + """ + The identifier of the user who updated the registered model last time + """ + + +RegisteredModelParam = RegisteredModelDict | RegisteredModel diff --git a/python/databricks/bundles/registered_models/_models/registered_model_alias.py b/python/databricks/bundles/registered_models/_models/registered_model_alias.py new file mode 100644 index 00000000000..f4ea570a9a6 --- /dev/null +++ b/python/databricks/bundles/registered_models/_models/registered_model_alias.py @@ -0,0 +1,90 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class RegisteredModelAlias: + """""" + + alias_name: VariableOrOptional[str] = None + """ + Name of the alias, e.g. 'champion' or 'latest_stable' + """ + + catalog_name: VariableOrOptional[str] = None + """ + The name of the catalog containing the model version + """ + + id: VariableOrOptional[str] = None + """ + The unique identifier of the alias + """ + + model_name: VariableOrOptional[str] = None + """ + The name of the parent registered model of the model version, relative to parent schema + """ + + schema_name: VariableOrOptional[str] = None + """ + The name of the schema containing the model version, relative to parent catalog + """ + + version_num: VariableOrOptional[int] = None + """ + Integer version number of the model version to which this alias points. + """ + + @classmethod + def from_dict(cls, value: "RegisteredModelAliasDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "RegisteredModelAliasDict": + return _transform_to_json_value(self) # type:ignore + + +class RegisteredModelAliasDict(TypedDict, total=False): + """""" + + alias_name: VariableOrOptional[str] + """ + Name of the alias, e.g. 'champion' or 'latest_stable' + """ + + catalog_name: VariableOrOptional[str] + """ + The name of the catalog containing the model version + """ + + id: VariableOrOptional[str] + """ + The unique identifier of the alias + """ + + model_name: VariableOrOptional[str] + """ + The name of the parent registered model of the model version, relative to parent schema + """ + + schema_name: VariableOrOptional[str] + """ + The name of the schema containing the model version, relative to parent catalog + """ + + version_num: VariableOrOptional[int] + """ + Integer version number of the model version to which this alias points. + """ + + +RegisteredModelAliasParam = RegisteredModelAliasDict | RegisteredModelAlias diff --git a/python/databricks/bundles/secret_scopes/__init__.py b/python/databricks/bundles/secret_scopes/__init__.py new file mode 100644 index 00000000000..1f3d9c9555d --- /dev/null +++ b/python/databricks/bundles/secret_scopes/__init__.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "AzureKeyVaultSecretScopeMetadata", + "AzureKeyVaultSecretScopeMetadataDict", + "AzureKeyVaultSecretScopeMetadataParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "ScopeBackendType", + "ScopeBackendTypeParam", + "SecretScope", + "SecretScopeDict", + "SecretScopeParam", + "SecretScopePermission", + "SecretScopePermissionDict", + "SecretScopePermissionLevel", + "SecretScopePermissionLevelParam", + "SecretScopePermissionParam", +] + + +from databricks.bundles.secret_scopes._models.azure_key_vault_secret_scope_metadata import ( + AzureKeyVaultSecretScopeMetadata, + AzureKeyVaultSecretScopeMetadataDict, + AzureKeyVaultSecretScopeMetadataParam, +) +from databricks.bundles.secret_scopes._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.secret_scopes._models.scope_backend_type import ( + ScopeBackendType, + ScopeBackendTypeParam, +) +from databricks.bundles.secret_scopes._models.secret_scope import ( + SecretScope, + SecretScopeDict, + SecretScopeParam, +) +from databricks.bundles.secret_scopes._models.secret_scope_permission import ( + SecretScopePermission, + SecretScopePermissionDict, + SecretScopePermissionParam, +) +from databricks.bundles.secret_scopes._models.secret_scope_permission_level import ( + SecretScopePermissionLevel, + SecretScopePermissionLevelParam, +) diff --git a/python/databricks/bundles/secret_scopes/_models/azure_key_vault_secret_scope_metadata.py b/python/databricks/bundles/secret_scopes/_models/azure_key_vault_secret_scope_metadata.py new file mode 100644 index 00000000000..ceedb8b2ec4 --- /dev/null +++ b/python/databricks/bundles/secret_scopes/_models/azure_key_vault_secret_scope_metadata.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class AzureKeyVaultSecretScopeMetadata: + """ + The metadata of the Azure KeyVault for a secret scope of type `AZURE_KEYVAULT` + """ + + dns_name: VariableOr[str] + """ + The DNS of the KeyVault + """ + + resource_id: VariableOr[str] + """ + The resource id of the azure KeyVault that user wants to associate the scope with. + """ + + @classmethod + def from_dict(cls, value: "AzureKeyVaultSecretScopeMetadataDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "AzureKeyVaultSecretScopeMetadataDict": + return _transform_to_json_value(self) # type:ignore + + +class AzureKeyVaultSecretScopeMetadataDict(TypedDict, total=False): + """""" + + dns_name: VariableOr[str] + """ + The DNS of the KeyVault + """ + + resource_id: VariableOr[str] + """ + The resource id of the azure KeyVault that user wants to associate the scope with. + """ + + +AzureKeyVaultSecretScopeMetadataParam = ( + AzureKeyVaultSecretScopeMetadataDict | AzureKeyVaultSecretScopeMetadata +) diff --git a/python/databricks/bundles/secret_scopes/_models/lifecycle.py b/python/databricks/bundles/secret_scopes/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/secret_scopes/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/secret_scopes/_models/scope_backend_type.py b/python/databricks/bundles/secret_scopes/_models/scope_backend_type.py new file mode 100644 index 00000000000..d95f7022d33 --- /dev/null +++ b/python/databricks/bundles/secret_scopes/_models/scope_backend_type.py @@ -0,0 +1,17 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ScopeBackendType(Enum): + """ + The types of secret scope backends in the Secret Manager. Azure KeyVault backed secret scopes + will be supported in a later release. + """ + + DATABRICKS = "DATABRICKS" + AZURE_KEYVAULT = "AZURE_KEYVAULT" + + +ScopeBackendTypeParam = Literal["DATABRICKS", "AZURE_KEYVAULT"] | ScopeBackendType diff --git a/python/databricks/bundles/secret_scopes/_models/secret_scope.py b/python/databricks/bundles/secret_scopes/_models/secret_scope.py new file mode 100644 index 00000000000..5e436f1d247 --- /dev/null +++ b/python/databricks/bundles/secret_scopes/_models/secret_scope.py @@ -0,0 +1,98 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.secret_scopes._models.azure_key_vault_secret_scope_metadata import ( + AzureKeyVaultSecretScopeMetadata, + AzureKeyVaultSecretScopeMetadataParam, +) +from databricks.bundles.secret_scopes._models.lifecycle import Lifecycle, LifecycleParam +from databricks.bundles.secret_scopes._models.scope_backend_type import ( + ScopeBackendType, + ScopeBackendTypeParam, +) +from databricks.bundles.secret_scopes._models.secret_scope_permission import ( + SecretScopePermission, + SecretScopePermissionParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SecretScope(Resource): + """""" + + name: VariableOr[str] + """ + Scope name requested by the user. Scope names are unique. + """ + + backend_type: VariableOrOptional[ScopeBackendType] = None + """ + The backend type the scope will be created with. If not specified, will default to `DATABRICKS` + """ + + keyvault_metadata: VariableOrOptional[AzureKeyVaultSecretScopeMetadata] = None + """ + The metadata for the secret scope if the `backend_type` is `AZURE_KEYVAULT` + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[SecretScopePermission] = field(default_factory=list) + """ + The permissions to apply to the secret scope. Permissions are managed via secret scope ACLs. + """ + + @classmethod + def from_dict(cls, value: "SecretScopeDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SecretScopeDict": + return _transform_to_json_value(self) # type:ignore + + +class SecretScopeDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + Scope name requested by the user. Scope names are unique. + """ + + backend_type: VariableOrOptional[ScopeBackendTypeParam] + """ + The backend type the scope will be created with. If not specified, will default to `DATABRICKS` + """ + + keyvault_metadata: VariableOrOptional[AzureKeyVaultSecretScopeMetadataParam] + """ + The metadata for the secret scope if the `backend_type` is `AZURE_KEYVAULT` + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[SecretScopePermissionParam] + """ + The permissions to apply to the secret scope. Permissions are managed via secret scope ACLs. + """ + + +SecretScopeParam = SecretScopeDict | SecretScope diff --git a/python/databricks/bundles/secret_scopes/_models/secret_scope_permission.py b/python/databricks/bundles/secret_scopes/_models/secret_scope_permission.py new file mode 100644 index 00000000000..3715039c411 --- /dev/null +++ b/python/databricks/bundles/secret_scopes/_models/secret_scope_permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.secret_scopes._models.secret_scope_permission_level import ( + SecretScopePermissionLevel, + SecretScopePermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SecretScopePermission: + """""" + + level: VariableOr[SecretScopePermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. This field translates to a `principal` field in secret scope ACL. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The application ID of an active service principal. This field translates to a `principal` field in secret scope ACL. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. This field translates to a `principal` field in secret scope ACL. + """ + + @classmethod + def from_dict(cls, value: "SecretScopePermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SecretScopePermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class SecretScopePermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[SecretScopePermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. This field translates to a `principal` field in secret scope ACL. + """ + + service_principal_name: VariableOrOptional[str] + """ + The application ID of an active service principal. This field translates to a `principal` field in secret scope ACL. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. This field translates to a `principal` field in secret scope ACL. + """ + + +SecretScopePermissionParam = SecretScopePermissionDict | SecretScopePermission diff --git a/python/databricks/bundles/secret_scopes/_models/secret_scope_permission_level.py b/python/databricks/bundles/secret_scopes/_models/secret_scope_permission_level.py new file mode 100644 index 00000000000..d7d84cd5854 --- /dev/null +++ b/python/databricks/bundles/secret_scopes/_models/secret_scope_permission_level.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SecretScopePermissionLevel(Enum): + READ = "READ" + WRITE = "WRITE" + MANAGE = "MANAGE" + + +SecretScopePermissionLevelParam = ( + Literal["READ", "WRITE", "MANAGE"] | SecretScopePermissionLevel +) diff --git a/python/databricks/bundles/sql_warehouses/__init__.py b/python/databricks/bundles/sql_warehouses/__init__.py new file mode 100644 index 00000000000..4866d2ca86e --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/__init__.py @@ -0,0 +1,78 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Channel", + "ChannelDict", + "ChannelName", + "ChannelNameParam", + "ChannelParam", + "CreateWarehouseRequestWarehouseType", + "CreateWarehouseRequestWarehouseTypeParam", + "EndpointTagPair", + "EndpointTagPairDict", + "EndpointTagPairParam", + "EndpointTags", + "EndpointTagsDict", + "EndpointTagsParam", + "LifecycleWithStarted", + "LifecycleWithStartedDict", + "LifecycleWithStartedParam", + "SpotInstancePolicy", + "SpotInstancePolicyParam", + "SqlWarehouse", + "SqlWarehouseDict", + "SqlWarehouseParam", + "SqlWarehousePermission", + "SqlWarehousePermissionDict", + "SqlWarehousePermissionParam", + "WarehousePermissionLevel", + "WarehousePermissionLevelParam", +] + + +from databricks.bundles.sql_warehouses._models.channel import ( + Channel, + ChannelDict, + ChannelParam, +) +from databricks.bundles.sql_warehouses._models.channel_name import ( + ChannelName, + ChannelNameParam, +) +from databricks.bundles.sql_warehouses._models.create_warehouse_request_warehouse_type import ( + CreateWarehouseRequestWarehouseType, + CreateWarehouseRequestWarehouseTypeParam, +) +from databricks.bundles.sql_warehouses._models.endpoint_tag_pair import ( + EndpointTagPair, + EndpointTagPairDict, + EndpointTagPairParam, +) +from databricks.bundles.sql_warehouses._models.endpoint_tags import ( + EndpointTags, + EndpointTagsDict, + EndpointTagsParam, +) +from databricks.bundles.sql_warehouses._models.lifecycle_with_started import ( + LifecycleWithStarted, + LifecycleWithStartedDict, + LifecycleWithStartedParam, +) +from databricks.bundles.sql_warehouses._models.spot_instance_policy import ( + SpotInstancePolicy, + SpotInstancePolicyParam, +) +from databricks.bundles.sql_warehouses._models.sql_warehouse import ( + SqlWarehouse, + SqlWarehouseDict, + SqlWarehouseParam, +) +from databricks.bundles.sql_warehouses._models.sql_warehouse_permission import ( + SqlWarehousePermission, + SqlWarehousePermissionDict, + SqlWarehousePermissionParam, +) +from databricks.bundles.sql_warehouses._models.warehouse_permission_level import ( + WarehousePermissionLevel, + WarehousePermissionLevelParam, +) diff --git a/python/databricks/bundles/sql_warehouses/_models/channel.py b/python/databricks/bundles/sql_warehouses/_models/channel.py new file mode 100644 index 00000000000..f5893d7273f --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/channel.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.sql_warehouses._models.channel_name import ( + ChannelName, + ChannelNameParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Channel: + """ + Configures the channel name and DBSQL version of the warehouse. CHANNEL_NAME_CUSTOM should be chosen only when `dbsql_version` is specified. + """ + + dbsql_version: VariableOrOptional[str] = None + + name: VariableOrOptional[ChannelName] = None + + @classmethod + def from_dict(cls, value: "ChannelDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ChannelDict": + return _transform_to_json_value(self) # type:ignore + + +class ChannelDict(TypedDict, total=False): + """""" + + dbsql_version: VariableOrOptional[str] + + name: VariableOrOptional[ChannelNameParam] + + +ChannelParam = ChannelDict | Channel diff --git a/python/databricks/bundles/sql_warehouses/_models/channel_name.py b/python/databricks/bundles/sql_warehouses/_models/channel_name.py new file mode 100644 index 00000000000..a47e1c890f4 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/channel_name.py @@ -0,0 +1,22 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class ChannelName(Enum): + CHANNEL_NAME_PREVIEW = "CHANNEL_NAME_PREVIEW" + CHANNEL_NAME_CURRENT = "CHANNEL_NAME_CURRENT" + CHANNEL_NAME_PREVIOUS = "CHANNEL_NAME_PREVIOUS" + CHANNEL_NAME_CUSTOM = "CHANNEL_NAME_CUSTOM" + + +ChannelNameParam = ( + Literal[ + "CHANNEL_NAME_PREVIEW", + "CHANNEL_NAME_CURRENT", + "CHANNEL_NAME_PREVIOUS", + "CHANNEL_NAME_CUSTOM", + ] + | ChannelName +) diff --git a/python/databricks/bundles/sql_warehouses/_models/create_warehouse_request_warehouse_type.py b/python/databricks/bundles/sql_warehouses/_models/create_warehouse_request_warehouse_type.py new file mode 100644 index 00000000000..d80c701b807 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/create_warehouse_request_warehouse_type.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class CreateWarehouseRequestWarehouseType(Enum): + TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED" + CLASSIC = "CLASSIC" + PRO = "PRO" + + +CreateWarehouseRequestWarehouseTypeParam = ( + Literal["TYPE_UNSPECIFIED", "CLASSIC", "PRO"] | CreateWarehouseRequestWarehouseType +) diff --git a/python/databricks/bundles/sql_warehouses/_models/endpoint_tag_pair.py b/python/databricks/bundles/sql_warehouses/_models/endpoint_tag_pair.py new file mode 100644 index 00000000000..45f4d904d1e --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/endpoint_tag_pair.py @@ -0,0 +1,38 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EndpointTagPair: + """""" + + key: VariableOrOptional[str] = None + + value: VariableOrOptional[str] = None + + @classmethod + def from_dict(cls, value: "EndpointTagPairDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EndpointTagPairDict": + return _transform_to_json_value(self) # type:ignore + + +class EndpointTagPairDict(TypedDict, total=False): + """""" + + key: VariableOrOptional[str] + + value: VariableOrOptional[str] + + +EndpointTagPairParam = EndpointTagPairDict | EndpointTagPair diff --git a/python/databricks/bundles/sql_warehouses/_models/endpoint_tags.py b/python/databricks/bundles/sql_warehouses/_models/endpoint_tags.py new file mode 100644 index 00000000000..7d70c86199d --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/endpoint_tags.py @@ -0,0 +1,38 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList +from databricks.bundles.sql_warehouses._models.endpoint_tag_pair import ( + EndpointTagPair, + EndpointTagPairParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EndpointTags: + """""" + + custom_tags: VariableOrList[EndpointTagPair] = field(default_factory=list) + + @classmethod + def from_dict(cls, value: "EndpointTagsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EndpointTagsDict": + return _transform_to_json_value(self) # type:ignore + + +class EndpointTagsDict(TypedDict, total=False): + """""" + + custom_tags: VariableOrList[EndpointTagPairParam] + + +EndpointTagsParam = EndpointTagsDict | EndpointTags diff --git a/python/databricks/bundles/sql_warehouses/_models/lifecycle_with_started.py b/python/databricks/bundles/sql_warehouses/_models/lifecycle_with_started.py new file mode 100644 index 00000000000..3ee1d2a01b3 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/lifecycle_with_started.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class LifecycleWithStarted: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + started: VariableOrOptional[bool] = None + """ + Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses in direct deployment mode. + """ + + @classmethod + def from_dict(cls, value: "LifecycleWithStartedDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleWithStartedDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleWithStartedDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + started: VariableOrOptional[bool] + """ + Lifecycle setting to deploy the resource in started mode. Only supported for apps, clusters, and sql_warehouses in direct deployment mode. + """ + + +LifecycleWithStartedParam = LifecycleWithStartedDict | LifecycleWithStarted diff --git a/python/databricks/bundles/sql_warehouses/_models/spot_instance_policy.py b/python/databricks/bundles/sql_warehouses/_models/spot_instance_policy.py new file mode 100644 index 00000000000..d44908ae895 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/spot_instance_policy.py @@ -0,0 +1,32 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SpotInstancePolicy(Enum): + """ + EndpointSpotInstancePolicy configures whether the endpoint should use spot + instances. + + The breakdown of how the EndpointSpotInstancePolicy converts to per cloud + configurations is: + + +-------+--------------------------------------+--------------------------------+ + | Cloud | COST_OPTIMIZED | RELIABILITY_OPTIMIZED | + +-------+--------------------------------------+--------------------------------+ + | AWS | On Demand Driver with Spot Executors | On Demand Driver and + Executors | | AZURE | On Demand Driver and Executors | On Demand Driver + and Executors | + +-------+--------------------------------------+--------------------------------+ + """ + + POLICY_UNSPECIFIED = "POLICY_UNSPECIFIED" + COST_OPTIMIZED = "COST_OPTIMIZED" + RELIABILITY_OPTIMIZED = "RELIABILITY_OPTIMIZED" + + +SpotInstancePolicyParam = ( + Literal["POLICY_UNSPECIFIED", "COST_OPTIMIZED", "RELIABILITY_OPTIMIZED"] + | SpotInstancePolicy +) diff --git a/python/databricks/bundles/sql_warehouses/_models/sql_warehouse.py b/python/databricks/bundles/sql_warehouses/_models/sql_warehouse.py new file mode 100644 index 00000000000..40f4e607615 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/sql_warehouse.py @@ -0,0 +1,304 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.sql_warehouses._models.channel import Channel, ChannelParam +from databricks.bundles.sql_warehouses._models.create_warehouse_request_warehouse_type import ( + CreateWarehouseRequestWarehouseType, + CreateWarehouseRequestWarehouseTypeParam, +) +from databricks.bundles.sql_warehouses._models.endpoint_tags import ( + EndpointTags, + EndpointTagsParam, +) +from databricks.bundles.sql_warehouses._models.lifecycle_with_started import ( + LifecycleWithStarted, + LifecycleWithStartedParam, +) +from databricks.bundles.sql_warehouses._models.spot_instance_policy import ( + SpotInstancePolicy, + SpotInstancePolicyParam, +) +from databricks.bundles.sql_warehouses._models.sql_warehouse_permission import ( + SqlWarehousePermission, + SqlWarehousePermissionParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SqlWarehouse(Resource): + """ + Creates a new SQL warehouse. + """ + + auto_stop_mins: VariableOrOptional[int] = None + """ + The amount of time in minutes that a SQL warehouse must be idle (i.e., no + RUNNING queries) before it is automatically stopped. + + Supported values: + - Must be == 0 or >= 10 mins + - 0 indicates no autostop. + + Defaults to 120 mins + """ + + channel: VariableOrOptional[Channel] = None + """ + Channel Details + """ + + cluster_size: VariableOrOptional[str] = None + """ + Size of the clusters allocated for this warehouse. + Increasing the size of a spark cluster allows you to run larger queries on + it. If you want to increase the number of concurrent queries, please tune + max_num_clusters. + + Supported values: + - 2X-Small + - X-Small + - Small + - Medium + - Large + - X-Large + - 2X-Large + - 3X-Large + - 4X-Large + - 5X-Large + """ + + creator_name: VariableOrOptional[str] = None + """ + warehouse creator name + """ + + enable_photon: VariableOrOptional[bool] = None + """ + Configures whether the warehouse should use Photon optimized clusters. + + Defaults to true. + """ + + enable_serverless_compute: VariableOrOptional[bool] = None + """ + Configures whether the warehouse should use serverless compute + """ + + instance_profile_arn: VariableOrOptional[str] = None + """ + [DEPRECATED] Deprecated. Instance profile used to pass IAM role to the cluster + """ + + lifecycle: VariableOrOptional[LifecycleWithStarted] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + max_num_clusters: VariableOrOptional[int] = None + """ + Maximum number of clusters that the autoscaler will create to handle + concurrent queries. + + Supported values: + - Must be >= min_num_clusters + - Must be <= 40. + + Defaults to min_clusters if unset. + """ + + min_num_clusters: VariableOrOptional[int] = None + """ + Minimum number of available clusters that will be maintained for this SQL + warehouse. Increasing this will ensure that a larger number of clusters are + always running and therefore may reduce the cold start time for new + queries. This is similar to reserved vs. revocable cores in a resource + manager. + + Supported values: + - Must be > 0 + - Must be <= min(max_num_clusters, 30) + + Defaults to 1 + """ + + name: VariableOrOptional[str] = None + """ + Logical name for the cluster. + + Supported values: + - Must be unique within an org. + - Must be less than 100 characters. + """ + + permissions: VariableOrList[SqlWarehousePermission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + spot_instance_policy: VariableOrOptional[SpotInstancePolicy] = None + """ + Configurations whether the endpoint should use spot instances. + """ + + tags: VariableOrOptional[EndpointTags] = None + """ + A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes) associated + with this SQL warehouse. + + Supported values: + - Number of tags < 45. + """ + + warehouse_type: VariableOrOptional[CreateWarehouseRequestWarehouseType] = None + """ + Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, + you must set to `PRO` and also set the field `enable_serverless_compute` to `true`. + """ + + @classmethod + def from_dict(cls, value: "SqlWarehouseDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SqlWarehouseDict": + return _transform_to_json_value(self) # type:ignore + + +class SqlWarehouseDict(TypedDict, total=False): + """""" + + auto_stop_mins: VariableOrOptional[int] + """ + The amount of time in minutes that a SQL warehouse must be idle (i.e., no + RUNNING queries) before it is automatically stopped. + + Supported values: + - Must be == 0 or >= 10 mins + - 0 indicates no autostop. + + Defaults to 120 mins + """ + + channel: VariableOrOptional[ChannelParam] + """ + Channel Details + """ + + cluster_size: VariableOrOptional[str] + """ + Size of the clusters allocated for this warehouse. + Increasing the size of a spark cluster allows you to run larger queries on + it. If you want to increase the number of concurrent queries, please tune + max_num_clusters. + + Supported values: + - 2X-Small + - X-Small + - Small + - Medium + - Large + - X-Large + - 2X-Large + - 3X-Large + - 4X-Large + - 5X-Large + """ + + creator_name: VariableOrOptional[str] + """ + warehouse creator name + """ + + enable_photon: VariableOrOptional[bool] + """ + Configures whether the warehouse should use Photon optimized clusters. + + Defaults to true. + """ + + enable_serverless_compute: VariableOrOptional[bool] + """ + Configures whether the warehouse should use serverless compute + """ + + instance_profile_arn: VariableOrOptional[str] + """ + [DEPRECATED] Deprecated. Instance profile used to pass IAM role to the cluster + """ + + lifecycle: VariableOrOptional[LifecycleWithStartedParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + max_num_clusters: VariableOrOptional[int] + """ + Maximum number of clusters that the autoscaler will create to handle + concurrent queries. + + Supported values: + - Must be >= min_num_clusters + - Must be <= 40. + + Defaults to min_clusters if unset. + """ + + min_num_clusters: VariableOrOptional[int] + """ + Minimum number of available clusters that will be maintained for this SQL + warehouse. Increasing this will ensure that a larger number of clusters are + always running and therefore may reduce the cold start time for new + queries. This is similar to reserved vs. revocable cores in a resource + manager. + + Supported values: + - Must be > 0 + - Must be <= min(max_num_clusters, 30) + + Defaults to 1 + """ + + name: VariableOrOptional[str] + """ + Logical name for the cluster. + + Supported values: + - Must be unique within an org. + - Must be less than 100 characters. + """ + + permissions: VariableOrList[SqlWarehousePermissionParam] + """ + The permissions to apply to this resource. + """ + + spot_instance_policy: VariableOrOptional[SpotInstancePolicyParam] + """ + Configurations whether the endpoint should use spot instances. + """ + + tags: VariableOrOptional[EndpointTagsParam] + """ + A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes) associated + with this SQL warehouse. + + Supported values: + - Number of tags < 45. + """ + + warehouse_type: VariableOrOptional[CreateWarehouseRequestWarehouseTypeParam] + """ + Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, + you must set to `PRO` and also set the field `enable_serverless_compute` to `true`. + """ + + +SqlWarehouseParam = SqlWarehouseDict | SqlWarehouse diff --git a/python/databricks/bundles/sql_warehouses/_models/sql_warehouse_permission.py b/python/databricks/bundles/sql_warehouses/_models/sql_warehouse_permission.py new file mode 100644 index 00000000000..2c9f284a2c0 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/sql_warehouse_permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.sql_warehouses._models.warehouse_permission_level import ( + WarehousePermissionLevel, + WarehousePermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SqlWarehousePermission: + """""" + + level: VariableOr[WarehousePermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "SqlWarehousePermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SqlWarehousePermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class SqlWarehousePermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[WarehousePermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +SqlWarehousePermissionParam = SqlWarehousePermissionDict | SqlWarehousePermission diff --git a/python/databricks/bundles/sql_warehouses/_models/warehouse_permission_level.py b/python/databricks/bundles/sql_warehouses/_models/warehouse_permission_level.py new file mode 100644 index 00000000000..5728daa0d12 --- /dev/null +++ b/python/databricks/bundles/sql_warehouses/_models/warehouse_permission_level.py @@ -0,0 +1,22 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class WarehousePermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + IS_OWNER = "IS_OWNER" + CAN_USE = "CAN_USE" + CAN_MONITOR = "CAN_MONITOR" + CAN_VIEW = "CAN_VIEW" + + +WarehousePermissionLevelParam = ( + Literal["CAN_MANAGE", "IS_OWNER", "CAN_USE", "CAN_MONITOR", "CAN_VIEW"] + | WarehousePermissionLevel +) diff --git a/python/databricks/bundles/synced_database_tables/__init__.py b/python/databricks/bundles/synced_database_tables/__init__.py new file mode 100644 index 00000000000..0b3a240e460 --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/__init__.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "NewPipelineSpec", + "NewPipelineSpecDict", + "NewPipelineSpecParam", + "SyncedDatabaseTable", + "SyncedDatabaseTableDict", + "SyncedDatabaseTableParam", + "SyncedTableSchedulingPolicy", + "SyncedTableSchedulingPolicyParam", + "SyncedTableSpec", + "SyncedTableSpecDict", + "SyncedTableSpecParam", + "SyncedTableSpecPgSpecificType", + "SyncedTableSpecPgSpecificTypeParam", + "SyncedTableSpecTypeOverride", + "SyncedTableSpecTypeOverrideDict", + "SyncedTableSpecTypeOverrideParam", +] + + +from databricks.bundles.synced_database_tables._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.synced_database_tables._models.new_pipeline_spec import ( + NewPipelineSpec, + NewPipelineSpecDict, + NewPipelineSpecParam, +) +from databricks.bundles.synced_database_tables._models.synced_database_table import ( + SyncedDatabaseTable, + SyncedDatabaseTableDict, + SyncedDatabaseTableParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_scheduling_policy import ( + SyncedTableSchedulingPolicy, + SyncedTableSchedulingPolicyParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_spec import ( + SyncedTableSpec, + SyncedTableSpecDict, + SyncedTableSpecParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_spec_pg_specific_type import ( + SyncedTableSpecPgSpecificType, + SyncedTableSpecPgSpecificTypeParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_spec_type_override import ( + SyncedTableSpecTypeOverride, + SyncedTableSpecTypeOverrideDict, + SyncedTableSpecTypeOverrideParam, +) diff --git a/python/databricks/bundles/synced_database_tables/_models/lifecycle.py b/python/databricks/bundles/synced_database_tables/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/synced_database_tables/_models/new_pipeline_spec.py b/python/databricks/bundles/synced_database_tables/_models/new_pipeline_spec.py new file mode 100644 index 00000000000..9a47da58441 --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/new_pipeline_spec.py @@ -0,0 +1,79 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class NewPipelineSpec: + """ + Custom fields that user can set for pipeline while creating SyncedDatabaseTable. + Note that other fields of pipeline are still inferred by table def internally + """ + + budget_policy_id: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] Budget policy to set on the newly created pipeline. + """ + + storage_catalog: VariableOrOptional[str] = None + """ + [Public Preview] This field needs to be specified if the destination catalog is a managed postgres catalog. + + UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be a standard catalog where the user has permissions to create Delta tables. + """ + + storage_schema: VariableOrOptional[str] = None + """ + [Public Preview] This field needs to be specified if the destination catalog is a managed postgres catalog. + + UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be in the standard catalog where the user has permissions to create Delta tables. + """ + + @classmethod + def from_dict(cls, value: "NewPipelineSpecDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "NewPipelineSpecDict": + return _transform_to_json_value(self) # type:ignore + + +class NewPipelineSpecDict(TypedDict, total=False): + """""" + + budget_policy_id: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Beta] Budget policy to set on the newly created pipeline. + """ + + storage_catalog: VariableOrOptional[str] + """ + [Public Preview] This field needs to be specified if the destination catalog is a managed postgres catalog. + + UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be a standard catalog where the user has permissions to create Delta tables. + """ + + storage_schema: VariableOrOptional[str] + """ + [Public Preview] This field needs to be specified if the destination catalog is a managed postgres catalog. + + UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be in the standard catalog where the user has permissions to create Delta tables. + """ + + +NewPipelineSpecParam = NewPipelineSpecDict | NewPipelineSpec diff --git a/python/databricks/bundles/synced_database_tables/_models/synced_database_table.py b/python/databricks/bundles/synced_database_tables/_models/synced_database_table.py new file mode 100644 index 00000000000..c98b869b76e --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/synced_database_table.py @@ -0,0 +1,113 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.synced_database_tables._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_spec import ( + SyncedTableSpec, + SyncedTableSpecParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SyncedDatabaseTable(Resource): + """""" + + name: VariableOr[str] + """ + [Public Preview] Full three-part (catalog, schema, table) name of the table. + """ + + database_instance_name: VariableOrOptional[str] = None + """ + [Public Preview] Name of the target database instance. This is required when creating synced database tables in standard catalogs. + This is optional when creating synced database tables in registered catalogs. If this field is specified + when creating synced database tables in registered catalogs, the database instance name MUST + match that of the registered catalog (or the request will be rejected). + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + logical_database_name: VariableOrOptional[str] = None + """ + [Public Preview] Target Postgres database object (logical database) name for this table. + + When creating a synced table in a registered Postgres catalog, the + target Postgres database name is inferred to be that of the registered catalog. + If this field is specified in this scenario, the Postgres database name MUST + match that of the registered catalog (or the request will be rejected). + + When creating a synced table in a standard catalog, this field is required. + In this scenario, specifying this field will allow targeting an arbitrary postgres database. + Note that this has implications for the `create_database_objects_is_missing` field in `spec`. + """ + + spec: VariableOrOptional[SyncedTableSpec] = None + """ + [Public Preview] Specification of a synced database table. + """ + + @classmethod + def from_dict(cls, value: "SyncedDatabaseTableDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SyncedDatabaseTableDict": + return _transform_to_json_value(self) # type:ignore + + +class SyncedDatabaseTableDict(TypedDict, total=False): + """""" + + name: VariableOr[str] + """ + [Public Preview] Full three-part (catalog, schema, table) name of the table. + """ + + database_instance_name: VariableOrOptional[str] + """ + [Public Preview] Name of the target database instance. This is required when creating synced database tables in standard catalogs. + This is optional when creating synced database tables in registered catalogs. If this field is specified + when creating synced database tables in registered catalogs, the database instance name MUST + match that of the registered catalog (or the request will be rejected). + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + logical_database_name: VariableOrOptional[str] + """ + [Public Preview] Target Postgres database object (logical database) name for this table. + + When creating a synced table in a registered Postgres catalog, the + target Postgres database name is inferred to be that of the registered catalog. + If this field is specified in this scenario, the Postgres database name MUST + match that of the registered catalog (or the request will be rejected). + + When creating a synced table in a standard catalog, this field is required. + In this scenario, specifying this field will allow targeting an arbitrary postgres database. + Note that this has implications for the `create_database_objects_is_missing` field in `spec`. + """ + + spec: VariableOrOptional[SyncedTableSpecParam] + """ + [Public Preview] Specification of a synced database table. + """ + + +SyncedDatabaseTableParam = SyncedDatabaseTableDict | SyncedDatabaseTable diff --git a/python/databricks/bundles/synced_database_tables/_models/synced_table_scheduling_policy.py b/python/databricks/bundles/synced_database_tables/_models/synced_table_scheduling_policy.py new file mode 100644 index 00000000000..379d61c2c17 --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/synced_table_scheduling_policy.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SyncedTableSchedulingPolicy(Enum): + CONTINUOUS = "CONTINUOUS" + TRIGGERED = "TRIGGERED" + SNAPSHOT = "SNAPSHOT" + + +SyncedTableSchedulingPolicyParam = ( + Literal["CONTINUOUS", "TRIGGERED", "SNAPSHOT"] | SyncedTableSchedulingPolicy +) diff --git a/python/databricks/bundles/synced_database_tables/_models/synced_table_spec.py b/python/databricks/bundles/synced_database_tables/_models/synced_table_spec.py new file mode 100644 index 00000000000..c6be97882ae --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/synced_table_spec.py @@ -0,0 +1,170 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.synced_database_tables._models.new_pipeline_spec import ( + NewPipelineSpec, + NewPipelineSpecParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_scheduling_policy import ( + SyncedTableSchedulingPolicy, + SyncedTableSchedulingPolicyParam, +) +from databricks.bundles.synced_database_tables._models.synced_table_spec_type_override import ( + SyncedTableSpecTypeOverride, + SyncedTableSpecTypeOverrideParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SyncedTableSpec: + """ + Specification of a synced database table. + """ + + accelerated_sync: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] When true, enables accelerated sync mode for the initial data load. + This significantly improves performance for large tables. + Requires workspace-level enablement. + """ + + create_database_objects_if_missing: VariableOrOptional[bool] = None + """ + [Public Preview] If true, the synced table's logical database and schema resources in PG + will be created if they do not already exist. + """ + + existing_pipeline_id: VariableOrOptional[str] = None + """ + [Public Preview] At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + If existing_pipeline_id is defined, the synced table will be bin packed into the existing pipeline + referenced. This avoids creating a new pipeline and allows sharing existing compute. + In this case, the scheduling_policy of this synced table must match the scheduling policy of the existing pipeline. + """ + + new_pipeline_spec: VariableOrOptional[NewPipelineSpec] = None + """ + [Public Preview] At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + If new_pipeline_spec is defined, a new pipeline is created for this synced table. The location pointed to is used + to store intermediate files (checkpoints, event logs etc). The caller must have write permissions to create Delta + tables in the specified catalog and schema. Again, note this requires write permissions, whereas the source table + only requires read permissions. + """ + + primary_key_columns: VariableOrList[str] = field(default_factory=list) + """ + [Public Preview] Primary Key columns to be used for data insert/update in the destination. + """ + + scheduling_policy: VariableOrOptional[SyncedTableSchedulingPolicy] = None + """ + [Public Preview] Scheduling policy of the underlying pipeline. + """ + + source_table_full_name: VariableOrOptional[str] = None + """ + [Public Preview] Three-part (catalog, schema, table) name of the source Delta table. + """ + + timeseries_key: VariableOrOptional[str] = None + """ + [Public Preview] Time series key to deduplicate (tie-break) rows with the same primary key. + """ + + type_overrides: VariableOrList[SyncedTableSpecTypeOverride] = field( + default_factory=list + ) + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Override the default Delta->PG type mapping for specific columns. + A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + """ + + @classmethod + def from_dict(cls, value: "SyncedTableSpecDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SyncedTableSpecDict": + return _transform_to_json_value(self) # type:ignore + + +class SyncedTableSpecDict(TypedDict, total=False): + """""" + + accelerated_sync: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] When true, enables accelerated sync mode for the initial data load. + This significantly improves performance for large tables. + Requires workspace-level enablement. + """ + + create_database_objects_if_missing: VariableOrOptional[bool] + """ + [Public Preview] If true, the synced table's logical database and schema resources in PG + will be created if they do not already exist. + """ + + existing_pipeline_id: VariableOrOptional[str] + """ + [Public Preview] At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + If existing_pipeline_id is defined, the synced table will be bin packed into the existing pipeline + referenced. This avoids creating a new pipeline and allows sharing existing compute. + In this case, the scheduling_policy of this synced table must match the scheduling policy of the existing pipeline. + """ + + new_pipeline_spec: VariableOrOptional[NewPipelineSpecParam] + """ + [Public Preview] At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + If new_pipeline_spec is defined, a new pipeline is created for this synced table. The location pointed to is used + to store intermediate files (checkpoints, event logs etc). The caller must have write permissions to create Delta + tables in the specified catalog and schema. Again, note this requires write permissions, whereas the source table + only requires read permissions. + """ + + primary_key_columns: VariableOrList[str] + """ + [Public Preview] Primary Key columns to be used for data insert/update in the destination. + """ + + scheduling_policy: VariableOrOptional[SyncedTableSchedulingPolicyParam] + """ + [Public Preview] Scheduling policy of the underlying pipeline. + """ + + source_table_full_name: VariableOrOptional[str] + """ + [Public Preview] Three-part (catalog, schema, table) name of the source Delta table. + """ + + timeseries_key: VariableOrOptional[str] + """ + [Public Preview] Time series key to deduplicate (tie-break) rows with the same primary key. + """ + + type_overrides: VariableOrList[SyncedTableSpecTypeOverrideParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Override the default Delta->PG type mapping for specific columns. + A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + """ + + +SyncedTableSpecParam = SyncedTableSpecDict | SyncedTableSpec diff --git a/python/databricks/bundles/synced_database_tables/_models/synced_table_spec_pg_specific_type.py b/python/databricks/bundles/synced_database_tables/_models/synced_table_spec_pg_specific_type.py new file mode 100644 index 00000000000..52c3b8dbe9a --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/synced_table_spec_pg_specific_type.py @@ -0,0 +1,26 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SyncedTableSpecPgSpecificType(Enum): + """ + :meta private: [EXPERIMENTAL] + + PostgreSQL-specific target types that can override the default Delta-to-PG mapping. + """ + + PG_SPECIFIC_TYPE_VECTOR = "PG_SPECIFIC_TYPE_VECTOR" + PG_SPECIFIC_TYPE_HALFVEC = "PG_SPECIFIC_TYPE_HALFVEC" + PG_SPECIFIC_TYPE_VARCHAR = "PG_SPECIFIC_TYPE_VARCHAR" + + +SyncedTableSpecPgSpecificTypeParam = ( + Literal[ + "PG_SPECIFIC_TYPE_VECTOR", + "PG_SPECIFIC_TYPE_HALFVEC", + "PG_SPECIFIC_TYPE_VARCHAR", + ] + | SyncedTableSpecPgSpecificType +) diff --git a/python/databricks/bundles/synced_database_tables/_models/synced_table_spec_type_override.py b/python/databricks/bundles/synced_database_tables/_models/synced_table_spec_type_override.py new file mode 100644 index 00000000000..5cc3fa72720 --- /dev/null +++ b/python/databricks/bundles/synced_database_tables/_models/synced_table_spec_type_override.py @@ -0,0 +1,84 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.synced_database_tables._models.synced_table_spec_pg_specific_type import ( + SyncedTableSpecPgSpecificType, + SyncedTableSpecPgSpecificTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SyncedTableSpecTypeOverride: + """ + :meta private: [EXPERIMENTAL] + + Overrides the default Delta-to-PostgreSQL type mapping for a single column. + """ + + column_name: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Name of the source column whose target PostgreSQL type should be overridden. + """ + + pg_type: VariableOr[SyncedTableSpecPgSpecificType] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] PostgreSQL-specific target type to use for the column. + """ + + size: VariableOrOptional[int] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Size parameter for the target type, for types that take one (e.g. vector + dimension, varchar length). Required when the chosen pg_type needs a size. + """ + + @classmethod + def from_dict(cls, value: "SyncedTableSpecTypeOverrideDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SyncedTableSpecTypeOverrideDict": + return _transform_to_json_value(self) # type:ignore + + +class SyncedTableSpecTypeOverrideDict(TypedDict, total=False): + """""" + + column_name: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Name of the source column whose target PostgreSQL type should be overridden. + """ + + pg_type: VariableOr[SyncedTableSpecPgSpecificTypeParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] PostgreSQL-specific target type to use for the column. + """ + + size: VariableOrOptional[int] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Size parameter for the target type, for types that take one (e.g. vector + dimension, varchar length). Required when the chosen pg_type needs a size. + """ + + +SyncedTableSpecTypeOverrideParam = ( + SyncedTableSpecTypeOverrideDict | SyncedTableSpecTypeOverride +) diff --git a/python/databricks/bundles/vector_search_endpoints/__init__.py b/python/databricks/bundles/vector_search_endpoints/__init__.py new file mode 100644 index 00000000000..aabc0081f5d --- /dev/null +++ b/python/databricks/bundles/vector_search_endpoints/__init__.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "EndpointType", + "EndpointTypeParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "VectorSearchEndpoint", + "VectorSearchEndpointDict", + "VectorSearchEndpointParam", + "VectorSearchEndpointPermission", + "VectorSearchEndpointPermissionDict", + "VectorSearchEndpointPermissionLevel", + "VectorSearchEndpointPermissionLevelParam", + "VectorSearchEndpointPermissionParam", +] + + +from databricks.bundles.vector_search_endpoints._models.endpoint_type import ( + EndpointType, + EndpointTypeParam, +) +from databricks.bundles.vector_search_endpoints._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint import ( + VectorSearchEndpoint, + VectorSearchEndpointDict, + VectorSearchEndpointParam, +) +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint_permission import ( + VectorSearchEndpointPermission, + VectorSearchEndpointPermissionDict, + VectorSearchEndpointPermissionParam, +) +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint_permission_level import ( + VectorSearchEndpointPermissionLevel, + VectorSearchEndpointPermissionLevelParam, +) diff --git a/python/databricks/bundles/vector_search_endpoints/_models/endpoint_type.py b/python/databricks/bundles/vector_search_endpoints/_models/endpoint_type.py new file mode 100644 index 00000000000..476295df34b --- /dev/null +++ b/python/databricks/bundles/vector_search_endpoints/_models/endpoint_type.py @@ -0,0 +1,16 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class EndpointType(Enum): + """ + Type of endpoint. + """ + + STORAGE_OPTIMIZED = "STORAGE_OPTIMIZED" + STANDARD = "STANDARD" + + +EndpointTypeParam = Literal["STORAGE_OPTIMIZED", "STANDARD"] | EndpointType diff --git a/python/databricks/bundles/vector_search_endpoints/_models/lifecycle.py b/python/databricks/bundles/vector_search_endpoints/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/vector_search_endpoints/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint.py b/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint.py new file mode 100644 index 00000000000..8072329f47b --- /dev/null +++ b/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint.py @@ -0,0 +1,127 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.vector_search_endpoints._models.endpoint_type import ( + EndpointType, + EndpointTypeParam, +) +from databricks.bundles.vector_search_endpoints._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint_permission import ( + VectorSearchEndpointPermission, + VectorSearchEndpointPermissionParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class VectorSearchEndpoint(Resource): + """""" + + endpoint_type: VariableOr[EndpointType] + """ + Type of endpoint + """ + + name: VariableOr[str] + """ + Name of the AI Search endpoint + """ + + budget_policy_id: VariableOrOptional[str] = None + """ + [Public Preview] The budget policy id to be applied + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[VectorSearchEndpointPermission] = field( + default_factory=list + ) + """ + The permissions to apply to this resource. + """ + + target_qps: VariableOrOptional[int] = None + """ + Target QPS for the endpoint. Mutually exclusive with num_replicas. + The actual replica count is calculated at index creation/sync time based on this value. + Best-effort target; the system does not guarantee this QPS will be achieved. + """ + + usage_policy_id: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The usage policy id to be applied once we've migrated to usage policies + """ + + @classmethod + def from_dict(cls, value: "VectorSearchEndpointDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "VectorSearchEndpointDict": + return _transform_to_json_value(self) # type:ignore + + +class VectorSearchEndpointDict(TypedDict, total=False): + """""" + + endpoint_type: VariableOr[EndpointTypeParam] + """ + Type of endpoint + """ + + name: VariableOr[str] + """ + Name of the AI Search endpoint + """ + + budget_policy_id: VariableOrOptional[str] + """ + [Public Preview] The budget policy id to be applied + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[VectorSearchEndpointPermissionParam] + """ + The permissions to apply to this resource. + """ + + target_qps: VariableOrOptional[int] + """ + Target QPS for the endpoint. Mutually exclusive with num_replicas. + The actual replica count is calculated at index creation/sync time based on this value. + Best-effort target; the system does not guarantee this QPS will be achieved. + """ + + usage_policy_id: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] The usage policy id to be applied once we've migrated to usage policies + """ + + +VectorSearchEndpointParam = VectorSearchEndpointDict | VectorSearchEndpoint diff --git a/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission.py b/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission.py new file mode 100644 index 00000000000..cfbdc1e31d6 --- /dev/null +++ b/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission.py @@ -0,0 +1,52 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint_permission_level import ( + VectorSearchEndpointPermissionLevel, + VectorSearchEndpointPermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class VectorSearchEndpointPermission: + """""" + + level: VariableOr[VectorSearchEndpointPermissionLevel] + + group_name: VariableOrOptional[str] = None + + service_principal_name: VariableOrOptional[str] = None + + user_name: VariableOrOptional[str] = None + + @classmethod + def from_dict(cls, value: "VectorSearchEndpointPermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "VectorSearchEndpointPermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class VectorSearchEndpointPermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[VectorSearchEndpointPermissionLevelParam] + + group_name: VariableOrOptional[str] + + service_principal_name: VariableOrOptional[str] + + user_name: VariableOrOptional[str] + + +VectorSearchEndpointPermissionParam = ( + VectorSearchEndpointPermissionDict | VectorSearchEndpointPermission +) diff --git a/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission_level.py b/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission_level.py new file mode 100644 index 00000000000..d2618d39126 --- /dev/null +++ b/python/databricks/bundles/vector_search_endpoints/_models/vector_search_endpoint_permission_level.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class VectorSearchEndpointPermissionLevel(Enum): + """ + Permission level + """ + + CAN_CREATE = "CAN_CREATE" + CAN_MANAGE = "CAN_MANAGE" + CAN_USE = "CAN_USE" + + +VectorSearchEndpointPermissionLevelParam = ( + Literal["CAN_CREATE", "CAN_MANAGE", "CAN_USE"] | VectorSearchEndpointPermissionLevel +) diff --git a/python/databricks/bundles/vector_search_indexes/__init__.py b/python/databricks/bundles/vector_search_indexes/__init__.py new file mode 100644 index 00000000000..8e3c88eb018 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/__init__.py @@ -0,0 +1,86 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DeltaSyncVectorIndexSpecRequest", + "DeltaSyncVectorIndexSpecRequestDict", + "DeltaSyncVectorIndexSpecRequestParam", + "DirectAccessVectorIndexSpec", + "DirectAccessVectorIndexSpecDict", + "DirectAccessVectorIndexSpecParam", + "EmbeddingSourceColumn", + "EmbeddingSourceColumnDict", + "EmbeddingSourceColumnParam", + "EmbeddingVectorColumn", + "EmbeddingVectorColumnDict", + "EmbeddingVectorColumnParam", + "IndexSubtype", + "IndexSubtypeParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "PipelineType", + "PipelineTypeParam", + "Privilege", + "PrivilegeAssignment", + "PrivilegeAssignmentDict", + "PrivilegeAssignmentParam", + "PrivilegeParam", + "VectorIndexType", + "VectorIndexTypeParam", + "VectorSearchIndex", + "VectorSearchIndexDict", + "VectorSearchIndexParam", +] + + +from databricks.bundles.vector_search_indexes._models.delta_sync_vector_index_spec_request import ( + DeltaSyncVectorIndexSpecRequest, + DeltaSyncVectorIndexSpecRequestDict, + DeltaSyncVectorIndexSpecRequestParam, +) +from databricks.bundles.vector_search_indexes._models.direct_access_vector_index_spec import ( + DirectAccessVectorIndexSpec, + DirectAccessVectorIndexSpecDict, + DirectAccessVectorIndexSpecParam, +) +from databricks.bundles.vector_search_indexes._models.embedding_source_column import ( + EmbeddingSourceColumn, + EmbeddingSourceColumnDict, + EmbeddingSourceColumnParam, +) +from databricks.bundles.vector_search_indexes._models.embedding_vector_column import ( + EmbeddingVectorColumn, + EmbeddingVectorColumnDict, + EmbeddingVectorColumnParam, +) +from databricks.bundles.vector_search_indexes._models.index_subtype import ( + IndexSubtype, + IndexSubtypeParam, +) +from databricks.bundles.vector_search_indexes._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.vector_search_indexes._models.pipeline_type import ( + PipelineType, + PipelineTypeParam, +) +from databricks.bundles.vector_search_indexes._models.privilege import ( + Privilege, + PrivilegeParam, +) +from databricks.bundles.vector_search_indexes._models.privilege_assignment import ( + PrivilegeAssignment, + PrivilegeAssignmentDict, + PrivilegeAssignmentParam, +) +from databricks.bundles.vector_search_indexes._models.vector_index_type import ( + VectorIndexType, + VectorIndexTypeParam, +) +from databricks.bundles.vector_search_indexes._models.vector_search_index import ( + VectorSearchIndex, + VectorSearchIndexDict, + VectorSearchIndexParam, +) diff --git a/python/databricks/bundles/vector_search_indexes/_models/delta_sync_vector_index_spec_request.py b/python/databricks/bundles/vector_search_indexes/_models/delta_sync_vector_index_spec_request.py new file mode 100644 index 00000000000..b7af851711b --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/delta_sync_vector_index_spec_request.py @@ -0,0 +1,132 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.vector_search_indexes._models.embedding_source_column import ( + EmbeddingSourceColumn, + EmbeddingSourceColumnParam, +) +from databricks.bundles.vector_search_indexes._models.embedding_vector_column import ( + EmbeddingVectorColumn, + EmbeddingVectorColumnParam, +) +from databricks.bundles.vector_search_indexes._models.pipeline_type import ( + PipelineType, + PipelineTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DeltaSyncVectorIndexSpecRequest: + """""" + + columns_to_index: VariableOrList[str] = field(default_factory=list) + """ + [Optional] Alias for columns_to_sync. Select the columns to include in the vector index. + If you leave this field blank, all columns from the source table are included. + The primary key column and embedding source column or embedding vector column are always included. + Only one of columns_to_sync or columns_to_index may be specified. + """ + + columns_to_sync: VariableOrList[str] = field(default_factory=list) + """ + [Optional] Select the columns to sync with the vector index. If you leave this field blank, all columns + from the source table are synced with the index. The primary key column and embedding source column or + embedding vector column are always synced. + """ + + embedding_source_columns: VariableOrList[EmbeddingSourceColumn] = field( + default_factory=list + ) + """ + The columns that contain the embedding source. + """ + + embedding_vector_columns: VariableOrList[EmbeddingVectorColumn] = field( + default_factory=list + ) + """ + The columns that contain the embedding vectors. + """ + + embedding_writeback_table: VariableOrOptional[str] = None + """ + [Optional] Name of the Delta table to sync the vector index contents and computed embeddings to. + """ + + pipeline_type: VariableOrOptional[PipelineType] = None + """ + Pipeline execution mode. + - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started. + - `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh. + """ + + source_table: VariableOrOptional[str] = None + """ + The name of the source table. + """ + + @classmethod + def from_dict(cls, value: "DeltaSyncVectorIndexSpecRequestDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DeltaSyncVectorIndexSpecRequestDict": + return _transform_to_json_value(self) # type:ignore + + +class DeltaSyncVectorIndexSpecRequestDict(TypedDict, total=False): + """""" + + columns_to_index: VariableOrList[str] + """ + [Optional] Alias for columns_to_sync. Select the columns to include in the vector index. + If you leave this field blank, all columns from the source table are included. + The primary key column and embedding source column or embedding vector column are always included. + Only one of columns_to_sync or columns_to_index may be specified. + """ + + columns_to_sync: VariableOrList[str] + """ + [Optional] Select the columns to sync with the vector index. If you leave this field blank, all columns + from the source table are synced with the index. The primary key column and embedding source column or + embedding vector column are always synced. + """ + + embedding_source_columns: VariableOrList[EmbeddingSourceColumnParam] + """ + The columns that contain the embedding source. + """ + + embedding_vector_columns: VariableOrList[EmbeddingVectorColumnParam] + """ + The columns that contain the embedding vectors. + """ + + embedding_writeback_table: VariableOrOptional[str] + """ + [Optional] Name of the Delta table to sync the vector index contents and computed embeddings to. + """ + + pipeline_type: VariableOrOptional[PipelineTypeParam] + """ + Pipeline execution mode. + - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started. + - `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh. + """ + + source_table: VariableOrOptional[str] + """ + The name of the source table. + """ + + +DeltaSyncVectorIndexSpecRequestParam = ( + DeltaSyncVectorIndexSpecRequestDict | DeltaSyncVectorIndexSpecRequest +) diff --git a/python/databricks/bundles/vector_search_indexes/_models/direct_access_vector_index_spec.py b/python/databricks/bundles/vector_search_indexes/_models/direct_access_vector_index_spec.py new file mode 100644 index 00000000000..76ef31b4b30 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/direct_access_vector_index_spec.py @@ -0,0 +1,78 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.vector_search_indexes._models.embedding_source_column import ( + EmbeddingSourceColumn, + EmbeddingSourceColumnParam, +) +from databricks.bundles.vector_search_indexes._models.embedding_vector_column import ( + EmbeddingVectorColumn, + EmbeddingVectorColumnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DirectAccessVectorIndexSpec: + """""" + + embedding_source_columns: VariableOrList[EmbeddingSourceColumn] = field( + default_factory=list + ) + """ + The columns that contain the embedding source. The format should be array[double]. + """ + + embedding_vector_columns: VariableOrList[EmbeddingVectorColumn] = field( + default_factory=list + ) + """ + The columns that contain the embedding vectors. The format should be array[double]. + """ + + schema_json: VariableOrOptional[str] = None + """ + The schema of the index in JSON format. + Supported types are `integer`, `long`, `float`, `double`, `boolean`, `string`, `date`, `timestamp`. + Supported types for vector column: `array`, `array`,`. + """ + + @classmethod + def from_dict(cls, value: "DirectAccessVectorIndexSpecDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DirectAccessVectorIndexSpecDict": + return _transform_to_json_value(self) # type:ignore + + +class DirectAccessVectorIndexSpecDict(TypedDict, total=False): + """""" + + embedding_source_columns: VariableOrList[EmbeddingSourceColumnParam] + """ + The columns that contain the embedding source. The format should be array[double]. + """ + + embedding_vector_columns: VariableOrList[EmbeddingVectorColumnParam] + """ + The columns that contain the embedding vectors. The format should be array[double]. + """ + + schema_json: VariableOrOptional[str] + """ + The schema of the index in JSON format. + Supported types are `integer`, `long`, `float`, `double`, `boolean`, `string`, `date`, `timestamp`. + Supported types for vector column: `array`, `array`,`. + """ + + +DirectAccessVectorIndexSpecParam = ( + DirectAccessVectorIndexSpecDict | DirectAccessVectorIndexSpec +) diff --git a/python/databricks/bundles/vector_search_indexes/_models/embedding_source_column.py b/python/databricks/bundles/vector_search_indexes/_models/embedding_source_column.py new file mode 100644 index 00000000000..7debdc3f104 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/embedding_source_column.py @@ -0,0 +1,60 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EmbeddingSourceColumn: + """""" + + embedding_model_endpoint_name: VariableOrOptional[str] = None + """ + Name of the embedding model endpoint, used by default for both ingestion and querying. + """ + + model_endpoint_name_for_query: VariableOrOptional[str] = None + """ + Name of the embedding model endpoint which, if specified, is used for querying (not ingestion). + """ + + name: VariableOrOptional[str] = None + """ + Name of the column + """ + + @classmethod + def from_dict(cls, value: "EmbeddingSourceColumnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EmbeddingSourceColumnDict": + return _transform_to_json_value(self) # type:ignore + + +class EmbeddingSourceColumnDict(TypedDict, total=False): + """""" + + embedding_model_endpoint_name: VariableOrOptional[str] + """ + Name of the embedding model endpoint, used by default for both ingestion and querying. + """ + + model_endpoint_name_for_query: VariableOrOptional[str] + """ + Name of the embedding model endpoint which, if specified, is used for querying (not ingestion). + """ + + name: VariableOrOptional[str] + """ + Name of the column + """ + + +EmbeddingSourceColumnParam = EmbeddingSourceColumnDict | EmbeddingSourceColumn diff --git a/python/databricks/bundles/vector_search_indexes/_models/embedding_vector_column.py b/python/databricks/bundles/vector_search_indexes/_models/embedding_vector_column.py new file mode 100644 index 00000000000..b8efd6b4f0c --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/embedding_vector_column.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EmbeddingVectorColumn: + """""" + + embedding_dimension: VariableOrOptional[int] = None + """ + Dimension of the embedding vector + """ + + name: VariableOrOptional[str] = None + """ + Name of the column + """ + + @classmethod + def from_dict(cls, value: "EmbeddingVectorColumnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EmbeddingVectorColumnDict": + return _transform_to_json_value(self) # type:ignore + + +class EmbeddingVectorColumnDict(TypedDict, total=False): + """""" + + embedding_dimension: VariableOrOptional[int] + """ + Dimension of the embedding vector + """ + + name: VariableOrOptional[str] + """ + Name of the column + """ + + +EmbeddingVectorColumnParam = EmbeddingVectorColumnDict | EmbeddingVectorColumn diff --git a/python/databricks/bundles/vector_search_indexes/_models/index_subtype.py b/python/databricks/bundles/vector_search_indexes/_models/index_subtype.py new file mode 100644 index 00000000000..5485754d1e6 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/index_subtype.py @@ -0,0 +1,20 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class IndexSubtype(Enum): + """ + The subtype of the AI Search index, determining the indexing and retrieval strategy. + - `VECTOR`: Not supported. Use `HYBRID` instead. + - `FULL_TEXT`: An index that uses full-text search without vector embeddings. + - `HYBRID`: An index that uses vector embeddings for similarity search and hybrid search. + """ + + VECTOR = "VECTOR" + FULL_TEXT = "FULL_TEXT" + HYBRID = "HYBRID" + + +IndexSubtypeParam = Literal["VECTOR", "FULL_TEXT", "HYBRID"] | IndexSubtype diff --git a/python/databricks/bundles/vector_search_indexes/_models/lifecycle.py b/python/databricks/bundles/vector_search_indexes/_models/lifecycle.py new file mode 100644 index 00000000000..697776a198e --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/lifecycle.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/vector_search_indexes/_models/pipeline_type.py b/python/databricks/bundles/vector_search_indexes/_models/pipeline_type.py new file mode 100644 index 00000000000..6821dec812e --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/pipeline_type.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class PipelineType(Enum): + """ + Pipeline execution mode. + - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started. + - `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh. + """ + + TRIGGERED = "TRIGGERED" + CONTINUOUS = "CONTINUOUS" + + +PipelineTypeParam = Literal["TRIGGERED", "CONTINUOUS"] | PipelineType diff --git a/python/databricks/bundles/vector_search_indexes/_models/privilege.py b/python/databricks/bundles/vector_search_indexes/_models/privilege.py new file mode 100644 index 00000000000..21a52a2f112 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/privilege.py @@ -0,0 +1,116 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class Privilege(Enum): + SELECT = "SELECT" + READ_PRIVATE_FILES = "READ_PRIVATE_FILES" + WRITE_PRIVATE_FILES = "WRITE_PRIVATE_FILES" + CREATE = "CREATE" + USAGE = "USAGE" + USE_CATALOG = "USE_CATALOG" + USE_SCHEMA = "USE_SCHEMA" + CREATE_SCHEMA = "CREATE_SCHEMA" + CREATE_VIEW = "CREATE_VIEW" + CREATE_EXTERNAL_TABLE = "CREATE_EXTERNAL_TABLE" + CREATE_MATERIALIZED_VIEW = "CREATE_MATERIALIZED_VIEW" + CREATE_FUNCTION = "CREATE_FUNCTION" + CREATE_MODEL = "CREATE_MODEL" + CREATE_CATALOG = "CREATE_CATALOG" + CREATE_MANAGED_STORAGE = "CREATE_MANAGED_STORAGE" + CREATE_EXTERNAL_LOCATION = "CREATE_EXTERNAL_LOCATION" + CREATE_STORAGE_CREDENTIAL = "CREATE_STORAGE_CREDENTIAL" + CREATE_SERVICE_CREDENTIAL = "CREATE_SERVICE_CREDENTIAL" + ACCESS = "ACCESS" + CREATE_SHARE = "CREATE_SHARE" + CREATE_RECIPIENT = "CREATE_RECIPIENT" + CREATE_PROVIDER = "CREATE_PROVIDER" + USE_SHARE = "USE_SHARE" + USE_RECIPIENT = "USE_RECIPIENT" + USE_PROVIDER = "USE_PROVIDER" + USE_MARKETPLACE_ASSETS = "USE_MARKETPLACE_ASSETS" + SET_SHARE_PERMISSION = "SET_SHARE_PERMISSION" + MODIFY = "MODIFY" + REFRESH = "REFRESH" + EXECUTE = "EXECUTE" + READ_FILES = "READ_FILES" + WRITE_FILES = "WRITE_FILES" + CREATE_TABLE = "CREATE_TABLE" + ALL_PRIVILEGES = "ALL_PRIVILEGES" + CREATE_CONNECTION = "CREATE_CONNECTION" + USE_CONNECTION = "USE_CONNECTION" + APPLY_TAG = "APPLY_TAG" + CREATE_FOREIGN_CATALOG = "CREATE_FOREIGN_CATALOG" + CREATE_FOREIGN_SECURABLE = "CREATE_FOREIGN_SECURABLE" + MANAGE_ALLOWLIST = "MANAGE_ALLOWLIST" + CREATE_VOLUME = "CREATE_VOLUME" + CREATE_EXTERNAL_VOLUME = "CREATE_EXTERNAL_VOLUME" + READ_VOLUME = "READ_VOLUME" + WRITE_VOLUME = "WRITE_VOLUME" + MANAGE = "MANAGE" + BROWSE = "BROWSE" + CREATE_CLEAN_ROOM = "CREATE_CLEAN_ROOM" + MODIFY_CLEAN_ROOM = "MODIFY_CLEAN_ROOM" + EXECUTE_CLEAN_ROOM_TASK = "EXECUTE_CLEAN_ROOM_TASK" + EXTERNAL_USE_SCHEMA = "EXTERNAL_USE_SCHEMA" + READ_METADATA = "READ_METADATA" + + +PrivilegeParam = ( + Literal[ + "SELECT", + "READ_PRIVATE_FILES", + "WRITE_PRIVATE_FILES", + "CREATE", + "USAGE", + "USE_CATALOG", + "USE_SCHEMA", + "CREATE_SCHEMA", + "CREATE_VIEW", + "CREATE_EXTERNAL_TABLE", + "CREATE_MATERIALIZED_VIEW", + "CREATE_FUNCTION", + "CREATE_MODEL", + "CREATE_CATALOG", + "CREATE_MANAGED_STORAGE", + "CREATE_EXTERNAL_LOCATION", + "CREATE_STORAGE_CREDENTIAL", + "CREATE_SERVICE_CREDENTIAL", + "ACCESS", + "CREATE_SHARE", + "CREATE_RECIPIENT", + "CREATE_PROVIDER", + "USE_SHARE", + "USE_RECIPIENT", + "USE_PROVIDER", + "USE_MARKETPLACE_ASSETS", + "SET_SHARE_PERMISSION", + "MODIFY", + "REFRESH", + "EXECUTE", + "READ_FILES", + "WRITE_FILES", + "CREATE_TABLE", + "ALL_PRIVILEGES", + "CREATE_CONNECTION", + "USE_CONNECTION", + "APPLY_TAG", + "CREATE_FOREIGN_CATALOG", + "CREATE_FOREIGN_SECURABLE", + "MANAGE_ALLOWLIST", + "CREATE_VOLUME", + "CREATE_EXTERNAL_VOLUME", + "READ_VOLUME", + "WRITE_VOLUME", + "MANAGE", + "BROWSE", + "CREATE_CLEAN_ROOM", + "MODIFY_CLEAN_ROOM", + "EXECUTE_CLEAN_ROOM_TASK", + "EXTERNAL_USE_SCHEMA", + "READ_METADATA", + ] + | Privilege +) diff --git a/python/databricks/bundles/vector_search_indexes/_models/privilege_assignment.py b/python/databricks/bundles/vector_search_indexes/_models/privilege_assignment.py new file mode 100644 index 00000000000..55100240cc4 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/privilege_assignment.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.vector_search_indexes._models.privilege import ( + Privilege, + PrivilegeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PrivilegeAssignment: + """""" + + principal: VariableOrOptional[str] = None + """ + The principal (user email address or group name). + For deleted principals, `principal` is empty while `principal_id` is populated. + """ + + privileges: VariableOrList[Privilege] = field(default_factory=list) + """ + The privileges assigned to the principal. + """ + + @classmethod + def from_dict(cls, value: "PrivilegeAssignmentDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PrivilegeAssignmentDict": + return _transform_to_json_value(self) # type:ignore + + +class PrivilegeAssignmentDict(TypedDict, total=False): + """""" + + principal: VariableOrOptional[str] + """ + The principal (user email address or group name). + For deleted principals, `principal` is empty while `principal_id` is populated. + """ + + privileges: VariableOrList[PrivilegeParam] + """ + The privileges assigned to the principal. + """ + + +PrivilegeAssignmentParam = PrivilegeAssignmentDict | PrivilegeAssignment diff --git a/python/databricks/bundles/vector_search_indexes/_models/vector_index_type.py b/python/databricks/bundles/vector_search_indexes/_models/vector_index_type.py new file mode 100644 index 00000000000..43b8550c8b2 --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/vector_index_type.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class VectorIndexType(Enum): + """ + There are 2 types of AI Search indexes: + - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. + - `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates. + """ + + DELTA_SYNC = "DELTA_SYNC" + DIRECT_ACCESS = "DIRECT_ACCESS" + + +VectorIndexTypeParam = Literal["DELTA_SYNC", "DIRECT_ACCESS"] | VectorIndexType diff --git a/python/databricks/bundles/vector_search_indexes/_models/vector_search_index.py b/python/databricks/bundles/vector_search_indexes/_models/vector_search_index.py new file mode 100644 index 00000000000..dba21478b1f --- /dev/null +++ b/python/databricks/bundles/vector_search_indexes/_models/vector_search_index.py @@ -0,0 +1,157 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.vector_search_indexes._models.delta_sync_vector_index_spec_request import ( + DeltaSyncVectorIndexSpecRequest, + DeltaSyncVectorIndexSpecRequestParam, +) +from databricks.bundles.vector_search_indexes._models.direct_access_vector_index_spec import ( + DirectAccessVectorIndexSpec, + DirectAccessVectorIndexSpecParam, +) +from databricks.bundles.vector_search_indexes._models.index_subtype import ( + IndexSubtype, + IndexSubtypeParam, +) +from databricks.bundles.vector_search_indexes._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.vector_search_indexes._models.privilege_assignment import ( + PrivilegeAssignment, + PrivilegeAssignmentParam, +) +from databricks.bundles.vector_search_indexes._models.vector_index_type import ( + VectorIndexType, + VectorIndexTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class VectorSearchIndex(Resource): + """""" + + endpoint_name: VariableOr[str] + """ + Name of the endpoint to be used for serving the index + """ + + index_type: VariableOr[VectorIndexType] + """ + There are 2 types of AI Search indexes: + - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. + - `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates. + """ + + name: VariableOr[str] + """ + Name of the index + """ + + primary_key: VariableOr[str] + """ + Primary key of the index + """ + + delta_sync_index_spec: VariableOrOptional[DeltaSyncVectorIndexSpecRequest] = None + """ + Specification for Delta Sync Index. Required if `index_type` is `DELTA_SYNC`. + """ + + direct_access_index_spec: VariableOrOptional[DirectAccessVectorIndexSpec] = None + """ + Specification for Direct Vector Access Index. Required if `index_type` is `DIRECT_ACCESS`. + """ + + grants: VariableOrList[PrivilegeAssignment] = field(default_factory=list) + """ + The Unity Catalog privileges to grant to principals on this securable. + """ + + index_subtype: VariableOrOptional[IndexSubtype] = None + """ + :meta private: [EXPERIMENTAL] + + [Beta] The subtype of the index. Use `HYBRID` or `FULL_TEXT`. `VECTOR` is not supported. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "VectorSearchIndexDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "VectorSearchIndexDict": + return _transform_to_json_value(self) # type:ignore + + +class VectorSearchIndexDict(TypedDict, total=False): + """""" + + endpoint_name: VariableOr[str] + """ + Name of the endpoint to be used for serving the index + """ + + index_type: VariableOr[VectorIndexTypeParam] + """ + There are 2 types of AI Search indexes: + - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and incrementally updating the index as the underlying data in the Delta Table changes. + - `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates. + """ + + name: VariableOr[str] + """ + Name of the index + """ + + primary_key: VariableOr[str] + """ + Primary key of the index + """ + + delta_sync_index_spec: VariableOrOptional[DeltaSyncVectorIndexSpecRequestParam] + """ + Specification for Delta Sync Index. Required if `index_type` is `DELTA_SYNC`. + """ + + direct_access_index_spec: VariableOrOptional[DirectAccessVectorIndexSpecParam] + """ + Specification for Direct Vector Access Index. Required if `index_type` is `DIRECT_ACCESS`. + """ + + grants: VariableOrList[PrivilegeAssignmentParam] + """ + The Unity Catalog privileges to grant to principals on this securable. + """ + + index_subtype: VariableOrOptional[IndexSubtypeParam] + """ + :meta private: [EXPERIMENTAL] + + [Beta] The subtype of the index. Use `HYBRID` or `FULL_TEXT`. `VECTOR` is not supported. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + +VectorSearchIndexParam = VectorSearchIndexDict | VectorSearchIndex diff --git a/python/databricks_tests/core/_generated/__init__.py b/python/databricks_tests/core/_generated/__init__.py index 9cf2cc18cee..7b2632a44b0 100644 --- a/python/databricks_tests/core/_generated/__init__.py +++ b/python/databricks_tests/core/_generated/__init__.py @@ -2,10 +2,27 @@ from databricks_tests.core._generated import ( alerts, + apps, catalogs, + clusters, + database_catalogs, + database_instances, + experiments, + external_locations, + instance_pools, + job_runs, jobs, + model_serving_endpoints, + models, pipelines, + quality_monitors, + registered_models, schemas, + secret_scopes, + sql_warehouses, + synced_database_tables, + vector_search_endpoints, + vector_search_indexes, volumes, ) @@ -13,9 +30,26 @@ test_cases = [ alerts._test_case(), + apps._test_case(), catalogs._test_case(), + clusters._test_case(), + database_catalogs._test_case(), + database_instances._test_case(), + experiments._test_case(), + external_locations._test_case(), + instance_pools._test_case(), + job_runs._test_case(), jobs._test_case(), + model_serving_endpoints._test_case(), + models._test_case(), pipelines._test_case(), + quality_monitors._test_case(), + registered_models._test_case(), schemas._test_case(), + secret_scopes._test_case(), + sql_warehouses._test_case(), + synced_database_tables._test_case(), + vector_search_endpoints._test_case(), + vector_search_indexes._test_case(), volumes._test_case(), ] diff --git a/python/databricks_tests/core/_generated/apps.py b/python/databricks_tests/core/_generated/apps.py new file mode 100644 index 00000000000..c16a7512893 --- /dev/null +++ b/python/databricks_tests/core/_generated/apps.py @@ -0,0 +1,48 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.apps._models.app import App +from databricks.bundles.apps._models.app_config import AppConfig +from databricks.bundles.apps._models.app_permission import AppPermission +from databricks.bundles.apps._models.app_permission_level import AppPermissionLevel +from databricks.bundles.apps._models.app_resource import AppResource +from databricks.bundles.apps._models.compute_size import ComputeSize +from databricks.bundles.apps._models.git_repository import GitRepository +from databricks.bundles.apps._models.lifecycle_with_started import LifecycleWithStarted +from databricks.bundles.apps._models.telemetry_export_destination import ( + TelemetryExportDestination, +) +from databricks.bundles.core import Resources, app_mutator +from databricks.bundles.core._generated.apps import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_app, + dict_example={ + "compute_size": "MEDIUM", + "config": {}, + "git_repository": {"provider": "provider", "url": "url"}, + "lifecycle": {}, + "name": "name", + "permissions": [{"level": "CAN_MANAGE"}], + "resources": [{"name": "name"}], + "telemetry_export_destinations": [{}], + "user_api_scopes": ["user_api_scopes"], + }, + dataclass_example=App( + compute_size=ComputeSize.MEDIUM, + config=AppConfig(), + git_repository=GitRepository(provider="provider", url="url"), + lifecycle=LifecycleWithStarted(), + name="name", + permissions=[AppPermission(level=AppPermissionLevel.CAN_MANAGE)], + resources=[AppResource(name="name")], + telemetry_export_destinations=[TelemetryExportDestination()], + user_api_scopes=["user_api_scopes"], + ), + mutator=app_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/clusters.py b/python/databricks_tests/core/_generated/clusters.py new file mode 100644 index 00000000000..d843f6c8f5d --- /dev/null +++ b/python/databricks_tests/core/_generated/clusters.py @@ -0,0 +1,82 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.clusters._models.auto_scale import AutoScale +from databricks.bundles.clusters._models.aws_attributes import AwsAttributes +from databricks.bundles.clusters._models.azure_attributes import AzureAttributes +from databricks.bundles.clusters._models.clients_types import ClientsTypes +from databricks.bundles.clusters._models.cluster import Cluster +from databricks.bundles.clusters._models.cluster_log_conf import ClusterLogConf +from databricks.bundles.clusters._models.cluster_permission import ClusterPermission +from databricks.bundles.clusters._models.cluster_permission_level import ( + ClusterPermissionLevel, +) +from databricks.bundles.clusters._models.data_security_mode import DataSecurityMode +from databricks.bundles.clusters._models.docker_image import DockerImage +from databricks.bundles.clusters._models.gcp_attributes import GcpAttributes +from databricks.bundles.clusters._models.init_script_info import InitScriptInfo +from databricks.bundles.clusters._models.kind import Kind +from databricks.bundles.clusters._models.lifecycle_with_started import ( + LifecycleWithStarted, +) +from databricks.bundles.clusters._models.node_type_flexibility import ( + NodeTypeFlexibility, +) +from databricks.bundles.clusters._models.runtime_engine import RuntimeEngine +from databricks.bundles.clusters._models.workload_type import WorkloadType +from databricks.bundles.core import Resources, cluster_mutator +from databricks.bundles.core._generated.clusters import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_cluster, + dict_example={ + "autoscale": {}, + "aws_attributes": {}, + "azure_attributes": {}, + "cluster_log_conf": {}, + "custom_tags": {"key": "value"}, + "data_security_mode": "NONE", + "docker_image": {}, + "driver_node_type_flexibility": {}, + "gcp_attributes": {}, + "init_scripts": [{}], + "kind": "CLASSIC_PREVIEW", + "lifecycle": {}, + "permissions": [{"level": "CAN_MANAGE"}], + "runtime_engine": "NULL", + "spark_conf": {"key": "value"}, + "spark_env_vars": {"key": "value"}, + "ssh_public_keys": ["ssh_public_keys"], + "worker_node_type_flexibility": {}, + "workload_type": {"clients": {}}, + }, + dataclass_example=Cluster( + autoscale=AutoScale(), + aws_attributes=AwsAttributes(), + azure_attributes=AzureAttributes(), + cluster_log_conf=ClusterLogConf(), + custom_tags={"key": "value"}, + data_security_mode=DataSecurityMode.NONE, + docker_image=DockerImage(), + driver_node_type_flexibility=NodeTypeFlexibility(), + gcp_attributes=GcpAttributes(), + init_scripts=[InitScriptInfo()], + kind=Kind.CLASSIC_PREVIEW, + lifecycle=LifecycleWithStarted(), + permissions=[ + ClusterPermission(level=ClusterPermissionLevel.CAN_MANAGE) + ], + runtime_engine=RuntimeEngine.NULL, + spark_conf={"key": "value"}, + spark_env_vars={"key": "value"}, + ssh_public_keys=["ssh_public_keys"], + worker_node_type_flexibility=NodeTypeFlexibility(), + workload_type=WorkloadType(clients=ClientsTypes()), + ), + mutator=cluster_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/database_catalogs.py b/python/databricks_tests/core/_generated/database_catalogs.py new file mode 100644 index 00000000000..0d774e87268 --- /dev/null +++ b/python/databricks_tests/core/_generated/database_catalogs.py @@ -0,0 +1,31 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, database_catalog_mutator +from databricks.bundles.core._generated.database_catalogs import _resource_type +from databricks.bundles.database_catalogs._models.database_catalog import ( + DatabaseCatalog, +) +from databricks.bundles.database_catalogs._models.lifecycle import Lifecycle +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_database_catalog, + dict_example={ + "database_instance_name": "database_instance_name", + "database_name": "database_name", + "lifecycle": {}, + "name": "name", + }, + dataclass_example=DatabaseCatalog( + database_instance_name="database_instance_name", + database_name="database_name", + lifecycle=Lifecycle(), + name="name", + ), + mutator=database_catalog_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/database_instances.py b/python/databricks_tests/core/_generated/database_instances.py new file mode 100644 index 00000000000..62a5c1c8f21 --- /dev/null +++ b/python/databricks_tests/core/_generated/database_instances.py @@ -0,0 +1,38 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, database_instance_mutator +from databricks.bundles.core._generated.database_instances import _resource_type +from databricks.bundles.database_instances._models.database_instance import ( + DatabaseInstance, +) +from databricks.bundles.database_instances._models.database_instance_ref import ( + DatabaseInstanceRef, +) +from databricks.bundles.database_instances._models.lifecycle import Lifecycle +from databricks.bundles.database_instances._models.permission import Permission +from databricks.bundles.database_instances._models.permission_level import ( + PermissionLevel, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_database_instance, + dict_example={ + "lifecycle": {}, + "name": "name", + "parent_instance_ref": {}, + "permissions": [{"level": "CAN_MANAGE"}], + }, + dataclass_example=DatabaseInstance( + lifecycle=Lifecycle(), + name="name", + parent_instance_ref=DatabaseInstanceRef(), + permissions=[Permission(level=PermissionLevel.CAN_MANAGE)], + ), + mutator=database_instance_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/experiments.py b/python/databricks_tests/core/_generated/experiments.py new file mode 100644 index 00000000000..8a95f46dc28 --- /dev/null +++ b/python/databricks_tests/core/_generated/experiments.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, mlflow_experiment_mutator +from databricks.bundles.core._generated.experiments import _resource_type +from databricks.bundles.experiments._models.experiment_permission_level import ( + ExperimentPermissionLevel, +) +from databricks.bundles.experiments._models.experiment_tag import ExperimentTag +from databricks.bundles.experiments._models.lifecycle import Lifecycle +from databricks.bundles.experiments._models.mlflow_experiment import MlflowExperiment +from databricks.bundles.experiments._models.mlflow_experiment_permission import ( + MlflowExperimentPermission, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_mlflow_experiment, + dict_example={ + "lifecycle": {}, + "name": "name", + "permissions": [{"level": "CAN_MANAGE"}], + "tags": [{}], + }, + dataclass_example=MlflowExperiment( + lifecycle=Lifecycle(), + name="name", + permissions=[ + MlflowExperimentPermission( + level=ExperimentPermissionLevel.CAN_MANAGE + ) + ], + tags=[ExperimentTag()], + ), + mutator=mlflow_experiment_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/external_locations.py b/python/databricks_tests/core/_generated/external_locations.py new file mode 100644 index 00000000000..9891fe648f6 --- /dev/null +++ b/python/databricks_tests/core/_generated/external_locations.py @@ -0,0 +1,46 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, external_location_mutator +from databricks.bundles.core._generated.external_locations import _resource_type +from databricks.bundles.external_locations._models.encryption_details import ( + EncryptionDetails, +) +from databricks.bundles.external_locations._models.external_location import ( + ExternalLocation, +) +from databricks.bundles.external_locations._models.file_event_queue import ( + FileEventQueue, +) +from databricks.bundles.external_locations._models.lifecycle import Lifecycle +from databricks.bundles.external_locations._models.privilege_assignment import ( + PrivilegeAssignment, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_external_location, + dict_example={ + "credential_name": "credential_name", + "encryption_details": {}, + "file_event_queue": {}, + "grants": [{}], + "lifecycle": {}, + "name": "name", + "url": "url", + }, + dataclass_example=ExternalLocation( + credential_name="credential_name", + encryption_details=EncryptionDetails(), + file_event_queue=FileEventQueue(), + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + url="url", + ), + mutator=external_location_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/instance_pools.py b/python/databricks_tests/core/_generated/instance_pools.py new file mode 100644 index 00000000000..e5328d96ad8 --- /dev/null +++ b/python/databricks_tests/core/_generated/instance_pools.py @@ -0,0 +1,67 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, instance_pool_mutator +from databricks.bundles.core._generated.instance_pools import _resource_type +from databricks.bundles.instance_pools._models.disk_spec import DiskSpec +from databricks.bundles.instance_pools._models.docker_image import DockerImage +from databricks.bundles.instance_pools._models.instance_pool import InstancePool +from databricks.bundles.instance_pools._models.instance_pool_aws_attributes import ( + InstancePoolAwsAttributes, +) +from databricks.bundles.instance_pools._models.instance_pool_azure_attributes import ( + InstancePoolAzureAttributes, +) +from databricks.bundles.instance_pools._models.instance_pool_gcp_attributes import ( + InstancePoolGcpAttributes, +) +from databricks.bundles.instance_pools._models.instance_pool_permission import ( + InstancePoolPermission, +) +from databricks.bundles.instance_pools._models.instance_pool_permission_level import ( + InstancePoolPermissionLevel, +) +from databricks.bundles.instance_pools._models.lifecycle import Lifecycle +from databricks.bundles.instance_pools._models.node_type_flexibility import ( + NodeTypeFlexibility, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_instance_pool, + dict_example={ + "aws_attributes": {}, + "azure_attributes": {}, + "custom_tags": {"key": "value"}, + "disk_spec": {}, + "gcp_attributes": {}, + "instance_pool_name": "instance_pool_name", + "lifecycle": {}, + "node_type_flexibility": {}, + "node_type_id": "node_type_id", + "permissions": [{"level": "CAN_MANAGE"}], + "preloaded_docker_images": [{}], + "preloaded_spark_versions": ["preloaded_spark_versions"], + }, + dataclass_example=InstancePool( + aws_attributes=InstancePoolAwsAttributes(), + azure_attributes=InstancePoolAzureAttributes(), + custom_tags={"key": "value"}, + disk_spec=DiskSpec(), + gcp_attributes=InstancePoolGcpAttributes(), + instance_pool_name="instance_pool_name", + lifecycle=Lifecycle(), + node_type_flexibility=NodeTypeFlexibility(), + node_type_id="node_type_id", + permissions=[ + InstancePoolPermission(level=InstancePoolPermissionLevel.CAN_MANAGE) + ], + preloaded_docker_images=[DockerImage()], + preloaded_spark_versions=["preloaded_spark_versions"], + ), + mutator=instance_pool_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/job_runs.py b/python/databricks_tests/core/_generated/job_runs.py new file mode 100644 index 00000000000..e575d69b963 --- /dev/null +++ b/python/databricks_tests/core/_generated/job_runs.py @@ -0,0 +1,38 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, job_run_mutator +from databricks.bundles.core._generated.job_runs import _resource_type +from databricks.bundles.job_runs._models.job_run import JobRun +from databricks.bundles.job_runs._models.job_run_lifecycle import JobRunLifecycle +from databricks.bundles.job_runs._models.performance_target import PerformanceTarget +from databricks.bundles.job_runs._models.pipeline_params import PipelineParams +from databricks.bundles.job_runs._models.queue_settings import QueueSettings +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_job_run, + dict_example={ + "job_id": 0, + "job_parameters": {"key": "value"}, + "lifecycle": {}, + "only": ["only"], + "performance_target": "PERFORMANCE_OPTIMIZED", + "pipeline_params": {}, + "queue": {"enabled": True}, + }, + dataclass_example=JobRun( + job_id=0, + job_parameters={"key": "value"}, + lifecycle=JobRunLifecycle(), + only=["only"], + performance_target=PerformanceTarget.PERFORMANCE_OPTIMIZED, + pipeline_params=PipelineParams(), + queue=QueueSettings(enabled=True), + ), + mutator=job_run_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/model_serving_endpoints.py b/python/databricks_tests/core/_generated/model_serving_endpoints.py new file mode 100644 index 00000000000..1e21d8bde7a --- /dev/null +++ b/python/databricks_tests/core/_generated/model_serving_endpoints.py @@ -0,0 +1,62 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, model_serving_endpoint_mutator +from databricks.bundles.core._generated.model_serving_endpoints import _resource_type +from databricks.bundles.model_serving_endpoints._models.ai_gateway_config import ( + AiGatewayConfig, +) +from databricks.bundles.model_serving_endpoints._models.email_notifications import ( + EmailNotifications, +) +from databricks.bundles.model_serving_endpoints._models.endpoint_core_config_input import ( + EndpointCoreConfigInput, +) +from databricks.bundles.model_serving_endpoints._models.endpoint_tag import EndpointTag +from databricks.bundles.model_serving_endpoints._models.lifecycle import Lifecycle +from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint import ( + ModelServingEndpoint, +) +from databricks.bundles.model_serving_endpoints._models.model_serving_endpoint_permission import ( + ModelServingEndpointPermission, +) +from databricks.bundles.model_serving_endpoints._models.serving_endpoint_permission_level import ( + ServingEndpointPermissionLevel, +) +from databricks.bundles.model_serving_endpoints._models.telemetry_config import ( + TelemetryConfig, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_model_serving_endpoint, + dict_example={ + "ai_gateway": {}, + "config": {}, + "email_notifications": {}, + "lifecycle": {}, + "name": "name", + "permissions": [{"level": "CAN_MANAGE"}], + "tags": [{"key": "key"}], + "telemetry_config": {}, + }, + dataclass_example=ModelServingEndpoint( + ai_gateway=AiGatewayConfig(), + config=EndpointCoreConfigInput(), + email_notifications=EmailNotifications(), + lifecycle=Lifecycle(), + name="name", + permissions=[ + ModelServingEndpointPermission( + level=ServingEndpointPermissionLevel.CAN_MANAGE + ) + ], + tags=[EndpointTag(key="key")], + telemetry_config=TelemetryConfig(), + ), + mutator=model_serving_endpoint_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/models.py b/python/databricks_tests/core/_generated/models.py new file mode 100644 index 00000000000..f5a90c5604f --- /dev/null +++ b/python/databricks_tests/core/_generated/models.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, mlflow_model_mutator +from databricks.bundles.core._generated.models import _resource_type +from databricks.bundles.models._models.lifecycle import Lifecycle +from databricks.bundles.models._models.mlflow_model import MlflowModel +from databricks.bundles.models._models.mlflow_model_permission import ( + MlflowModelPermission, +) +from databricks.bundles.models._models.model_tag import ModelTag +from databricks.bundles.models._models.registered_model_permission_level import ( + RegisteredModelPermissionLevel, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_mlflow_model, + dict_example={ + "lifecycle": {}, + "name": "name", + "permissions": [{"level": "CAN_MANAGE"}], + "tags": [{}], + }, + dataclass_example=MlflowModel( + lifecycle=Lifecycle(), + name="name", + permissions=[ + MlflowModelPermission( + level=RegisteredModelPermissionLevel.CAN_MANAGE + ) + ], + tags=[ModelTag()], + ), + mutator=mlflow_model_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/quality_monitors.py b/python/databricks_tests/core/_generated/quality_monitors.py new file mode 100644 index 00000000000..e0688dedaed --- /dev/null +++ b/python/databricks_tests/core/_generated/quality_monitors.py @@ -0,0 +1,102 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, quality_monitor_mutator +from databricks.bundles.core._generated.quality_monitors import _resource_type +from databricks.bundles.quality_monitors._models.lifecycle import Lifecycle +from databricks.bundles.quality_monitors._models.monitor_cron_schedule import ( + MonitorCronSchedule, +) +from databricks.bundles.quality_monitors._models.monitor_inference_log import ( + MonitorInferenceLog, +) +from databricks.bundles.quality_monitors._models.monitor_inference_log_problem_type import ( + MonitorInferenceLogProblemType, +) +from databricks.bundles.quality_monitors._models.monitor_metric import MonitorMetric +from databricks.bundles.quality_monitors._models.monitor_metric_type import ( + MonitorMetricType, +) +from databricks.bundles.quality_monitors._models.monitor_notifications import ( + MonitorNotifications, +) +from databricks.bundles.quality_monitors._models.monitor_snapshot import MonitorSnapshot +from databricks.bundles.quality_monitors._models.monitor_time_series import ( + MonitorTimeSeries, +) +from databricks.bundles.quality_monitors._models.quality_monitor import QualityMonitor +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_quality_monitor, + dict_example={ + "assets_dir": "assets_dir", + "custom_metrics": [ + { + "definition": "definition", + "input_columns": ["input_columns"], + "name": "name", + "output_data_type": "output_data_type", + "type": "CUSTOM_METRIC_TYPE_AGGREGATE", + } + ], + "inference_log": { + "granularities": ["granularities"], + "model_id_col": "model_id_col", + "prediction_col": "prediction_col", + "problem_type": "PROBLEM_TYPE_CLASSIFICATION", + "timestamp_col": "timestamp_col", + }, + "lifecycle": {}, + "notifications": {}, + "output_schema_name": "output_schema_name", + "schedule": { + "quartz_cron_expression": "quartz_cron_expression", + "timezone_id": "timezone_id", + }, + "slicing_exprs": ["slicing_exprs"], + "snapshot": {}, + "table_name": "table_name", + "time_series": { + "granularities": ["granularities"], + "timestamp_col": "timestamp_col", + }, + }, + dataclass_example=QualityMonitor( + assets_dir="assets_dir", + custom_metrics=[ + MonitorMetric( + definition="definition", + input_columns=["input_columns"], + name="name", + output_data_type="output_data_type", + type=MonitorMetricType.CUSTOM_METRIC_TYPE_AGGREGATE, + ) + ], + inference_log=MonitorInferenceLog( + granularities=["granularities"], + model_id_col="model_id_col", + prediction_col="prediction_col", + problem_type=MonitorInferenceLogProblemType.PROBLEM_TYPE_CLASSIFICATION, + timestamp_col="timestamp_col", + ), + lifecycle=Lifecycle(), + notifications=MonitorNotifications(), + output_schema_name="output_schema_name", + schedule=MonitorCronSchedule( + quartz_cron_expression="quartz_cron_expression", + timezone_id="timezone_id", + ), + slicing_exprs=["slicing_exprs"], + snapshot=MonitorSnapshot(), + table_name="table_name", + time_series=MonitorTimeSeries( + granularities=["granularities"], timestamp_col="timestamp_col" + ), + ), + mutator=quality_monitor_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/registered_models.py b/python/databricks_tests/core/_generated/registered_models.py new file mode 100644 index 00000000000..07a59c43f84 --- /dev/null +++ b/python/databricks_tests/core/_generated/registered_models.py @@ -0,0 +1,31 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, registered_model_mutator +from databricks.bundles.core._generated.registered_models import _resource_type +from databricks.bundles.registered_models._models.lifecycle import Lifecycle +from databricks.bundles.registered_models._models.privilege_assignment import ( + PrivilegeAssignment, +) +from databricks.bundles.registered_models._models.registered_model import ( + RegisteredModel, +) +from databricks.bundles.registered_models._models.registered_model_alias import ( + RegisteredModelAlias, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_registered_model, + dict_example={"aliases": [{}], "grants": [{}], "lifecycle": {}}, + dataclass_example=RegisteredModel( + aliases=[RegisteredModelAlias()], + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + ), + mutator=registered_model_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/secret_scopes.py b/python/databricks_tests/core/_generated/secret_scopes.py new file mode 100644 index 00000000000..eb299900bcf --- /dev/null +++ b/python/databricks_tests/core/_generated/secret_scopes.py @@ -0,0 +1,48 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, secret_scope_mutator +from databricks.bundles.core._generated.secret_scopes import _resource_type +from databricks.bundles.secret_scopes._models.azure_key_vault_secret_scope_metadata import ( + AzureKeyVaultSecretScopeMetadata, +) +from databricks.bundles.secret_scopes._models.lifecycle import Lifecycle +from databricks.bundles.secret_scopes._models.scope_backend_type import ScopeBackendType +from databricks.bundles.secret_scopes._models.secret_scope import SecretScope +from databricks.bundles.secret_scopes._models.secret_scope_permission import ( + SecretScopePermission, +) +from databricks.bundles.secret_scopes._models.secret_scope_permission_level import ( + SecretScopePermissionLevel, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_secret_scope, + dict_example={ + "backend_type": "DATABRICKS", + "keyvault_metadata": { + "dns_name": "dns_name", + "resource_id": "resource_id", + }, + "lifecycle": {}, + "name": "name", + "permissions": [{"level": "READ"}], + }, + dataclass_example=SecretScope( + backend_type=ScopeBackendType.DATABRICKS, + keyvault_metadata=AzureKeyVaultSecretScopeMetadata( + dns_name="dns_name", resource_id="resource_id" + ), + lifecycle=Lifecycle(), + name="name", + permissions=[ + SecretScopePermission(level=SecretScopePermissionLevel.READ) + ], + ), + mutator=secret_scope_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/sql_warehouses.py b/python/databricks_tests/core/_generated/sql_warehouses.py new file mode 100644 index 00000000000..42556c6d3c7 --- /dev/null +++ b/python/databricks_tests/core/_generated/sql_warehouses.py @@ -0,0 +1,51 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, sql_warehouse_mutator +from databricks.bundles.core._generated.sql_warehouses import _resource_type +from databricks.bundles.sql_warehouses._models.channel import Channel +from databricks.bundles.sql_warehouses._models.create_warehouse_request_warehouse_type import ( + CreateWarehouseRequestWarehouseType, +) +from databricks.bundles.sql_warehouses._models.endpoint_tags import EndpointTags +from databricks.bundles.sql_warehouses._models.lifecycle_with_started import ( + LifecycleWithStarted, +) +from databricks.bundles.sql_warehouses._models.spot_instance_policy import ( + SpotInstancePolicy, +) +from databricks.bundles.sql_warehouses._models.sql_warehouse import SqlWarehouse +from databricks.bundles.sql_warehouses._models.sql_warehouse_permission import ( + SqlWarehousePermission, +) +from databricks.bundles.sql_warehouses._models.warehouse_permission_level import ( + WarehousePermissionLevel, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_sql_warehouse, + dict_example={ + "channel": {}, + "lifecycle": {}, + "permissions": [{"level": "CAN_MANAGE"}], + "spot_instance_policy": "POLICY_UNSPECIFIED", + "tags": {}, + "warehouse_type": "TYPE_UNSPECIFIED", + }, + dataclass_example=SqlWarehouse( + channel=Channel(), + lifecycle=LifecycleWithStarted(), + permissions=[ + SqlWarehousePermission(level=WarehousePermissionLevel.CAN_MANAGE) + ], + spot_instance_policy=SpotInstancePolicy.POLICY_UNSPECIFIED, + tags=EndpointTags(), + warehouse_type=CreateWarehouseRequestWarehouseType.TYPE_UNSPECIFIED, + ), + mutator=sql_warehouse_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/synced_database_tables.py b/python/databricks_tests/core/_generated/synced_database_tables.py new file mode 100644 index 00000000000..e1effc640a8 --- /dev/null +++ b/python/databricks_tests/core/_generated/synced_database_tables.py @@ -0,0 +1,26 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, synced_database_table_mutator +from databricks.bundles.core._generated.synced_database_tables import _resource_type +from databricks.bundles.synced_database_tables._models.lifecycle import Lifecycle +from databricks.bundles.synced_database_tables._models.synced_database_table import ( + SyncedDatabaseTable, +) +from databricks.bundles.synced_database_tables._models.synced_table_spec import ( + SyncedTableSpec, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_synced_database_table, + dict_example={"lifecycle": {}, "name": "name", "spec": {}}, + dataclass_example=SyncedDatabaseTable( + lifecycle=Lifecycle(), name="name", spec=SyncedTableSpec() + ), + mutator=synced_database_table_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/vector_search_endpoints.py b/python/databricks_tests/core/_generated/vector_search_endpoints.py new file mode 100644 index 00000000000..b01089ed806 --- /dev/null +++ b/python/databricks_tests/core/_generated/vector_search_endpoints.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, vector_search_endpoint_mutator +from databricks.bundles.core._generated.vector_search_endpoints import _resource_type +from databricks.bundles.vector_search_endpoints._models.endpoint_type import ( + EndpointType, +) +from databricks.bundles.vector_search_endpoints._models.lifecycle import Lifecycle +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint import ( + VectorSearchEndpoint, +) +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint_permission import ( + VectorSearchEndpointPermission, +) +from databricks.bundles.vector_search_endpoints._models.vector_search_endpoint_permission_level import ( + VectorSearchEndpointPermissionLevel, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_vector_search_endpoint, + dict_example={ + "endpoint_type": "STORAGE_OPTIMIZED", + "lifecycle": {}, + "name": "name", + "permissions": [{"level": "CAN_CREATE"}], + }, + dataclass_example=VectorSearchEndpoint( + endpoint_type=EndpointType.STORAGE_OPTIMIZED, + lifecycle=Lifecycle(), + name="name", + permissions=[ + VectorSearchEndpointPermission( + level=VectorSearchEndpointPermissionLevel.CAN_CREATE + ) + ], + ), + mutator=vector_search_endpoint_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/vector_search_indexes.py b/python/databricks_tests/core/_generated/vector_search_indexes.py new file mode 100644 index 00000000000..677cf14303d --- /dev/null +++ b/python/databricks_tests/core/_generated/vector_search_indexes.py @@ -0,0 +1,51 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, vector_search_index_mutator +from databricks.bundles.core._generated.vector_search_indexes import _resource_type +from databricks.bundles.vector_search_indexes._models.delta_sync_vector_index_spec_request import ( + DeltaSyncVectorIndexSpecRequest, +) +from databricks.bundles.vector_search_indexes._models.direct_access_vector_index_spec import ( + DirectAccessVectorIndexSpec, +) +from databricks.bundles.vector_search_indexes._models.lifecycle import Lifecycle +from databricks.bundles.vector_search_indexes._models.privilege_assignment import ( + PrivilegeAssignment, +) +from databricks.bundles.vector_search_indexes._models.vector_index_type import ( + VectorIndexType, +) +from databricks.bundles.vector_search_indexes._models.vector_search_index import ( + VectorSearchIndex, +) +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_vector_search_index, + dict_example={ + "delta_sync_index_spec": {}, + "direct_access_index_spec": {}, + "endpoint_name": "endpoint_name", + "grants": [{}], + "index_type": "DELTA_SYNC", + "lifecycle": {}, + "name": "name", + "primary_key": "primary_key", + }, + dataclass_example=VectorSearchIndex( + delta_sync_index_spec=DeltaSyncVectorIndexSpecRequest(), + direct_access_index_spec=DirectAccessVectorIndexSpec(), + endpoint_name="endpoint_name", + grants=[PrivilegeAssignment()], + index_type=VectorIndexType.DELTA_SYNC, + lifecycle=Lifecycle(), + name="name", + primary_key="primary_key", + ), + mutator=vector_search_index_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/public_api.txt b/python/databricks_tests/core/public_api.txt index 222665796df..679ec523a9f 100644 --- a/python/databricks_tests/core/public_api.txt +++ b/python/databricks_tests/core/public_api.txt @@ -14,15 +14,32 @@ __all__ = [ VariableOrList, VariableOrOptional, alert_mutator, + app_mutator, catalog_mutator, + cluster_mutator, + database_catalog_mutator, + database_instance_mutator, + external_location_mutator, + instance_pool_mutator, job_mutator, + job_run_mutator, load_resources_from_current_package_module, load_resources_from_module, load_resources_from_modules, load_resources_from_package_module, + mlflow_experiment_mutator, + mlflow_model_mutator, + model_serving_endpoint_mutator, pipeline_mutator, + quality_monitor_mutator, + registered_model_mutator, schema_mutator, + secret_scope_mutator, + sql_warehouse_mutator, + synced_database_table_mutator, variables, + vector_search_endpoint_mutator, + vector_search_index_mutator, volume_mutator, ] @@ -66,23 +83,57 @@ class ResourceMutator(Generic): class Resources: def add_alert(self, resource_name: str, alert: AlertParam, *, location: Union[Location, None] = None) -> None + def add_app(self, resource_name: str, app: AppParam, *, location: Union[Location, None] = None) -> None def add_catalog(self, resource_name: str, catalog: CatalogParam, *, location: Union[Location, None] = None) -> None + def add_cluster(self, resource_name: str, cluster: ClusterParam, *, location: Union[Location, None] = None) -> None + def add_database_catalog(self, resource_name: str, database_catalog: DatabaseCatalogParam, *, location: Union[Location, None] = None) -> None + def add_database_instance(self, resource_name: str, database_instance: DatabaseInstanceParam, *, location: Union[Location, None] = None) -> None def add_diagnostic_error(self, msg: str, *, detail: Union[str, None] = None, path: Union[tuple[str, ...], None] = None, location: Union[Location, None] = None) -> None def add_diagnostic_warning(self, msg: str, *, detail: Union[str, None] = None, path: Union[tuple[str, ...], None] = None, location: Union[Location, None] = None) -> None def add_diagnostics(self, other: Diagnostics) -> None + def add_external_location(self, resource_name: str, external_location: ExternalLocationParam, *, location: Union[Location, None] = None) -> None + def add_instance_pool(self, resource_name: str, instance_pool: InstancePoolParam, *, location: Union[Location, None] = None) -> None def add_job(self, resource_name: str, job: JobParam, *, location: Union[Location, None] = None) -> None + def add_job_run(self, resource_name: str, job_run: JobRunParam, *, location: Union[Location, None] = None) -> None def add_location(self, path: tuple[str, ...], location: Location) -> None + def add_mlflow_experiment(self, resource_name: str, mlflow_experiment: MlflowExperimentParam, *, location: Union[Location, None] = None) -> None + def add_mlflow_model(self, resource_name: str, mlflow_model: MlflowModelParam, *, location: Union[Location, None] = None) -> None + def add_model_serving_endpoint(self, resource_name: str, model_serving_endpoint: ModelServingEndpointParam, *, location: Union[Location, None] = None) -> None def add_pipeline(self, resource_name: str, pipeline: PipelineParam, *, location: Union[Location, None] = None) -> None + def add_quality_monitor(self, resource_name: str, quality_monitor: QualityMonitorParam, *, location: Union[Location, None] = None) -> None + def add_registered_model(self, resource_name: str, registered_model: RegisteredModelParam, *, location: Union[Location, None] = None) -> None def add_resource(self, resource_name: str, resource: Resource, *, location: Union[Location, None] = None) -> None def add_resources(self, other: Resources) -> None def add_schema(self, resource_name: str, schema: SchemaParam, *, location: Union[Location, None] = None) -> None + def add_secret_scope(self, resource_name: str, secret_scope: SecretScopeParam, *, location: Union[Location, None] = None) -> None + def add_sql_warehouse(self, resource_name: str, sql_warehouse: SqlWarehouseParam, *, location: Union[Location, None] = None) -> None + def add_synced_database_table(self, resource_name: str, synced_database_table: SyncedDatabaseTableParam, *, location: Union[Location, None] = None) -> None + def add_vector_search_endpoint(self, resource_name: str, vector_search_endpoint: VectorSearchEndpointParam, *, location: Union[Location, None] = None) -> None + def add_vector_search_index(self, resource_name: str, vector_search_index: VectorSearchIndexParam, *, location: Union[Location, None] = None) -> None def add_volume(self, resource_name: str, volume: VolumeParam, *, location: Union[Location, None] = None) -> None @property alerts -> dict[str, Alert] + @property apps -> dict[str, App] @property catalogs -> dict[str, Catalog] + @property clusters -> dict[str, Cluster] + @property database_catalogs -> dict[str, DatabaseCatalog] + @property database_instances -> dict[str, DatabaseInstance] @property diagnostics -> Diagnostics + @property experiments -> dict[str, MlflowExperiment] + @property external_locations -> dict[str, ExternalLocation] + @property instance_pools -> dict[str, InstancePool] + @property job_runs -> dict[str, JobRun] @property jobs -> dict[str, Job] + @property model_serving_endpoints -> dict[str, ModelServingEndpoint] + @property models -> dict[str, MlflowModel] @property pipelines -> dict[str, Pipeline] + @property quality_monitors -> dict[str, QualityMonitor] + @property registered_models -> dict[str, RegisteredModel] @property schemas -> dict[str, Schema] + @property secret_scopes -> dict[str, SecretScope] + @property sql_warehouses -> dict[str, SqlWarehouse] + @property synced_database_tables -> dict[str, SyncedDatabaseTable] + @property vector_search_endpoints -> dict[str, VectorSearchEndpoint] + @property vector_search_indexes -> dict[str, VectorSearchIndex] @property volumes -> dict[str, Volume] class Severity(Enum): @@ -106,14 +157,42 @@ VariableOrOptional = Union[Variable[_T], _T, None] @overload def alert_mutator(function: Callable[[Alert], Alert]) -> ResourceMutator[Alert] def alert_mutator(function: Callable) -> ResourceMutator[Alert] +@overload def app_mutator(function: Callable[[Bundle, App], App]) -> ResourceMutator[App] +@overload def app_mutator(function: Callable[[App], App]) -> ResourceMutator[App] +def app_mutator(function: Callable) -> ResourceMutator[App] + @overload def catalog_mutator(function: Callable[[Bundle, Catalog], Catalog]) -> ResourceMutator[Catalog] @overload def catalog_mutator(function: Callable[[Catalog], Catalog]) -> ResourceMutator[Catalog] def catalog_mutator(function: Callable) -> ResourceMutator[Catalog] +@overload def cluster_mutator(function: Callable[[Bundle, Cluster], Cluster]) -> ResourceMutator[Cluster] +@overload def cluster_mutator(function: Callable[[Cluster], Cluster]) -> ResourceMutator[Cluster] +def cluster_mutator(function: Callable) -> ResourceMutator[Cluster] + +@overload def database_catalog_mutator(function: Callable[[Bundle, DatabaseCatalog], DatabaseCatalog]) -> ResourceMutator[DatabaseCatalog] +@overload def database_catalog_mutator(function: Callable[[DatabaseCatalog], DatabaseCatalog]) -> ResourceMutator[DatabaseCatalog] +def database_catalog_mutator(function: Callable) -> ResourceMutator[DatabaseCatalog] + +@overload def database_instance_mutator(function: Callable[[Bundle, DatabaseInstance], DatabaseInstance]) -> ResourceMutator[DatabaseInstance] +@overload def database_instance_mutator(function: Callable[[DatabaseInstance], DatabaseInstance]) -> ResourceMutator[DatabaseInstance] +def database_instance_mutator(function: Callable) -> ResourceMutator[DatabaseInstance] + +@overload def external_location_mutator(function: Callable[[Bundle, ExternalLocation], ExternalLocation]) -> ResourceMutator[ExternalLocation] +@overload def external_location_mutator(function: Callable[[ExternalLocation], ExternalLocation]) -> ResourceMutator[ExternalLocation] +def external_location_mutator(function: Callable) -> ResourceMutator[ExternalLocation] + +@overload def instance_pool_mutator(function: Callable[[Bundle, InstancePool], InstancePool]) -> ResourceMutator[InstancePool] +@overload def instance_pool_mutator(function: Callable[[InstancePool], InstancePool]) -> ResourceMutator[InstancePool] +def instance_pool_mutator(function: Callable) -> ResourceMutator[InstancePool] + @overload def job_mutator(function: Callable[[Bundle, Job], Job]) -> ResourceMutator[Job] @overload def job_mutator(function: Callable[[Job], Job]) -> ResourceMutator[Job] def job_mutator(function: Callable) -> ResourceMutator[Job] +@overload def job_run_mutator(function: Callable[[Bundle, JobRun], JobRun]) -> ResourceMutator[JobRun] +@overload def job_run_mutator(function: Callable[[JobRun], JobRun]) -> ResourceMutator[JobRun] +def job_run_mutator(function: Callable) -> ResourceMutator[JobRun] + def load_resources_from_current_package_module() -> Resources def load_resources_from_module(module: module) -> Resources @@ -122,24 +201,81 @@ def load_resources_from_modules(modules: Iterable[module]) -> Resources def load_resources_from_package_module(package_module: module) -> Resources +@overload def mlflow_experiment_mutator(function: Callable[[Bundle, MlflowExperiment], MlflowExperiment]) -> ResourceMutator[MlflowExperiment] +@overload def mlflow_experiment_mutator(function: Callable[[MlflowExperiment], MlflowExperiment]) -> ResourceMutator[MlflowExperiment] +def mlflow_experiment_mutator(function: Callable) -> ResourceMutator[MlflowExperiment] + +@overload def mlflow_model_mutator(function: Callable[[Bundle, MlflowModel], MlflowModel]) -> ResourceMutator[MlflowModel] +@overload def mlflow_model_mutator(function: Callable[[MlflowModel], MlflowModel]) -> ResourceMutator[MlflowModel] +def mlflow_model_mutator(function: Callable) -> ResourceMutator[MlflowModel] + +@overload def model_serving_endpoint_mutator(function: Callable[[Bundle, ModelServingEndpoint], ModelServingEndpoint]) -> ResourceMutator[ModelServingEndpoint] +@overload def model_serving_endpoint_mutator(function: Callable[[ModelServingEndpoint], ModelServingEndpoint]) -> ResourceMutator[ModelServingEndpoint] +def model_serving_endpoint_mutator(function: Callable) -> ResourceMutator[ModelServingEndpoint] + @overload def pipeline_mutator(function: Callable[[Bundle, Pipeline], Pipeline]) -> ResourceMutator[Pipeline] @overload def pipeline_mutator(function: Callable[[Pipeline], Pipeline]) -> ResourceMutator[Pipeline] def pipeline_mutator(function: Callable) -> ResourceMutator[Pipeline] +@overload def quality_monitor_mutator(function: Callable[[Bundle, QualityMonitor], QualityMonitor]) -> ResourceMutator[QualityMonitor] +@overload def quality_monitor_mutator(function: Callable[[QualityMonitor], QualityMonitor]) -> ResourceMutator[QualityMonitor] +def quality_monitor_mutator(function: Callable) -> ResourceMutator[QualityMonitor] + +@overload def registered_model_mutator(function: Callable[[Bundle, RegisteredModel], RegisteredModel]) -> ResourceMutator[RegisteredModel] +@overload def registered_model_mutator(function: Callable[[RegisteredModel], RegisteredModel]) -> ResourceMutator[RegisteredModel] +def registered_model_mutator(function: Callable) -> ResourceMutator[RegisteredModel] + @overload def schema_mutator(function: Callable[[Bundle, Schema], Schema]) -> ResourceMutator[Schema] @overload def schema_mutator(function: Callable[[Schema], Schema]) -> ResourceMutator[Schema] def schema_mutator(function: Callable) -> ResourceMutator[Schema] +@overload def secret_scope_mutator(function: Callable[[Bundle, SecretScope], SecretScope]) -> ResourceMutator[SecretScope] +@overload def secret_scope_mutator(function: Callable[[SecretScope], SecretScope]) -> ResourceMutator[SecretScope] +def secret_scope_mutator(function: Callable) -> ResourceMutator[SecretScope] + +@overload def sql_warehouse_mutator(function: Callable[[Bundle, SqlWarehouse], SqlWarehouse]) -> ResourceMutator[SqlWarehouse] +@overload def sql_warehouse_mutator(function: Callable[[SqlWarehouse], SqlWarehouse]) -> ResourceMutator[SqlWarehouse] +def sql_warehouse_mutator(function: Callable) -> ResourceMutator[SqlWarehouse] + +@overload def synced_database_table_mutator(function: Callable[[Bundle, SyncedDatabaseTable], SyncedDatabaseTable]) -> ResourceMutator[SyncedDatabaseTable] +@overload def synced_database_table_mutator(function: Callable[[SyncedDatabaseTable], SyncedDatabaseTable]) -> ResourceMutator[SyncedDatabaseTable] +def synced_database_table_mutator(function: Callable) -> ResourceMutator[SyncedDatabaseTable] + def variables(cls: type[_T]) -> type[_T] +@overload def vector_search_endpoint_mutator(function: Callable[[Bundle, VectorSearchEndpoint], VectorSearchEndpoint]) -> ResourceMutator[VectorSearchEndpoint] +@overload def vector_search_endpoint_mutator(function: Callable[[VectorSearchEndpoint], VectorSearchEndpoint]) -> ResourceMutator[VectorSearchEndpoint] +def vector_search_endpoint_mutator(function: Callable) -> ResourceMutator[VectorSearchEndpoint] + +@overload def vector_search_index_mutator(function: Callable[[Bundle, VectorSearchIndex], VectorSearchIndex]) -> ResourceMutator[VectorSearchIndex] +@overload def vector_search_index_mutator(function: Callable[[VectorSearchIndex], VectorSearchIndex]) -> ResourceMutator[VectorSearchIndex] +def vector_search_index_mutator(function: Callable) -> ResourceMutator[VectorSearchIndex] + @overload def volume_mutator(function: Callable[[Bundle, Volume], Volume]) -> ResourceMutator[Volume] @overload def volume_mutator(function: Callable[[Volume], Volume]) -> ResourceMutator[Volume] def volume_mutator(function: Callable) -> ResourceMutator[Volume] == _ResourceType.all() registry == singular_name=alert plural_name=alerts resource_type=Alert +singular_name=app plural_name=apps resource_type=App singular_name=catalog plural_name=catalogs resource_type=Catalog +singular_name=cluster plural_name=clusters resource_type=Cluster +singular_name=database_catalog plural_name=database_catalogs resource_type=DatabaseCatalog +singular_name=database_instance plural_name=database_instances resource_type=DatabaseInstance +singular_name=external_location plural_name=external_locations resource_type=ExternalLocation +singular_name=instance_pool plural_name=instance_pools resource_type=InstancePool singular_name=job plural_name=jobs resource_type=Job +singular_name=job_run plural_name=job_runs resource_type=JobRun +singular_name=mlflow_experiment plural_name=experiments resource_type=MlflowExperiment +singular_name=mlflow_model plural_name=models resource_type=MlflowModel +singular_name=model_serving_endpoint plural_name=model_serving_endpoints resource_type=ModelServingEndpoint singular_name=pipeline plural_name=pipelines resource_type=Pipeline +singular_name=quality_monitor plural_name=quality_monitors resource_type=QualityMonitor +singular_name=registered_model plural_name=registered_models resource_type=RegisteredModel singular_name=schema plural_name=schemas resource_type=Schema +singular_name=secret_scope plural_name=secret_scopes resource_type=SecretScope +singular_name=sql_warehouse plural_name=sql_warehouses resource_type=SqlWarehouse +singular_name=synced_database_table plural_name=synced_database_tables resource_type=SyncedDatabaseTable +singular_name=vector_search_endpoint plural_name=vector_search_endpoints resource_type=VectorSearchEndpoint +singular_name=vector_search_index plural_name=vector_search_indexes resource_type=VectorSearchIndex singular_name=volume plural_name=volumes resource_type=Volume From 8620d03060f238d7bb43d74826fd38db7692b3c3 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:00:03 +0000 Subject: [PATCH 21/52] Replace acceptance-test skill with an auto-loaded rule + README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per review feedback (skills aren't reliably loaded, and the examples plus a verbose failure are enough): drop the pydabs-acceptance-test skill in favor of the repo's dresources pattern — a path-scoped .agents/rules/ file (auto-loaded when working under acceptance/bundle/python/**) pointing to a concise acceptance/bundle/python/README.md that leans on the existing fixtures. Retarget the coverage guard's message at the README. Co-authored-by: Isaac --- .agents/rules/pydabs-acceptance-tests.md | 8 + .../skills/pydabs-acceptance-test/SKILL.md | 137 ------------------ .../templates/databricks.yml.tmpl | 15 -- .../templates/mutators.py.tmpl | 11 -- .../templates/resources.py.tmpl | 14 -- .../templates/script.tmpl | 5 - .../templates/test.toml.tmpl | 7 - acceptance/bundle/python/README.md | 48 ++++++ .../core/test_python_support.py | 6 +- 9 files changed, 59 insertions(+), 192 deletions(-) create mode 100644 .agents/rules/pydabs-acceptance-tests.md delete mode 100644 .agents/skills/pydabs-acceptance-test/SKILL.md delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/script.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl create mode 100644 acceptance/bundle/python/README.md diff --git a/.agents/rules/pydabs-acceptance-tests.md b/.agents/rules/pydabs-acceptance-tests.md new file mode 100644 index 00000000000..924540845e7 --- /dev/null +++ b/.agents/rules/pydabs-acceptance-tests.md @@ -0,0 +1,8 @@ +--- +description: Rules for authoring PyDABs resource acceptance tests +globs: acceptance/bundle/python/** +paths: + - "acceptance/bundle/python/**" +--- + +**RULE: Before adding a PyDABs resource acceptance test, read `acceptance/bundle/python/README.md`.** It covers the `-support/` fixture layout, how to source and adapt realistic field values, the version/engine `test.toml` knobs, and the determinism re-run. Every PyDABs resource needs one (enforced by `test_python_support_coverage`). diff --git a/.agents/skills/pydabs-acceptance-test/SKILL.md b/.agents/skills/pydabs-acceptance-test/SKILL.md deleted file mode 100644 index 466177d0856..00000000000 --- a/.agents/skills/pydabs-acceptance-test/SKILL.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -name: pydabs-acceptance-test -description: "Author the acceptance test for a PyDABs (Python DABs) resource. Use when onboarding a new PyDABs resource, when the test_python_support_coverage guard fails for a resource, or when the user says 'add a pydabs acceptance test', 'write the acceptance test for ', or 'the -support test is missing'. Produces the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt)." -user-invocable: true -allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion ---- - -# Author a PyDABs resource acceptance test - -PyDABs acceptance tests are hand-written, one fixture per resource under -`acceptance/bundle/python/-support/`. The OpenAPI spec has no examples, so -the realistic field values come from the resource's invariant config and your own -judgement — not from a generator. This skill guides you through authoring that -fixture deterministically and verifying it. - -The coverage guard `test_python_support_coverage` -(`python/databricks_tests/core/test_python_support.py`) fails CI for any PyDABs -resource that lacks a `-support` fixture, so every newly-onboarded resource -must get one. This skill is how you close that gap. - -Worked reference: `acceptance/bundle/python/alerts-support/` (a resource with required -nested fields) and `acceptance/bundle/python/catalogs-support/` (a direct-engine-only -resource). Read both before starting — the fixture you write mirrors them. - -## Input - -The resource to cover, as its **plural** name (the `resources:` key in -`databricks.yml`, e.g. `alerts`, `volumes`). If given a singular or a Go/Python -type name, resolve it to the plural first (step 1). - -## Step 1 — Verify the resource is wired in PyDABs - -The fixture cannot work unless the resource's Python surface exists. Confirm all of: - -- The package `python/databricks/bundles//` exists and has a `_models/` - subdirectory (this is what marks it a generated resource package). -- `add_` is a method on `Resources` and `_mutator` is exported - from `databricks.bundles.core`: - - ```sh - grep -rn "def add_\|_mutator" python/databricks/bundles/core/ - ``` - -If any is missing, the resource is not wired yet — stop and onboard it in PyDABs -first (that is a separate task). Note the exact `` and `` names -(the dataclass, e.g. `Alert`) from `python/databricks/bundles//__init__.py`; -you need them for `resources.py` and `mutators.py`. - -## Step 2 — Find the resource's required fields - -The generated dataclass is the source of truth. In -`python/databricks/bundles//_models/.py`, required fields are typed -`VariableOr[...]` (no default); optional fields are `VariableOrOptional[...] = None`. -You must set every required field, including required fields of required nested -objects (recurse into their `_models` files). Optional fields are usually omitted. - -```sh -grep -nE "VariableOr\[|VariableOrOptional\[" python/databricks/bundles//_models/.py -``` - -## Step 3 — Get realistic values (adapt, don't copy) - -The invariant config `acceptance/bundle/invariant/configs/.yml.tmpl` shows -realistic values for the same resource. **Adapt** it — do not copy verbatim: - -- Replace `$UNIQUE_NAME`, `$TEST_DEFAULT_WAREHOUSE_ID`, and every other `$VAR` - interpolation with plain string literals. This test runs locally with no cloud and - no variable substitution. -- Drop cloud-only / IAM blocks the invariant config carries for its real-workspace - run: `permissions`, `grants`, `file_path` pointing at an external asset, etc. Keep - the fixture to the resource's own fields so `bundle validate` is deterministic. - -If no invariant config exists, invent plausible literals that satisfy the field types -(a display name string, an enum's first member, a cron string, etc.). - -## Step 4 — Write the six fixture files - -Copy each `templates/*.tmpl` into `acceptance/bundle/python/-support/`, -dropping the `.tmpl` suffix (e.g. `resources.py.tmpl` → `resources.py`), and fill -them in. The `.tmpl` suffix keeps the placeholder files out of the repo's linters; -the copied fixture files are real Python/YAML/TOML and must pass lint (step 7). -Placeholders: `PLURAL`, `SINGULAR`, `CLASS`, `NAME` (a short stem, e.g. `alert`), -`FIELD` (a required **string** field to mutate). - -1. **`databricks.yml`** — `bundle.name: my_project`, `sync: {paths: []}`, a top-level - `python:` block wiring `resources:load_resources` and `mutators:update_`, - and one YAML-declared resource `resources..my__1` with all required - fields. (`bundle validate` normalizes the `python:` key to `experimental.python` - in the output — that is expected, don't fight it.) -2. **`resources.py`** — `load_resources()` adds a second instance `my__2` via - `resources.add_(...)`, same required fields, slightly different values. -3. **`mutators.py`** — a `@_mutator` that `assert isinstance(...)` on a - required string field and `replace(...)`s it to append `" (updated)"`. The mutator - runs on **both** instances, so the golden shows the transform applied to each. -4. **`script`** — copy `templates/script` verbatim (`bundle validate --output json` - piped through `jq "pick(.experimental.python, .resources)"`). -5. **`test.toml`** — `Cloud = false`. Add `EnvMatrix.PYDAB_VERSION = ["current"]` for - a brand-new resource (it only exists in the current wheel, not the pinned older - one). Add `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]` only for a direct-only - resource — terraform is deprecated, so never add a `["terraform", "direct"]` - matrix. When unsure, copy the engine convention from the newest existing fixture - (`catalogs-support`), not an old one. -6. **`output.txt`** — do NOT hand-write; generate it in step 5. - -## Step 5 — Generate the golden output - -```sh -go test ./acceptance -run 'TestAccept/bundle/python/-support' -update -``` - -(or `./task test-update` to regenerate the whole suite). This writes `output.txt`. -Inspect it: both `my__1` and `my__2` must appear with the mutated field -showing `" (updated)"`, and only `experimental.python` + `resources` keys are present. - -## Step 6 — Verify it reproduces deterministically - -Re-run **without** `-update`. It must pass against the golden you just generated: - -```sh -go test ./acceptance -run 'TestAccept/bundle/python/-support' -count=1 -``` - -A test that only passes with `-update` is nondeterministic — investigate before -finishing (a `$VAR` left in a value, a non-deterministic field, an EnvMatrix variant -producing different output). Never stop at "golden written". - -## Step 7 — Confirm coverage and format - -```sh -(cd python && uv run --python 3.11 pytest databricks_tests/core/test_python_support.py) -./task fmt && ./task lint-q -``` - -`test_python_support_coverage` should now be green for this resource. If the resource -was previously in the `_LACKING` allowlist -(`python/databricks_tests/core/test_python_support.py`), remove its entry — the list -only shrinks. diff --git a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl deleted file mode 100644 index 18f303dd816..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -bundle: - name: my_project - -sync: {paths: []} # don't need to copy files - -python: - resources: - - "resources:load_resources" - mutators: - - "mutators:update_SINGULAR" - -resources: - PLURAL: - my_NAME_1: - # required fields, realistic literal values (see SKILL.md steps 2-3) diff --git a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl deleted file mode 100644 index 4a2bfb94d89..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses import replace - -from databricks.bundles.PLURAL import CLASS -from databricks.bundles.core import SINGULAR_mutator - - -@SINGULAR_mutator -def update_SINGULAR(SINGULAR: CLASS) -> CLASS: - assert isinstance(SINGULAR.FIELD, str) - - return replace(SINGULAR, FIELD=f"{SINGULAR.FIELD} (updated)") diff --git a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl deleted file mode 100644 index 9360bec828a..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -from databricks.bundles.core import Resources - - -def load_resources() -> Resources: - resources = Resources() - - resources.add_SINGULAR( - "my_NAME_2", - { - # same required fields as _1, slightly different values - }, - ) - - return resources diff --git a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl deleted file mode 100644 index e273fb45a53..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl +++ /dev/null @@ -1,5 +0,0 @@ - -trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ - jq "pick(.experimental.python, .resources)" - -rm -fr .databricks __pycache__ diff --git a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl deleted file mode 100644 index 4935b9b020a..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -Cloud = false # tests don't interact with APIs - -# new resource, only in the current wheel: -# EnvMatrix.PYDAB_VERSION = ["current"] - -# direct-only resource (terraform is deprecated): -# EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/README.md b/acceptance/bundle/python/README.md new file mode 100644 index 00000000000..942af63a6aa --- /dev/null +++ b/acceptance/bundle/python/README.md @@ -0,0 +1,48 @@ +# PyDABs resource acceptance tests + +Each `-support/` directory is the acceptance test for one PyDABs resource. It +checks that the resource loads both from YAML and from Python and that a mutator runs +over it. `test_python_support_coverage` +(`python/databricks_tests/core/test_python_support.py`) requires every PyDABs resource +to have one, so a newly-onboarded resource needs a fixture here. + +Copy an existing one — `alerts-support/` (a resource with required nested fields) or +`catalogs-support/` (direct-engine only) are the canonical examples. A fixture is six +files: + +- `databricks.yml` — `bundle.name: my_project`, `sync: {paths: []}`, a top-level + `python:` block wiring `resources:load_resources` + `mutators:update_`, and + one YAML-declared instance `.my__1`. +- `resources.py` — `load_resources()` adds a second instance `my__2` via + `resources.add_(...)`. +- `mutators.py` — a `@_mutator` that appends `" (updated)"` to a required + string field; it runs over both instances. +- `script` — copy it verbatim (`bundle validate --output json | jq "pick(...)"`). +- `test.toml` — `Cloud = false`. +- `output.txt` — generated, never hand-written. + +## Authoring a new one + +1. Confirm the resource is wired: `python/databricks/bundles//` exists, and + `add_` / `_mutator` are in `databricks.bundles.core`. If not, it + must be onboarded in PyDABs first. +2. Required fields are the `VariableOr[...]` (no default) fields in + `python/databricks/bundles//_models/.py`; set all of them, + recursing into required nested objects. `VariableOrOptional[...] = None` fields are + optional — omit them. +3. Get realistic values from `acceptance/bundle/invariant/configs/.yml.tmpl`, + but **adapt**: replace `$UNIQUE_NAME` / `$TEST_DEFAULT_WAREHOUSE_ID` and other `$VAR`s + with plain literals, and drop cloud-only blocks (`permissions`, `grants`, + `file_path`) — this test is local and deterministic. +4. `test.toml`: add `EnvMatrix.PYDAB_VERSION = ["current"]` for a brand-new resource + (it only exists in the current wheel), and `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = + ["direct"]` for a direct-only resource (terraform is deprecated — never a + `["terraform", "direct"]` matrix). Match the newest fixture when unsure. +5. Generate the golden: + `go test ./acceptance -run 'TestAccept/bundle/python/-support' -update`. +6. **Re-run without `-update`** — it must pass against the golden you just generated. A + test that only passes with `-update` is nondeterministic (usually a `$VAR` or a + volatile field left in); fix it before finishing. + +Note: `bundle validate` normalizes the `python:` key to `experimental.python` in the +output — that's expected. diff --git a/python/databricks_tests/core/test_python_support.py b/python/databricks_tests/core/test_python_support.py index ef8a113d56b..41a68d86943 100644 --- a/python/databricks_tests/core/test_python_support.py +++ b/python/databricks_tests/core/test_python_support.py @@ -1,8 +1,8 @@ """Coverage guard: every PyDABs resource must have an acceptance fixture. Asserts each resource in the _ResourceType registry has an -acceptance/bundle/python/-support/ fixture. New resources get one via the -pydabs-acceptance-test skill; this fails CI until it exists. +acceptance/bundle/python/-support/ fixture (see that directory's README.md for +how to author one); this fails CI until it exists. """ from pathlib import Path @@ -32,5 +32,5 @@ def test_python_support_coverage(plural: str): else: assert covered, ( f"no acceptance/bundle/python/{plural}-support/ fixture for {plural!r}; " - "author one with the pydabs-acceptance-test skill or add it to _LACKING" + "add one (see acceptance/bundle/python/README.md) or add it to _LACKING" ) From 1df03bba2fa6f628f8623ad9c4d8152c062d97ee Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:04:40 +0000 Subject: [PATCH 22/52] update skill --- acceptance/bundle/python/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acceptance/bundle/python/README.md b/acceptance/bundle/python/README.md index 942af63a6aa..ba49b04fb3e 100644 --- a/acceptance/bundle/python/README.md +++ b/acceptance/bundle/python/README.md @@ -36,8 +36,7 @@ files: `file_path`) — this test is local and deterministic. 4. `test.toml`: add `EnvMatrix.PYDAB_VERSION = ["current"]` for a brand-new resource (it only exists in the current wheel), and `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = - ["direct"]` for a direct-only resource (terraform is deprecated — never a - `["terraform", "direct"]` matrix). Match the newest fixture when unsure. + ["direct"]` for a direct-only resource. 5. Generate the golden: `go test ./acceptance -run 'TestAccept/bundle/python/-support' -update`. 6. **Re-run without `-update`** — it must pass against the golden you just generated. A From 81d29dea7881b95719af4f36ec6c85267dbf2398 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:17:18 +0000 Subject: [PATCH 23/52] Check that .cursor/rules mirror .agents/rules Add tools/validate_cursor_rules.py (wired into `task checks`) so a rule under .agents/rules/ without its .cursor/rules/.mdc symlink fails CI; `--fix` auto-creates missing symlinks and drops stale ones. Also add the symlink for the new pydabs-acceptance-tests rule. Co-authored-by: Isaac --- .cursor/rules/pydabs-acceptance-tests.mdc | 1 + Taskfile.yml | 8 ++- tools/validate_cursor_rules.py | 72 +++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 120000 .cursor/rules/pydabs-acceptance-tests.mdc create mode 100755 tools/validate_cursor_rules.py diff --git a/.cursor/rules/pydabs-acceptance-tests.mdc b/.cursor/rules/pydabs-acceptance-tests.mdc new file mode 120000 index 00000000000..ffe41d4bbea --- /dev/null +++ b/.cursor/rules/pydabs-acceptance-tests.mdc @@ -0,0 +1 @@ +../../.agents/rules/pydabs-acceptance-tests.md \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 49ae04a5e2d..b8cd6cb3720 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -313,8 +313,13 @@ tasks: cmds: - "! git grep -lF databricks.com -- '*uv.lock' '*.py.lock'" + check-cursor-rules: + desc: Fail if a .agents/rules/*.md lacks its .cursor/rules/*.mdc symlink (--fix adds it) + cmds: + - "./tools/validate_cursor_rules.py" + checks: - desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles) + desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles, cursor-rules) # Sequential: `tidy` rewrites go.mod/go.sum and any future tidy work # touching more paths should not race with the whitespace scanner. cmds: @@ -323,6 +328,7 @@ tasks: - task: deadcode - task: check-changelog - task: check-lockfiles + - task: check-cursor-rules install-pythons: desc: Install Python 3.9-3.13 via uv diff --git a/tools/validate_cursor_rules.py b/tools/validate_cursor_rules.py new file mode 100755 index 00000000000..3ef9ce58953 --- /dev/null +++ b/tools/validate_cursor_rules.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.12" +# /// +"""Keep .cursor/rules/*.mdc symlinks in sync with .agents/rules/*.md. + +The canonical rules live in .agents/rules/.md; Cursor reads them from +.cursor/rules/.mdc, so each rule needs a .mdc symlink pointing back at its +.md. This validates that every rule has a correct symlink and that no symlink is +left dangling. Run with --fix to create missing symlinks and drop stale ones. + +Non-symlink .mdc files (e.g. the standalone 00-agents-context.mdc bootstrap) are +not mirrors of a rule and are left untouched. +""" + +import os +import sys + +AGENTS_RULES = ".agents/rules" +CURSOR_RULES = ".cursor/rules" + + +def link_target(stem): + # The .mdc lives in .cursor/rules/, so ../../ reaches the repo root. + return f"../../{AGENTS_RULES}/{stem}.md" + + +def main(): + fix = "--fix" in sys.argv + + stems = sorted(f[:-3] for f in os.listdir(AGENTS_RULES) if f.endswith(".md")) + problems = [] + + # Every rule must have a .mdc symlink pointing at its .md. + for stem in stems: + mdc = os.path.join(CURSOR_RULES, stem + ".mdc") + want = link_target(stem) + have = os.readlink(mdc) if os.path.islink(mdc) else None + if have == want: + continue + if fix: + if os.path.lexists(mdc): + os.remove(mdc) + os.symlink(want, mdc) + print(f"Linked {mdc} -> {want}") + else: + problems.append(f"{mdc}: missing or wrong symlink, expected -> {want}") + + # No .mdc symlink may point at a rule that no longer exists. + known = {stem + ".mdc" for stem in stems} + for name in sorted(os.listdir(CURSOR_RULES)): + path = os.path.join(CURSOR_RULES, name) + if not os.path.islink(path) or name in known: + continue + if fix: + os.remove(path) + print(f"Removed stale {path}") + else: + problems.append(f"{path}: stale symlink, no matching {AGENTS_RULES}/ rule") + + if problems: + print("\n".join(problems)) + print( + f"\n{len(problems)} problem(s). Run: ./tools/validate_cursor_rules.py --fix", + file=sys.stderr, + ) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From bc490a8b90f7e0281a87aa91b34918c2e571937a Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:22:57 +0000 Subject: [PATCH 24/52] Add acceptance tests for the 17 new PyDABs resources One acceptance/bundle/python/-support/ fixture per newly generated resource, satisfying the test_python_support_coverage guard. Each loads an instance from YAML and one from Python and runs a mutator over both. Co-authored-by: Isaac --- .../python/apps-support/app1/placeholder.txt | 0 .../python/apps-support/app2/placeholder.txt | 0 .../bundle/python/apps-support/databricks.yml | 17 +++++++++ .../bundle/python/apps-support/mutators.py | 11 ++++++ .../bundle/python/apps-support/out.test.toml | 4 ++ .../bundle/python/apps-support/output.txt | 28 ++++++++++++++ .../bundle/python/apps-support/resources.py | 16 ++++++++ acceptance/bundle/python/apps-support/script | 5 +++ .../bundle/python/apps-support/test.toml | 4 ++ .../python/clusters-support/databricks.yml | 17 +++++++++ .../python/clusters-support/mutators.py | 11 ++++++ .../python/clusters-support/out.test.toml | 4 ++ .../bundle/python/clusters-support/output.txt | 30 +++++++++++++++ .../python/clusters-support/resources.py | 16 ++++++++ .../bundle/python/clusters-support/script | 5 +++ .../bundle/python/clusters-support/test.toml | 4 ++ .../database_catalogs-support/databricks.yml | 17 +++++++++ .../database_catalogs-support/mutators.py | 11 ++++++ .../database_catalogs-support/out.test.toml | 4 ++ .../database_catalogs-support/output.txt | 28 ++++++++++++++ .../database_catalogs-support/resources.py | 16 ++++++++ .../python/database_catalogs-support/script | 5 +++ .../database_catalogs-support/test.toml | 4 ++ .../database_instances-support/databricks.yml | 16 ++++++++ .../database_instances-support/mutators.py | 11 ++++++ .../database_instances-support/out.test.toml | 4 ++ .../database_instances-support/output.txt | 26 +++++++++++++ .../database_instances-support/resources.py | 15 ++++++++ .../python/database_instances-support/script | 5 +++ .../database_instances-support/test.toml | 4 ++ .../python/experiments-support/databricks.yml | 15 ++++++++ .../python/experiments-support/mutators.py | 11 ++++++ .../python/experiments-support/out.test.toml | 4 ++ .../python/experiments-support/output.txt | 24 ++++++++++++ .../python/experiments-support/resources.py | 14 +++++++ .../bundle/python/experiments-support/script | 5 +++ .../python/experiments-support/test.toml | 4 ++ .../external_locations-support/databricks.yml | 17 +++++++++ .../external_locations-support/mutators.py | 11 ++++++ .../external_locations-support/out.test.toml | 4 ++ .../external_locations-support/output.txt | 28 ++++++++++++++ .../external_locations-support/resources.py | 16 ++++++++ .../python/external_locations-support/script | 5 +++ .../external_locations-support/test.toml | 7 ++++ .../instance_pools-support/databricks.yml | 16 ++++++++ .../python/instance_pools-support/mutators.py | 11 ++++++ .../instance_pools-support/out.test.toml | 4 ++ .../python/instance_pools-support/output.txt | 26 +++++++++++++ .../instance_pools-support/resources.py | 15 ++++++++ .../python/instance_pools-support/script | 5 +++ .../python/instance_pools-support/test.toml | 7 ++++ .../python/job_runs-support/databricks.yml | 17 +++++++++ .../python/job_runs-support/mutators.py | 19 ++++++++++ .../python/job_runs-support/out.test.toml | 4 ++ .../bundle/python/job_runs-support/output.txt | 30 +++++++++++++++ .../python/job_runs-support/resources.py | 15 ++++++++ .../bundle/python/job_runs-support/script | 5 +++ .../bundle/python/job_runs-support/test.toml | 7 ++++ .../databricks.yml | 16 ++++++++ .../mutators.py | 11 ++++++ .../out.test.toml | 4 ++ .../output.txt | 26 +++++++++++++ .../resources.py | 15 ++++++++ .../model_serving_endpoints-support/script | 5 +++ .../model_serving_endpoints-support/test.toml | 4 ++ .../python/models-support/databricks.yml | 16 ++++++++ .../bundle/python/models-support/mutators.py | 11 ++++++ .../python/models-support/out.test.toml | 4 ++ .../bundle/python/models-support/output.txt | 26 +++++++++++++ .../bundle/python/models-support/resources.py | 15 ++++++++ .../bundle/python/models-support/script | 5 +++ .../bundle/python/models-support/test.toml | 4 ++ .../quality_monitors-support/databricks.yml | 17 +++++++++ .../quality_monitors-support/mutators.py | 13 +++++++ .../quality_monitors-support/out.test.toml | 4 ++ .../quality_monitors-support/output.txt | 28 ++++++++++++++ .../quality_monitors-support/resources.py | 16 ++++++++ .../python/quality_monitors-support/script | 5 +++ .../python/quality_monitors-support/test.toml | 7 ++++ .../registered_models-support/databricks.yml | 16 ++++++++ .../registered_models-support/mutators.py | 11 ++++++ .../registered_models-support/out.test.toml | 4 ++ .../registered_models-support/output.txt | 26 +++++++++++++ .../registered_models-support/resources.py | 15 ++++++++ .../python/registered_models-support/script | 5 +++ .../registered_models-support/test.toml | 4 ++ .../secret_scopes-support/databricks.yml | 16 ++++++++ .../python/secret_scopes-support/mutators.py | 11 ++++++ .../secret_scopes-support/out.test.toml | 4 ++ .../python/secret_scopes-support/output.txt | 26 +++++++++++++ .../python/secret_scopes-support/resources.py | 15 ++++++++ .../python/secret_scopes-support/script | 5 +++ .../python/secret_scopes-support/test.toml | 4 ++ .../sql_warehouses-support/databricks.yml | 20 ++++++++++ .../python/sql_warehouses-support/mutators.py | 11 ++++++ .../sql_warehouses-support/out.test.toml | 4 ++ .../python/sql_warehouses-support/output.txt | 38 +++++++++++++++++++ .../sql_warehouses-support/resources.py | 19 ++++++++++ .../python/sql_warehouses-support/script | 5 +++ .../python/sql_warehouses-support/test.toml | 4 ++ .../databricks.yml | 15 ++++++++ .../mutators.py | 11 ++++++ .../out.test.toml | 4 ++ .../synced_database_tables-support/output.txt | 24 ++++++++++++ .../resources.py | 14 +++++++ .../synced_database_tables-support/script | 5 +++ .../synced_database_tables-support/test.toml | 4 ++ .../databricks.yml | 16 ++++++++ .../mutators.py | 13 +++++++ .../out.test.toml | 4 ++ .../output.txt | 26 +++++++++++++ .../resources.py | 15 ++++++++ .../vector_search_endpoints-support/script | 5 +++ .../vector_search_endpoints-support/test.toml | 7 ++++ .../databricks.yml | 18 +++++++++ .../vector_search_indexes-support/mutators.py | 11 ++++++ .../out.test.toml | 4 ++ .../vector_search_indexes-support/output.txt | 30 +++++++++++++++ .../resources.py | 17 +++++++++ .../vector_search_indexes-support/script | 5 +++ .../vector_search_indexes-support/test.toml | 7 ++++ 121 files changed, 1454 insertions(+) create mode 100644 acceptance/bundle/python/apps-support/app1/placeholder.txt create mode 100644 acceptance/bundle/python/apps-support/app2/placeholder.txt create mode 100644 acceptance/bundle/python/apps-support/databricks.yml create mode 100644 acceptance/bundle/python/apps-support/mutators.py create mode 100644 acceptance/bundle/python/apps-support/out.test.toml create mode 100644 acceptance/bundle/python/apps-support/output.txt create mode 100644 acceptance/bundle/python/apps-support/resources.py create mode 100644 acceptance/bundle/python/apps-support/script create mode 100644 acceptance/bundle/python/apps-support/test.toml create mode 100644 acceptance/bundle/python/clusters-support/databricks.yml create mode 100644 acceptance/bundle/python/clusters-support/mutators.py create mode 100644 acceptance/bundle/python/clusters-support/out.test.toml create mode 100644 acceptance/bundle/python/clusters-support/output.txt create mode 100644 acceptance/bundle/python/clusters-support/resources.py create mode 100644 acceptance/bundle/python/clusters-support/script create mode 100644 acceptance/bundle/python/clusters-support/test.toml create mode 100644 acceptance/bundle/python/database_catalogs-support/databricks.yml create mode 100644 acceptance/bundle/python/database_catalogs-support/mutators.py create mode 100644 acceptance/bundle/python/database_catalogs-support/out.test.toml create mode 100644 acceptance/bundle/python/database_catalogs-support/output.txt create mode 100644 acceptance/bundle/python/database_catalogs-support/resources.py create mode 100644 acceptance/bundle/python/database_catalogs-support/script create mode 100644 acceptance/bundle/python/database_catalogs-support/test.toml create mode 100644 acceptance/bundle/python/database_instances-support/databricks.yml create mode 100644 acceptance/bundle/python/database_instances-support/mutators.py create mode 100644 acceptance/bundle/python/database_instances-support/out.test.toml create mode 100644 acceptance/bundle/python/database_instances-support/output.txt create mode 100644 acceptance/bundle/python/database_instances-support/resources.py create mode 100644 acceptance/bundle/python/database_instances-support/script create mode 100644 acceptance/bundle/python/database_instances-support/test.toml create mode 100644 acceptance/bundle/python/experiments-support/databricks.yml create mode 100644 acceptance/bundle/python/experiments-support/mutators.py create mode 100644 acceptance/bundle/python/experiments-support/out.test.toml create mode 100644 acceptance/bundle/python/experiments-support/output.txt create mode 100644 acceptance/bundle/python/experiments-support/resources.py create mode 100644 acceptance/bundle/python/experiments-support/script create mode 100644 acceptance/bundle/python/experiments-support/test.toml create mode 100644 acceptance/bundle/python/external_locations-support/databricks.yml create mode 100644 acceptance/bundle/python/external_locations-support/mutators.py create mode 100644 acceptance/bundle/python/external_locations-support/out.test.toml create mode 100644 acceptance/bundle/python/external_locations-support/output.txt create mode 100644 acceptance/bundle/python/external_locations-support/resources.py create mode 100644 acceptance/bundle/python/external_locations-support/script create mode 100644 acceptance/bundle/python/external_locations-support/test.toml create mode 100644 acceptance/bundle/python/instance_pools-support/databricks.yml create mode 100644 acceptance/bundle/python/instance_pools-support/mutators.py create mode 100644 acceptance/bundle/python/instance_pools-support/out.test.toml create mode 100644 acceptance/bundle/python/instance_pools-support/output.txt create mode 100644 acceptance/bundle/python/instance_pools-support/resources.py create mode 100644 acceptance/bundle/python/instance_pools-support/script create mode 100644 acceptance/bundle/python/instance_pools-support/test.toml create mode 100644 acceptance/bundle/python/job_runs-support/databricks.yml create mode 100644 acceptance/bundle/python/job_runs-support/mutators.py create mode 100644 acceptance/bundle/python/job_runs-support/out.test.toml create mode 100644 acceptance/bundle/python/job_runs-support/output.txt create mode 100644 acceptance/bundle/python/job_runs-support/resources.py create mode 100644 acceptance/bundle/python/job_runs-support/script create mode 100644 acceptance/bundle/python/job_runs-support/test.toml create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/databricks.yml create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/mutators.py create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/out.test.toml create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/output.txt create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/resources.py create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/script create mode 100644 acceptance/bundle/python/model_serving_endpoints-support/test.toml create mode 100644 acceptance/bundle/python/models-support/databricks.yml create mode 100644 acceptance/bundle/python/models-support/mutators.py create mode 100644 acceptance/bundle/python/models-support/out.test.toml create mode 100644 acceptance/bundle/python/models-support/output.txt create mode 100644 acceptance/bundle/python/models-support/resources.py create mode 100644 acceptance/bundle/python/models-support/script create mode 100644 acceptance/bundle/python/models-support/test.toml create mode 100644 acceptance/bundle/python/quality_monitors-support/databricks.yml create mode 100644 acceptance/bundle/python/quality_monitors-support/mutators.py create mode 100644 acceptance/bundle/python/quality_monitors-support/out.test.toml create mode 100644 acceptance/bundle/python/quality_monitors-support/output.txt create mode 100644 acceptance/bundle/python/quality_monitors-support/resources.py create mode 100644 acceptance/bundle/python/quality_monitors-support/script create mode 100644 acceptance/bundle/python/quality_monitors-support/test.toml create mode 100644 acceptance/bundle/python/registered_models-support/databricks.yml create mode 100644 acceptance/bundle/python/registered_models-support/mutators.py create mode 100644 acceptance/bundle/python/registered_models-support/out.test.toml create mode 100644 acceptance/bundle/python/registered_models-support/output.txt create mode 100644 acceptance/bundle/python/registered_models-support/resources.py create mode 100644 acceptance/bundle/python/registered_models-support/script create mode 100644 acceptance/bundle/python/registered_models-support/test.toml create mode 100644 acceptance/bundle/python/secret_scopes-support/databricks.yml create mode 100644 acceptance/bundle/python/secret_scopes-support/mutators.py create mode 100644 acceptance/bundle/python/secret_scopes-support/out.test.toml create mode 100644 acceptance/bundle/python/secret_scopes-support/output.txt create mode 100644 acceptance/bundle/python/secret_scopes-support/resources.py create mode 100644 acceptance/bundle/python/secret_scopes-support/script create mode 100644 acceptance/bundle/python/secret_scopes-support/test.toml create mode 100644 acceptance/bundle/python/sql_warehouses-support/databricks.yml create mode 100644 acceptance/bundle/python/sql_warehouses-support/mutators.py create mode 100644 acceptance/bundle/python/sql_warehouses-support/out.test.toml create mode 100644 acceptance/bundle/python/sql_warehouses-support/output.txt create mode 100644 acceptance/bundle/python/sql_warehouses-support/resources.py create mode 100644 acceptance/bundle/python/sql_warehouses-support/script create mode 100644 acceptance/bundle/python/sql_warehouses-support/test.toml create mode 100644 acceptance/bundle/python/synced_database_tables-support/databricks.yml create mode 100644 acceptance/bundle/python/synced_database_tables-support/mutators.py create mode 100644 acceptance/bundle/python/synced_database_tables-support/out.test.toml create mode 100644 acceptance/bundle/python/synced_database_tables-support/output.txt create mode 100644 acceptance/bundle/python/synced_database_tables-support/resources.py create mode 100644 acceptance/bundle/python/synced_database_tables-support/script create mode 100644 acceptance/bundle/python/synced_database_tables-support/test.toml create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/databricks.yml create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/mutators.py create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/out.test.toml create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/output.txt create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/resources.py create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/script create mode 100644 acceptance/bundle/python/vector_search_endpoints-support/test.toml create mode 100644 acceptance/bundle/python/vector_search_indexes-support/databricks.yml create mode 100644 acceptance/bundle/python/vector_search_indexes-support/mutators.py create mode 100644 acceptance/bundle/python/vector_search_indexes-support/out.test.toml create mode 100644 acceptance/bundle/python/vector_search_indexes-support/output.txt create mode 100644 acceptance/bundle/python/vector_search_indexes-support/resources.py create mode 100644 acceptance/bundle/python/vector_search_indexes-support/script create mode 100644 acceptance/bundle/python/vector_search_indexes-support/test.toml diff --git a/acceptance/bundle/python/apps-support/app1/placeholder.txt b/acceptance/bundle/python/apps-support/app1/placeholder.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/acceptance/bundle/python/apps-support/app2/placeholder.txt b/acceptance/bundle/python/apps-support/app2/placeholder.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/acceptance/bundle/python/apps-support/databricks.yml b/acceptance/bundle/python/apps-support/databricks.yml new file mode 100644 index 00000000000..6b65d541d4a --- /dev/null +++ b/acceptance/bundle/python/apps-support/databricks.yml @@ -0,0 +1,17 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_app" + +resources: + apps: + my_app_1: + name: "my_app_1" + description: "My app" + source_code_path: "./app1" diff --git a/acceptance/bundle/python/apps-support/mutators.py b/acceptance/bundle/python/apps-support/mutators.py new file mode 100644 index 00000000000..ab2d11dd921 --- /dev/null +++ b/acceptance/bundle/python/apps-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.apps import App +from databricks.bundles.core import app_mutator + + +@app_mutator +def update_app(app: App) -> App: + assert isinstance(app.name, str) + + return replace(app, name=f"{app.name} (updated)") diff --git a/acceptance/bundle/python/apps-support/out.test.toml b/acceptance/bundle/python/apps-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/apps-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/apps-support/output.txt b/acceptance/bundle/python/apps-support/output.txt new file mode 100644 index 00000000000..a640e206e55 --- /dev/null +++ b/acceptance/bundle/python/apps-support/output.txt @@ -0,0 +1,28 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_app" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "apps": { + "my_app_1": { + "description": "My app", + "name": "my_app_1 (updated)", + "source_code_path": "/Workspace/Users/[USERNAME]/.bundle/my_project/default/files/app1" + }, + "my_app_2": { + "description": "My app (2)", + "name": "my_app_2 (updated)", + "source_code_path": "/Workspace/Users/[USERNAME]/.bundle/my_project/default/files/app2" + } + } + } +} diff --git a/acceptance/bundle/python/apps-support/resources.py b/acceptance/bundle/python/apps-support/resources.py new file mode 100644 index 00000000000..593123f6e6c --- /dev/null +++ b/acceptance/bundle/python/apps-support/resources.py @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_app( + "my_app_2", + { + "name": "my_app_2", + "description": "My app (2)", + "source_code_path": "./app2", + }, + ) + + return resources diff --git a/acceptance/bundle/python/apps-support/script b/acceptance/bundle/python/apps-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/apps-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/apps-support/test.toml b/acceptance/bundle/python/apps-support/test.toml new file mode 100644 index 00000000000..b7fda406b0c --- /dev/null +++ b/acceptance/bundle/python/apps-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# apps are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/clusters-support/databricks.yml b/acceptance/bundle/python/clusters-support/databricks.yml new file mode 100644 index 00000000000..7c90267663e --- /dev/null +++ b/acceptance/bundle/python/clusters-support/databricks.yml @@ -0,0 +1,17 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_cluster" + +resources: + clusters: + my_cluster_1: + cluster_name: "my_cluster_1" + spark_version: "13.3.x-scala2.12" + num_workers: 1 diff --git a/acceptance/bundle/python/clusters-support/mutators.py b/acceptance/bundle/python/clusters-support/mutators.py new file mode 100644 index 00000000000..8aad2a5bc8c --- /dev/null +++ b/acceptance/bundle/python/clusters-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.clusters import Cluster +from databricks.bundles.core import cluster_mutator + + +@cluster_mutator +def update_cluster(cluster: Cluster) -> Cluster: + assert isinstance(cluster.cluster_name, str) + + return replace(cluster, cluster_name=f"{cluster.cluster_name} (updated)") diff --git a/acceptance/bundle/python/clusters-support/out.test.toml b/acceptance/bundle/python/clusters-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/clusters-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/clusters-support/output.txt b/acceptance/bundle/python/clusters-support/output.txt new file mode 100644 index 00000000000..6088a23cb7d --- /dev/null +++ b/acceptance/bundle/python/clusters-support/output.txt @@ -0,0 +1,30 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_cluster" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "clusters": { + "my_cluster_1": { + "autotermination_minutes": 60, + "cluster_name": "my_cluster_1 (updated)", + "num_workers": 1, + "spark_version": "13.3.x-scala2.12" + }, + "my_cluster_2": { + "autotermination_minutes": 60, + "cluster_name": "my_cluster_2 (updated)", + "num_workers": 1, + "spark_version": "13.3.x-scala2.12" + } + } + } +} diff --git a/acceptance/bundle/python/clusters-support/resources.py b/acceptance/bundle/python/clusters-support/resources.py new file mode 100644 index 00000000000..434349b2bbe --- /dev/null +++ b/acceptance/bundle/python/clusters-support/resources.py @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_cluster( + "my_cluster_2", + { + "cluster_name": "my_cluster_2", + "spark_version": "13.3.x-scala2.12", + "num_workers": 1, + }, + ) + + return resources diff --git a/acceptance/bundle/python/clusters-support/script b/acceptance/bundle/python/clusters-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/clusters-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/clusters-support/test.toml b/acceptance/bundle/python/clusters-support/test.toml new file mode 100644 index 00000000000..7b118126b12 --- /dev/null +++ b/acceptance/bundle/python/clusters-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# clusters are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/database_catalogs-support/databricks.yml b/acceptance/bundle/python/database_catalogs-support/databricks.yml new file mode 100644 index 00000000000..869592c9a17 --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/databricks.yml @@ -0,0 +1,17 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_database_catalog" + +resources: + database_catalogs: + my_database_catalog_1: + database_instance_name: "test_instance" + database_name: "test_db" + name: "my_database_catalog_1" diff --git a/acceptance/bundle/python/database_catalogs-support/mutators.py b/acceptance/bundle/python/database_catalogs-support/mutators.py new file mode 100644 index 00000000000..802a2a40bfc --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import database_catalog_mutator +from databricks.bundles.database_catalogs import DatabaseCatalog + + +@database_catalog_mutator +def update_database_catalog(database_catalog: DatabaseCatalog) -> DatabaseCatalog: + assert isinstance(database_catalog.name, str) + + return replace(database_catalog, name=f"{database_catalog.name} (updated)") diff --git a/acceptance/bundle/python/database_catalogs-support/out.test.toml b/acceptance/bundle/python/database_catalogs-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/database_catalogs-support/output.txt b/acceptance/bundle/python/database_catalogs-support/output.txt new file mode 100644 index 00000000000..5b72712ddaa --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/output.txt @@ -0,0 +1,28 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_database_catalog" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "database_catalogs": { + "my_database_catalog_1": { + "database_instance_name": "test_instance", + "database_name": "test_db", + "name": "my_database_catalog_1 (updated)" + }, + "my_database_catalog_2": { + "database_instance_name": "test_instance", + "database_name": "test_db_2", + "name": "my_database_catalog_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/database_catalogs-support/resources.py b/acceptance/bundle/python/database_catalogs-support/resources.py new file mode 100644 index 00000000000..8aa8ca8a96b --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/resources.py @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_database_catalog( + "my_database_catalog_2", + { + "database_instance_name": "test_instance", + "database_name": "test_db_2", + "name": "my_database_catalog_2", + }, + ) + + return resources diff --git a/acceptance/bundle/python/database_catalogs-support/script b/acceptance/bundle/python/database_catalogs-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/database_catalogs-support/test.toml b/acceptance/bundle/python/database_catalogs-support/test.toml new file mode 100644 index 00000000000..8ef152dbe21 --- /dev/null +++ b/acceptance/bundle/python/database_catalogs-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# database_catalogs are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/database_instances-support/databricks.yml b/acceptance/bundle/python/database_instances-support/databricks.yml new file mode 100644 index 00000000000..fd6e9f200ae --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_database_instance" + +resources: + database_instances: + my_database_instance_1: + name: "my_database_instance_1" + capacity: "CU_1" diff --git a/acceptance/bundle/python/database_instances-support/mutators.py b/acceptance/bundle/python/database_instances-support/mutators.py new file mode 100644 index 00000000000..685551d1ee6 --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.database_instances import DatabaseInstance +from databricks.bundles.core import database_instance_mutator + + +@database_instance_mutator +def update_database_instance(database_instance: DatabaseInstance) -> DatabaseInstance: + assert isinstance(database_instance.name, str) + + return replace(database_instance, name=f"{database_instance.name} (updated)") diff --git a/acceptance/bundle/python/database_instances-support/out.test.toml b/acceptance/bundle/python/database_instances-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/database_instances-support/output.txt b/acceptance/bundle/python/database_instances-support/output.txt new file mode 100644 index 00000000000..6ce8aadf764 --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_database_instance" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "database_instances": { + "my_database_instance_1": { + "capacity": "CU_1", + "name": "my_database_instance_1 (updated)" + }, + "my_database_instance_2": { + "capacity": "CU_1", + "name": "my_database_instance_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/database_instances-support/resources.py b/acceptance/bundle/python/database_instances-support/resources.py new file mode 100644 index 00000000000..ab65ede3d26 --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_database_instance( + "my_database_instance_2", + { + "name": "my_database_instance_2", + "capacity": "CU_1", + }, + ) + + return resources diff --git a/acceptance/bundle/python/database_instances-support/script b/acceptance/bundle/python/database_instances-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/database_instances-support/test.toml b/acceptance/bundle/python/database_instances-support/test.toml new file mode 100644 index 00000000000..a2093f387f2 --- /dev/null +++ b/acceptance/bundle/python/database_instances-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# database_instances are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/experiments-support/databricks.yml b/acceptance/bundle/python/experiments-support/databricks.yml new file mode 100644 index 00000000000..8f891041585 --- /dev/null +++ b/acceptance/bundle/python/experiments-support/databricks.yml @@ -0,0 +1,15 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_mlflow_experiment" + +resources: + experiments: + my_experiment_1: + name: "/my_experiment_1" diff --git a/acceptance/bundle/python/experiments-support/mutators.py b/acceptance/bundle/python/experiments-support/mutators.py new file mode 100644 index 00000000000..682f2ee8e99 --- /dev/null +++ b/acceptance/bundle/python/experiments-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.experiments import MlflowExperiment +from databricks.bundles.core import mlflow_experiment_mutator + + +@mlflow_experiment_mutator +def update_mlflow_experiment(experiment: MlflowExperiment) -> MlflowExperiment: + assert isinstance(experiment.name, str) + + return replace(experiment, name=f"{experiment.name} (updated)") diff --git a/acceptance/bundle/python/experiments-support/out.test.toml b/acceptance/bundle/python/experiments-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/experiments-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/experiments-support/output.txt b/acceptance/bundle/python/experiments-support/output.txt new file mode 100644 index 00000000000..4280a2bc8de --- /dev/null +++ b/acceptance/bundle/python/experiments-support/output.txt @@ -0,0 +1,24 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_mlflow_experiment" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "experiments": { + "my_experiment_1": { + "name": "//my_experiment_1 (updated)" + }, + "my_experiment_2": { + "name": "//my_experiment_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/experiments-support/resources.py b/acceptance/bundle/python/experiments-support/resources.py new file mode 100644 index 00000000000..a3db67dac41 --- /dev/null +++ b/acceptance/bundle/python/experiments-support/resources.py @@ -0,0 +1,14 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_mlflow_experiment( + "my_experiment_2", + { + "name": "/my_experiment_2", + }, + ) + + return resources diff --git a/acceptance/bundle/python/experiments-support/script b/acceptance/bundle/python/experiments-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/experiments-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/experiments-support/test.toml b/acceptance/bundle/python/experiments-support/test.toml new file mode 100644 index 00000000000..1c1599a11cb --- /dev/null +++ b/acceptance/bundle/python/experiments-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# experiments are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/external_locations-support/databricks.yml b/acceptance/bundle/python/external_locations-support/databricks.yml new file mode 100644 index 00000000000..55b0c8cc6fd --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/databricks.yml @@ -0,0 +1,17 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_external_location" + +resources: + external_locations: + my_location_1: + name: "my_location_1" + url: "s3://test-bucket/path" + credential_name: "test_cred" diff --git a/acceptance/bundle/python/external_locations-support/mutators.py b/acceptance/bundle/python/external_locations-support/mutators.py new file mode 100644 index 00000000000..f0030a43639 --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import external_location_mutator +from databricks.bundles.external_locations import ExternalLocation + + +@external_location_mutator +def update_external_location(location: ExternalLocation) -> ExternalLocation: + assert isinstance(location.name, str) + + return replace(location, name=f"{location.name} (updated)") diff --git a/acceptance/bundle/python/external_locations-support/out.test.toml b/acceptance/bundle/python/external_locations-support/out.test.toml new file mode 100644 index 00000000000..8feac676720 --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/external_locations-support/output.txt b/acceptance/bundle/python/external_locations-support/output.txt new file mode 100644 index 00000000000..0f9ca1b7fea --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/output.txt @@ -0,0 +1,28 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_external_location" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "external_locations": { + "my_location_1": { + "credential_name": "test_cred", + "name": "my_location_1 (updated)", + "url": "s3://test-bucket/path" + }, + "my_location_2": { + "credential_name": "test_cred", + "name": "my_location_2 (updated)", + "url": "s3://test-bucket/path2" + } + } + } +} diff --git a/acceptance/bundle/python/external_locations-support/resources.py b/acceptance/bundle/python/external_locations-support/resources.py new file mode 100644 index 00000000000..cdbc16df964 --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/resources.py @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_external_location( + "my_location_2", + { + "name": "my_location_2", + "url": "s3://test-bucket/path2", + "credential_name": "test_cred", + }, + ) + + return resources diff --git a/acceptance/bundle/python/external_locations-support/script b/acceptance/bundle/python/external_locations-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/external_locations-support/test.toml b/acceptance/bundle/python/external_locations-support/test.toml new file mode 100644 index 00000000000..bc1dcb19111 --- /dev/null +++ b/acceptance/bundle/python/external_locations-support/test.toml @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# external_locations are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] + +# external_locations are only supported on the direct deployment engine +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/instance_pools-support/databricks.yml b/acceptance/bundle/python/instance_pools-support/databricks.yml new file mode 100644 index 00000000000..9760325c97e --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_instance_pool" + +resources: + instance_pools: + my_pool_1: + instance_pool_name: "my_pool_1" + node_type_id: "i3.xlarge" diff --git a/acceptance/bundle/python/instance_pools-support/mutators.py b/acceptance/bundle/python/instance_pools-support/mutators.py new file mode 100644 index 00000000000..49a8b200263 --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import instance_pool_mutator +from databricks.bundles.instance_pools import InstancePool + + +@instance_pool_mutator +def update_instance_pool(pool: InstancePool) -> InstancePool: + assert isinstance(pool.instance_pool_name, str) + + return replace(pool, instance_pool_name=f"{pool.instance_pool_name} (updated)") diff --git a/acceptance/bundle/python/instance_pools-support/out.test.toml b/acceptance/bundle/python/instance_pools-support/out.test.toml new file mode 100644 index 00000000000..8feac676720 --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/instance_pools-support/output.txt b/acceptance/bundle/python/instance_pools-support/output.txt new file mode 100644 index 00000000000..701d3a8b1d2 --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_instance_pool" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "instance_pools": { + "my_pool_1": { + "instance_pool_name": "my_pool_1 (updated)", + "node_type_id": "[NODE_TYPE_ID]" + }, + "my_pool_2": { + "instance_pool_name": "my_pool_2 (updated)", + "node_type_id": "[NODE_TYPE_ID]" + } + } + } +} diff --git a/acceptance/bundle/python/instance_pools-support/resources.py b/acceptance/bundle/python/instance_pools-support/resources.py new file mode 100644 index 00000000000..8ef6bf4789e --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_instance_pool( + "my_pool_2", + { + "instance_pool_name": "my_pool_2", + "node_type_id": "i3.xlarge", + }, + ) + + return resources diff --git a/acceptance/bundle/python/instance_pools-support/script b/acceptance/bundle/python/instance_pools-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/instance_pools-support/test.toml b/acceptance/bundle/python/instance_pools-support/test.toml new file mode 100644 index 00000000000..4f7794ae00c --- /dev/null +++ b/acceptance/bundle/python/instance_pools-support/test.toml @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# instance_pools are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] + +# instance_pools are only supported on the direct deployment engine +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/job_runs-support/databricks.yml b/acceptance/bundle/python/job_runs-support/databricks.yml new file mode 100644 index 00000000000..6edcb37c932 --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/databricks.yml @@ -0,0 +1,17 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_job_run" + +resources: + job_runs: + my_run_1: + job_id: 1 + job_parameters: + description: "test" diff --git a/acceptance/bundle/python/job_runs-support/mutators.py b/acceptance/bundle/python/job_runs-support/mutators.py new file mode 100644 index 00000000000..0ec911f9fda --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/mutators.py @@ -0,0 +1,19 @@ +from dataclasses import replace +from typing import Any, Dict + +from databricks.bundles.core import job_run_mutator +from databricks.bundles.job_runs import JobRun + + +@job_run_mutator +def update_job_run(run: JobRun) -> JobRun: + # Update job_parameters dict with " (updated)" suffix to description + params = run.job_parameters or {} + updated_params: Dict[str, Any] = {} + for key, value in params.items(): + if key == "description" and isinstance(value, str): + updated_params[key] = f"{value} (updated)" + else: + updated_params[key] = value + + return replace(run, job_parameters=updated_params) diff --git a/acceptance/bundle/python/job_runs-support/out.test.toml b/acceptance/bundle/python/job_runs-support/out.test.toml new file mode 100644 index 00000000000..8feac676720 --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/job_runs-support/output.txt b/acceptance/bundle/python/job_runs-support/output.txt new file mode 100644 index 00000000000..a926f628b96 --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/output.txt @@ -0,0 +1,30 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_job_run" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "job_runs": { + "my_run_1": { + "job_id": 1, + "job_parameters": { + "description": "test (updated)" + } + }, + "my_run_2": { + "job_id": 1, + "job_parameters": { + "description": "test (updated)" + } + } + } + } +} diff --git a/acceptance/bundle/python/job_runs-support/resources.py b/acceptance/bundle/python/job_runs-support/resources.py new file mode 100644 index 00000000000..5cf76ef752a --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_job_run( + "my_run_2", + { + "job_id": 1, + "job_parameters": {"description": "test"}, + }, + ) + + return resources diff --git a/acceptance/bundle/python/job_runs-support/script b/acceptance/bundle/python/job_runs-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/job_runs-support/test.toml b/acceptance/bundle/python/job_runs-support/test.toml new file mode 100644 index 00000000000..56c3e19efc8 --- /dev/null +++ b/acceptance/bundle/python/job_runs-support/test.toml @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# job_runs are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] + +# job_runs are only supported on the direct deployment engine +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/model_serving_endpoints-support/databricks.yml b/acceptance/bundle/python/model_serving_endpoints-support/databricks.yml new file mode 100644 index 00000000000..bf1e1a324cf --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_model_serving_endpoint" + +resources: + model_serving_endpoints: + my_endpoint_1: + name: "my_endpoint_1" + description: "My endpoint" diff --git a/acceptance/bundle/python/model_serving_endpoints-support/mutators.py b/acceptance/bundle/python/model_serving_endpoints-support/mutators.py new file mode 100644 index 00000000000..a86c55757a3 --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.model_serving_endpoints import ModelServingEndpoint +from databricks.bundles.core import model_serving_endpoint_mutator + + +@model_serving_endpoint_mutator +def update_model_serving_endpoint(endpoint: ModelServingEndpoint) -> ModelServingEndpoint: + assert isinstance(endpoint.name, str) + + return replace(endpoint, name=f"{endpoint.name} (updated)") diff --git a/acceptance/bundle/python/model_serving_endpoints-support/out.test.toml b/acceptance/bundle/python/model_serving_endpoints-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/model_serving_endpoints-support/output.txt b/acceptance/bundle/python/model_serving_endpoints-support/output.txt new file mode 100644 index 00000000000..3adc3abd079 --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_model_serving_endpoint" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "model_serving_endpoints": { + "my_endpoint_1": { + "description": "My endpoint", + "name": "my_endpoint_1 (updated)" + }, + "my_endpoint_2": { + "description": "My endpoint (2)", + "name": "my_endpoint_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/model_serving_endpoints-support/resources.py b/acceptance/bundle/python/model_serving_endpoints-support/resources.py new file mode 100644 index 00000000000..08dc2faa72d --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_model_serving_endpoint( + "my_endpoint_2", + { + "name": "my_endpoint_2", + "description": "My endpoint (2)", + }, + ) + + return resources diff --git a/acceptance/bundle/python/model_serving_endpoints-support/script b/acceptance/bundle/python/model_serving_endpoints-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/model_serving_endpoints-support/test.toml b/acceptance/bundle/python/model_serving_endpoints-support/test.toml new file mode 100644 index 00000000000..4669afde3f0 --- /dev/null +++ b/acceptance/bundle/python/model_serving_endpoints-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# model_serving_endpoints are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/models-support/databricks.yml b/acceptance/bundle/python/models-support/databricks.yml new file mode 100644 index 00000000000..2167c246e2a --- /dev/null +++ b/acceptance/bundle/python/models-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_mlflow_model" + +resources: + models: + my_model_1: + name: "my_model_1" + description: "My model" diff --git a/acceptance/bundle/python/models-support/mutators.py b/acceptance/bundle/python/models-support/mutators.py new file mode 100644 index 00000000000..8a8f7cd8918 --- /dev/null +++ b/acceptance/bundle/python/models-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.models import MlflowModel +from databricks.bundles.core import mlflow_model_mutator + + +@mlflow_model_mutator +def update_mlflow_model(model: MlflowModel) -> MlflowModel: + assert isinstance(model.name, str) + + return replace(model, name=f"{model.name} (updated)") diff --git a/acceptance/bundle/python/models-support/out.test.toml b/acceptance/bundle/python/models-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/models-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/models-support/output.txt b/acceptance/bundle/python/models-support/output.txt new file mode 100644 index 00000000000..d7e8e47d885 --- /dev/null +++ b/acceptance/bundle/python/models-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_mlflow_model" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "models": { + "my_model_1": { + "description": "My model", + "name": "my_model_1 (updated)" + }, + "my_model_2": { + "description": "My model (2)", + "name": "my_model_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/models-support/resources.py b/acceptance/bundle/python/models-support/resources.py new file mode 100644 index 00000000000..593507b61d7 --- /dev/null +++ b/acceptance/bundle/python/models-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_mlflow_model( + "my_model_2", + { + "name": "my_model_2", + "description": "My model (2)", + }, + ) + + return resources diff --git a/acceptance/bundle/python/models-support/script b/acceptance/bundle/python/models-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/models-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/models-support/test.toml b/acceptance/bundle/python/models-support/test.toml new file mode 100644 index 00000000000..88fe8ee4990 --- /dev/null +++ b/acceptance/bundle/python/models-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# models are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/quality_monitors-support/databricks.yml b/acceptance/bundle/python/quality_monitors-support/databricks.yml new file mode 100644 index 00000000000..7fd203d8bf1 --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/databricks.yml @@ -0,0 +1,17 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_quality_monitor" + +resources: + quality_monitors: + my_monitor_1: + assets_dir: "/Workspace/monitoring" + output_schema_name: "default.monitoring" + table_name: "default.test_table" diff --git a/acceptance/bundle/python/quality_monitors-support/mutators.py b/acceptance/bundle/python/quality_monitors-support/mutators.py new file mode 100644 index 00000000000..a9b391f9ef3 --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/mutators.py @@ -0,0 +1,13 @@ +from dataclasses import replace + +from databricks.bundles.core import quality_monitor_mutator +from databricks.bundles.quality_monitors import QualityMonitor + + +@quality_monitor_mutator +def update_quality_monitor(monitor: QualityMonitor) -> QualityMonitor: + assert isinstance(monitor.output_schema_name, str) + + return replace( + monitor, output_schema_name=f"{monitor.output_schema_name} (updated)" + ) diff --git a/acceptance/bundle/python/quality_monitors-support/out.test.toml b/acceptance/bundle/python/quality_monitors-support/out.test.toml new file mode 100644 index 00000000000..8feac676720 --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/quality_monitors-support/output.txt b/acceptance/bundle/python/quality_monitors-support/output.txt new file mode 100644 index 00000000000..708ce30fc88 --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/output.txt @@ -0,0 +1,28 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_quality_monitor" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "quality_monitors": { + "my_monitor_1": { + "assets_dir": "/Workspace/monitoring", + "output_schema_name": "default.monitoring (updated)", + "table_name": "default.test_table" + }, + "my_monitor_2": { + "assets_dir": "/Workspace/monitoring", + "output_schema_name": "default.monitoring (updated)", + "table_name": "default.test_table" + } + } + } +} diff --git a/acceptance/bundle/python/quality_monitors-support/resources.py b/acceptance/bundle/python/quality_monitors-support/resources.py new file mode 100644 index 00000000000..8e26b02bc1e --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/resources.py @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_quality_monitor( + "my_monitor_2", + { + "assets_dir": "/Workspace/monitoring", + "output_schema_name": "default.monitoring", + "table_name": "default.test_table", + }, + ) + + return resources diff --git a/acceptance/bundle/python/quality_monitors-support/script b/acceptance/bundle/python/quality_monitors-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/quality_monitors-support/test.toml b/acceptance/bundle/python/quality_monitors-support/test.toml new file mode 100644 index 00000000000..3e8bfd9efd3 --- /dev/null +++ b/acceptance/bundle/python/quality_monitors-support/test.toml @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# quality_monitors are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] + +# quality_monitors are only supported on the direct deployment engine +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/registered_models-support/databricks.yml b/acceptance/bundle/python/registered_models-support/databricks.yml new file mode 100644 index 00000000000..8de75616dba --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_registered_model" + +resources: + registered_models: + my_registered_model_1: + name: "my_registered_model_1" + comment: "My model" diff --git a/acceptance/bundle/python/registered_models-support/mutators.py b/acceptance/bundle/python/registered_models-support/mutators.py new file mode 100644 index 00000000000..b48e8b1a86f --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import registered_model_mutator +from databricks.bundles.registered_models import RegisteredModel + + +@registered_model_mutator +def update_registered_model(registered_model: RegisteredModel) -> RegisteredModel: + assert isinstance(registered_model.comment, str) + + return replace(registered_model, comment=f"{registered_model.comment} (updated)") diff --git a/acceptance/bundle/python/registered_models-support/out.test.toml b/acceptance/bundle/python/registered_models-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/registered_models-support/output.txt b/acceptance/bundle/python/registered_models-support/output.txt new file mode 100644 index 00000000000..1a6fbbde43b --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_registered_model" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "registered_models": { + "my_registered_model_1": { + "comment": "My model (updated)", + "name": "my_registered_model_1" + }, + "my_registered_model_2": { + "comment": "My model (2) (updated)", + "name": "my_registered_model_2" + } + } + } +} diff --git a/acceptance/bundle/python/registered_models-support/resources.py b/acceptance/bundle/python/registered_models-support/resources.py new file mode 100644 index 00000000000..b05fbbca011 --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_registered_model( + "my_registered_model_2", + { + "name": "my_registered_model_2", + "comment": "My model (2)", + }, + ) + + return resources diff --git a/acceptance/bundle/python/registered_models-support/script b/acceptance/bundle/python/registered_models-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/registered_models-support/test.toml b/acceptance/bundle/python/registered_models-support/test.toml new file mode 100644 index 00000000000..b8a3736ca28 --- /dev/null +++ b/acceptance/bundle/python/registered_models-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# registered_models are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/secret_scopes-support/databricks.yml b/acceptance/bundle/python/secret_scopes-support/databricks.yml new file mode 100644 index 00000000000..3be6b161c51 --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_secret_scope" + +resources: + secret_scopes: + my_scope_1: + name: "my_scope_1" + backend_type: "DATABRICKS" diff --git a/acceptance/bundle/python/secret_scopes-support/mutators.py b/acceptance/bundle/python/secret_scopes-support/mutators.py new file mode 100644 index 00000000000..ace70fd68f4 --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.secret_scopes import SecretScope +from databricks.bundles.core import secret_scope_mutator + + +@secret_scope_mutator +def update_secret_scope(scope: SecretScope) -> SecretScope: + assert isinstance(scope.name, str) + + return replace(scope, name=f"{scope.name} (updated)") diff --git a/acceptance/bundle/python/secret_scopes-support/out.test.toml b/acceptance/bundle/python/secret_scopes-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/secret_scopes-support/output.txt b/acceptance/bundle/python/secret_scopes-support/output.txt new file mode 100644 index 00000000000..c3139333141 --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_secret_scope" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "secret_scopes": { + "my_scope_1": { + "backend_type": "DATABRICKS", + "name": "my_scope_1 (updated)" + }, + "my_scope_2": { + "backend_type": "DATABRICKS", + "name": "my_scope_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/secret_scopes-support/resources.py b/acceptance/bundle/python/secret_scopes-support/resources.py new file mode 100644 index 00000000000..64c21b39f9a --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_secret_scope( + "my_scope_2", + { + "name": "my_scope_2", + "backend_type": "DATABRICKS", + }, + ) + + return resources diff --git a/acceptance/bundle/python/secret_scopes-support/script b/acceptance/bundle/python/secret_scopes-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/secret_scopes-support/test.toml b/acceptance/bundle/python/secret_scopes-support/test.toml new file mode 100644 index 00000000000..b9d934df8fe --- /dev/null +++ b/acceptance/bundle/python/secret_scopes-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# secret_scopes are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/sql_warehouses-support/databricks.yml b/acceptance/bundle/python/sql_warehouses-support/databricks.yml new file mode 100644 index 00000000000..3a7a3012756 --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/databricks.yml @@ -0,0 +1,20 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_sql_warehouse" + +resources: + sql_warehouses: + my_sql_warehouse_1: + name: "my_sql_warehouse_1" + cluster_size: "2X-Small" + auto_stop_mins: 10 + max_num_clusters: 1 + min_num_clusters: 1 + warehouse_type: "CLASSIC" diff --git a/acceptance/bundle/python/sql_warehouses-support/mutators.py b/acceptance/bundle/python/sql_warehouses-support/mutators.py new file mode 100644 index 00000000000..67cf5d9b07d --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import sql_warehouse_mutator +from databricks.bundles.sql_warehouses import SqlWarehouse + + +@sql_warehouse_mutator +def update_sql_warehouse(sql_warehouse: SqlWarehouse) -> SqlWarehouse: + assert isinstance(sql_warehouse.name, str) + + return replace(sql_warehouse, name=f"{sql_warehouse.name} (updated)") diff --git a/acceptance/bundle/python/sql_warehouses-support/out.test.toml b/acceptance/bundle/python/sql_warehouses-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/sql_warehouses-support/output.txt b/acceptance/bundle/python/sql_warehouses-support/output.txt new file mode 100644 index 00000000000..65c2cae42b2 --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/output.txt @@ -0,0 +1,38 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_sql_warehouse" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "sql_warehouses": { + "my_sql_warehouse_1": { + "auto_stop_mins": 10, + "cluster_size": "2X-Small", + "enable_photon": true, + "max_num_clusters": 1, + "min_num_clusters": 1, + "name": "my_sql_warehouse_1 (updated)", + "spot_instance_policy": "COST_OPTIMIZED", + "warehouse_type": "CLASSIC" + }, + "my_sql_warehouse_2": { + "auto_stop_mins": 10, + "cluster_size": "2X-Small", + "enable_photon": true, + "max_num_clusters": 1, + "min_num_clusters": 1, + "name": "my_sql_warehouse_2 (updated)", + "spot_instance_policy": "COST_OPTIMIZED", + "warehouse_type": "CLASSIC" + } + } + } +} diff --git a/acceptance/bundle/python/sql_warehouses-support/resources.py b/acceptance/bundle/python/sql_warehouses-support/resources.py new file mode 100644 index 00000000000..bcd2f0676a6 --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/resources.py @@ -0,0 +1,19 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_sql_warehouse( + "my_sql_warehouse_2", + { + "name": "my_sql_warehouse_2", + "cluster_size": "2X-Small", + "auto_stop_mins": 10, + "max_num_clusters": 1, + "min_num_clusters": 1, + "warehouse_type": "CLASSIC", + }, + ) + + return resources diff --git a/acceptance/bundle/python/sql_warehouses-support/script b/acceptance/bundle/python/sql_warehouses-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/sql_warehouses-support/test.toml b/acceptance/bundle/python/sql_warehouses-support/test.toml new file mode 100644 index 00000000000..964cb938f02 --- /dev/null +++ b/acceptance/bundle/python/sql_warehouses-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# sql_warehouses are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/synced_database_tables-support/databricks.yml b/acceptance/bundle/python/synced_database_tables-support/databricks.yml new file mode 100644 index 00000000000..0867ea43b6c --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/databricks.yml @@ -0,0 +1,15 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_synced_database_table" + +resources: + synced_database_tables: + my_synced_table_1: + name: "main.default.my_synced_table_1" diff --git a/acceptance/bundle/python/synced_database_tables-support/mutators.py b/acceptance/bundle/python/synced_database_tables-support/mutators.py new file mode 100644 index 00000000000..2c9cd6ec3c0 --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import synced_database_table_mutator +from databricks.bundles.synced_database_tables import SyncedDatabaseTable + + +@synced_database_table_mutator +def update_synced_database_table(synced_database_table: SyncedDatabaseTable) -> SyncedDatabaseTable: + assert isinstance(synced_database_table.name, str) + + return replace(synced_database_table, name=f"{synced_database_table.name} (updated)") diff --git a/acceptance/bundle/python/synced_database_tables-support/out.test.toml b/acceptance/bundle/python/synced_database_tables-support/out.test.toml new file mode 100644 index 00000000000..02da5baab89 --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/synced_database_tables-support/output.txt b/acceptance/bundle/python/synced_database_tables-support/output.txt new file mode 100644 index 00000000000..643fccdfcad --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/output.txt @@ -0,0 +1,24 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_synced_database_table" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "synced_database_tables": { + "my_synced_table_1": { + "name": "main.default.my_synced_table_1 (updated)" + }, + "my_synced_table_2": { + "name": "main.default.my_synced_table_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/synced_database_tables-support/resources.py b/acceptance/bundle/python/synced_database_tables-support/resources.py new file mode 100644 index 00000000000..3e416b28f2e --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/resources.py @@ -0,0 +1,14 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_synced_database_table( + "my_synced_table_2", + { + "name": "main.default.my_synced_table_2", + }, + ) + + return resources diff --git a/acceptance/bundle/python/synced_database_tables-support/script b/acceptance/bundle/python/synced_database_tables-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/synced_database_tables-support/test.toml b/acceptance/bundle/python/synced_database_tables-support/test.toml new file mode 100644 index 00000000000..08a67723677 --- /dev/null +++ b/acceptance/bundle/python/synced_database_tables-support/test.toml @@ -0,0 +1,4 @@ +Cloud = false # tests don't interact with APIs + +# synced_database_tables are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/vector_search_endpoints-support/databricks.yml b/acceptance/bundle/python/vector_search_endpoints-support/databricks.yml new file mode 100644 index 00000000000..94dfd6f2e99 --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/databricks.yml @@ -0,0 +1,16 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_vector_search_endpoint" + +resources: + vector_search_endpoints: + my_endpoint_1: + name: "my_endpoint_1" + endpoint_type: "STANDARD" diff --git a/acceptance/bundle/python/vector_search_endpoints-support/mutators.py b/acceptance/bundle/python/vector_search_endpoints-support/mutators.py new file mode 100644 index 00000000000..743001fd4c8 --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/mutators.py @@ -0,0 +1,13 @@ +from dataclasses import replace + +from databricks.bundles.core import vector_search_endpoint_mutator +from databricks.bundles.vector_search_endpoints import VectorSearchEndpoint + + +@vector_search_endpoint_mutator +def update_vector_search_endpoint( + endpoint: VectorSearchEndpoint, +) -> VectorSearchEndpoint: + assert isinstance(endpoint.name, str) + + return replace(endpoint, name=f"{endpoint.name} (updated)") diff --git a/acceptance/bundle/python/vector_search_endpoints-support/out.test.toml b/acceptance/bundle/python/vector_search_endpoints-support/out.test.toml new file mode 100644 index 00000000000..8feac676720 --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/vector_search_endpoints-support/output.txt b/acceptance/bundle/python/vector_search_endpoints-support/output.txt new file mode 100644 index 00000000000..b0316919bac --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/output.txt @@ -0,0 +1,26 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_vector_search_endpoint" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "vector_search_endpoints": { + "my_endpoint_1": { + "endpoint_type": "STANDARD", + "name": "my_endpoint_1 (updated)" + }, + "my_endpoint_2": { + "endpoint_type": "STANDARD", + "name": "my_endpoint_2 (updated)" + } + } + } +} diff --git a/acceptance/bundle/python/vector_search_endpoints-support/resources.py b/acceptance/bundle/python/vector_search_endpoints-support/resources.py new file mode 100644 index 00000000000..df66ab797d6 --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/resources.py @@ -0,0 +1,15 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_vector_search_endpoint( + "my_endpoint_2", + { + "name": "my_endpoint_2", + "endpoint_type": "STANDARD", + }, + ) + + return resources diff --git a/acceptance/bundle/python/vector_search_endpoints-support/script b/acceptance/bundle/python/vector_search_endpoints-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/vector_search_endpoints-support/test.toml b/acceptance/bundle/python/vector_search_endpoints-support/test.toml new file mode 100644 index 00000000000..b8e53177777 --- /dev/null +++ b/acceptance/bundle/python/vector_search_endpoints-support/test.toml @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# vector_search_endpoints are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] + +# vector_search_endpoints are only supported on the direct deployment engine +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/vector_search_indexes-support/databricks.yml b/acceptance/bundle/python/vector_search_indexes-support/databricks.yml new file mode 100644 index 00000000000..82d228e3198 --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/databricks.yml @@ -0,0 +1,18 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_vector_search_index" + +resources: + vector_search_indexes: + my_index_1: + name: "my_index_1" + endpoint_name: "my_endpoint" + primary_key: "id" + index_type: "DELTA_SYNC" diff --git a/acceptance/bundle/python/vector_search_indexes-support/mutators.py b/acceptance/bundle/python/vector_search_indexes-support/mutators.py new file mode 100644 index 00000000000..e1e7fa5a62b --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/mutators.py @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.core import vector_search_index_mutator +from databricks.bundles.vector_search_indexes import VectorSearchIndex + + +@vector_search_index_mutator +def update_vector_search_index(index: VectorSearchIndex) -> VectorSearchIndex: + assert isinstance(index.name, str) + + return replace(index, name=f"{index.name} (updated)") diff --git a/acceptance/bundle/python/vector_search_indexes-support/out.test.toml b/acceptance/bundle/python/vector_search_indexes-support/out.test.toml new file mode 100644 index 00000000000..8feac676720 --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/out.test.toml @@ -0,0 +1,4 @@ +Cloud = false +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] +EnvMatrix.DMS = ["", "true"] +EnvMatrix.PYDAB_VERSION = ["current"] diff --git a/acceptance/bundle/python/vector_search_indexes-support/output.txt b/acceptance/bundle/python/vector_search_indexes-support/output.txt new file mode 100644 index 00000000000..08fc86da293 --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/output.txt @@ -0,0 +1,30 @@ + +>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json +{ + "experimental": { + "python": { + "mutators": [ + "mutators:update_vector_search_index" + ], + "resources": [ + "resources:load_resources" + ] + } + }, + "resources": { + "vector_search_indexes": { + "my_index_1": { + "endpoint_name": "my_endpoint", + "index_type": "DELTA_SYNC", + "name": "my_index_1 (updated)", + "primary_key": "id" + }, + "my_index_2": { + "endpoint_name": "my_endpoint", + "index_type": "DELTA_SYNC", + "name": "my_index_2 (updated)", + "primary_key": "id" + } + } + } +} diff --git a/acceptance/bundle/python/vector_search_indexes-support/resources.py b/acceptance/bundle/python/vector_search_indexes-support/resources.py new file mode 100644 index 00000000000..5433fc7258f --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/resources.py @@ -0,0 +1,17 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_vector_search_index( + "my_index_2", + { + "name": "my_index_2", + "endpoint_name": "my_endpoint", + "primary_key": "id", + "index_type": "DELTA_SYNC", + }, + ) + + return resources diff --git a/acceptance/bundle/python/vector_search_indexes-support/script b/acceptance/bundle/python/vector_search_indexes-support/script new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/script @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/acceptance/bundle/python/vector_search_indexes-support/test.toml b/acceptance/bundle/python/vector_search_indexes-support/test.toml new file mode 100644 index 00000000000..856a2743169 --- /dev/null +++ b/acceptance/bundle/python/vector_search_indexes-support/test.toml @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# vector_search_indexes are only supported in the current version of the wheel +EnvMatrix.PYDAB_VERSION = ["current"] + +# vector_search_indexes are only supported on the direct deployment engine +EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] From 43de1d91fe9a59895bd3a1dd726ac7f1d902e16c Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:34:09 +0000 Subject: [PATCH 25/52] Drop cursor-rules symlink lint (moving to a separate PR) Remove tools/validate_cursor_rules.py and its check-cursor-rules task; the symlink-mirror check is being shipped on its own. Keep the .cursor/rules/pydabs-acceptance-tests.mdc symlink for the rule added here. Co-authored-by: Isaac --- Taskfile.yml | 8 +--- tools/validate_cursor_rules.py | 72 ---------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) delete mode 100755 tools/validate_cursor_rules.py diff --git a/Taskfile.yml b/Taskfile.yml index b8cd6cb3720..49ae04a5e2d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -313,13 +313,8 @@ tasks: cmds: - "! git grep -lF databricks.com -- '*uv.lock' '*.py.lock'" - check-cursor-rules: - desc: Fail if a .agents/rules/*.md lacks its .cursor/rules/*.mdc symlink (--fix adds it) - cmds: - - "./tools/validate_cursor_rules.py" - checks: - desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles, cursor-rules) + desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles) # Sequential: `tidy` rewrites go.mod/go.sum and any future tidy work # touching more paths should not race with the whitespace scanner. cmds: @@ -328,7 +323,6 @@ tasks: - task: deadcode - task: check-changelog - task: check-lockfiles - - task: check-cursor-rules install-pythons: desc: Install Python 3.9-3.13 via uv diff --git a/tools/validate_cursor_rules.py b/tools/validate_cursor_rules.py deleted file mode 100755 index 3ef9ce58953..00000000000 --- a/tools/validate_cursor_rules.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -# /// script -# requires-python = ">=3.12" -# /// -"""Keep .cursor/rules/*.mdc symlinks in sync with .agents/rules/*.md. - -The canonical rules live in .agents/rules/.md; Cursor reads them from -.cursor/rules/.mdc, so each rule needs a .mdc symlink pointing back at its -.md. This validates that every rule has a correct symlink and that no symlink is -left dangling. Run with --fix to create missing symlinks and drop stale ones. - -Non-symlink .mdc files (e.g. the standalone 00-agents-context.mdc bootstrap) are -not mirrors of a rule and are left untouched. -""" - -import os -import sys - -AGENTS_RULES = ".agents/rules" -CURSOR_RULES = ".cursor/rules" - - -def link_target(stem): - # The .mdc lives in .cursor/rules/, so ../../ reaches the repo root. - return f"../../{AGENTS_RULES}/{stem}.md" - - -def main(): - fix = "--fix" in sys.argv - - stems = sorted(f[:-3] for f in os.listdir(AGENTS_RULES) if f.endswith(".md")) - problems = [] - - # Every rule must have a .mdc symlink pointing at its .md. - for stem in stems: - mdc = os.path.join(CURSOR_RULES, stem + ".mdc") - want = link_target(stem) - have = os.readlink(mdc) if os.path.islink(mdc) else None - if have == want: - continue - if fix: - if os.path.lexists(mdc): - os.remove(mdc) - os.symlink(want, mdc) - print(f"Linked {mdc} -> {want}") - else: - problems.append(f"{mdc}: missing or wrong symlink, expected -> {want}") - - # No .mdc symlink may point at a rule that no longer exists. - known = {stem + ".mdc" for stem in stems} - for name in sorted(os.listdir(CURSOR_RULES)): - path = os.path.join(CURSOR_RULES, name) - if not os.path.islink(path) or name in known: - continue - if fix: - os.remove(path) - print(f"Removed stale {path}") - else: - problems.append(f"{path}: stale symlink, no matching {AGENTS_RULES}/ rule") - - if problems: - print("\n".join(problems)) - print( - f"\n{len(problems)} problem(s). Run: ./tools/validate_cursor_rules.py --fix", - file=sys.stderr, - ) - return 1 - return 0 - - -if __name__ == "__main__": - sys.exit(main()) From 9e00060cebbdf51c851c72fe0c50f85167a2f275 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:48:39 +0000 Subject: [PATCH 26/52] Format quality_monitors acceptance mutator with ruff Co-authored-by: Isaac --- acceptance/bundle/python/quality_monitors-support/mutators.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/acceptance/bundle/python/quality_monitors-support/mutators.py b/acceptance/bundle/python/quality_monitors-support/mutators.py index a9b391f9ef3..d53fed2f9a3 100644 --- a/acceptance/bundle/python/quality_monitors-support/mutators.py +++ b/acceptance/bundle/python/quality_monitors-support/mutators.py @@ -8,6 +8,4 @@ def update_quality_monitor(monitor: QualityMonitor) -> QualityMonitor: assert isinstance(monitor.output_schema_name, str) - return replace( - monitor, output_schema_name=f"{monitor.output_schema_name} (updated)" - ) + return replace(monitor, output_schema_name=f"{monitor.output_schema_name} (updated)") From 7c96c9c0e6126b5e260a07a87f53addb5428e829 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:58:38 +0000 Subject: [PATCH 27/52] explain the reason behind keeping experimental tag for PrPr and Beta --- python/codegen/codegen/jsonschema.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/codegen/codegen/jsonschema.py b/python/codegen/codegen/jsonschema.py index d76976844bd..9ad7191a55c 100644 --- a/python/codegen/codegen/jsonschema.py +++ b/python/codegen/codegen/jsonschema.py @@ -17,6 +17,8 @@ class LaunchStage: def is_experimental_stage(stage: Optional[str]) -> bool: # Beta and private preview may still change; GA and public preview are frozen. + # Since PyDABs is typed so field behavior can change in experimental stages, + # this can lead to breaking changes hence these fields are declared experimental. return stage in (LaunchStage.PUBLIC_BETA, LaunchStage.PRIVATE_PREVIEW) From 74e032442904f8faa05effb8fb2f358921e66044 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:22:34 +0000 Subject: [PATCH 28/52] Test the dataclass path in test_add_resource_type test_add_resource_type and test_add_resource_type_dict had byte-identical bodies, both feeding dict_example, so the add_(dataclass) normalization path went untested for the parametrized resources. Feed dataclass_example to the non-_dict variant, mirroring test_add_job vs test_add_job_dict. Co-authored-by: Isaac --- python/databricks_tests/core/test_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/databricks_tests/core/test_resources.py b/python/databricks_tests/core/test_resources.py index ee2ab7ec405..e27b4331db2 100644 --- a/python/databricks_tests/core/test_resources.py +++ b/python/databricks_tests/core/test_resources.py @@ -163,7 +163,7 @@ def test_add_resource_type(tc: TestCase, tpe: _ResourceType): resources, **{ "resource_name": "my_resource", - tpe.singular_name: tc.dict_example, + tpe.singular_name: tc.dataclass_example, }, ) From e50ebdf327b0e8b36006862d0f9abaa227414b19 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:22:56 +0000 Subject: [PATCH 29/52] Generate per-resource unit-test cases from the codegen model Stop hand-writing a TestCase per resource in test_resources.py. A new codegen step (generated_test_cases.py, rendered from test_case.py.tmpl) synthesizes dict_example and dataclass_example for every wired resource from the schema model and writes one file per resource under databricks_tests/core/_generated/, collected into test_cases. A newly wired resource now gets its unit-test coverage for free. dict_example and dataclass_example are rendered two independent ways from one synthesized value tree, so the dict->dataclass _transform assertion stays meaningful. Field policy: required fields fully expanded, plus optional composite fields on the resource itself; nested objects contribute only their required fields, which bounds example size and avoids the recursive Task/ForEachTask schema. Optional scalar, deprecated, and private-preview fields are omitted. The hand-written TestCase dataclass moves to _resource_test_case.py so the generated modules can import it without a cycle. Co-authored-by: Isaac --- python/Taskfile.yml | 2 + .../codegen/codegen/generated_test_cases.py | 278 ++++++++++++++++++ python/codegen/codegen/main.py | 4 + python/codegen/codegen/test_case.py.tmpl | 16 + python/databricks_tests/.gitattributes | 4 + .../core/_generated/__init__.py | 21 ++ .../core/_generated/alerts.py | 58 ++++ .../core/_generated/catalogs.py | 35 +++ .../databricks_tests/core/_generated/jobs.py | 92 ++++++ .../core/_generated/pipelines.py | 65 ++++ .../core/_generated/schemas.py | 32 ++ .../core/_generated/volumes.py | 35 +++ .../core/_resource_test_case.py | 12 + .../databricks_tests/core/test_resources.py | 129 +------- 14 files changed, 659 insertions(+), 124 deletions(-) create mode 100644 python/codegen/codegen/generated_test_cases.py create mode 100644 python/codegen/codegen/test_case.py.tmpl create mode 100644 python/databricks_tests/.gitattributes create mode 100644 python/databricks_tests/core/_generated/__init__.py create mode 100644 python/databricks_tests/core/_generated/alerts.py create mode 100644 python/databricks_tests/core/_generated/catalogs.py create mode 100644 python/databricks_tests/core/_generated/jobs.py create mode 100644 python/databricks_tests/core/_generated/pipelines.py create mode 100644 python/databricks_tests/core/_generated/schemas.py create mode 100644 python/databricks_tests/core/_generated/volumes.py create mode 100644 python/databricks_tests/core/_resource_test_case.py diff --git a/python/Taskfile.yml b/python/Taskfile.yml index 602e92028a5..49621efd6a6 100644 --- a/python/Taskfile.yml +++ b/python/Taskfile.yml @@ -78,6 +78,8 @@ tasks: -exec rm -rf {} \; # core/ is hand-written except for the generated wiring under _generated/. - rm -rf databricks/bundles/core/_generated + # test_resources.py is hand-written except for the generated TestCase data. + - rm -rf databricks_tests/core/_generated - cd codegen && uv run -m pytest codegen_tests - cd codegen && uv run -m codegen.main --output .. # Generated code is fixed and formatted by the global ruff (see ../ruff.toml). diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py new file mode 100644 index 00000000000..7decc29a897 --- /dev/null +++ b/python/codegen/codegen/generated_test_cases.py @@ -0,0 +1,278 @@ +""" +Generates the per-resource TestCase data driving databricks_tests/core/test_resources.py. + +For every wired resource a file _generated/.py is written (rendered from +test_case.py.tmpl) exposing _test_case() -> (TestCase, _ResourceType). The generated +_generated/__init__.py collects them into `test_cases`, which test_resources.py imports +and parametrizes its per-resource tests off. + +dict_example and dataclass_example are synthesized from one value tree and rendered two +independent ways -- a dict literal and a constructor expression -- so the dict->dataclass +_transform assertion in test_resources.py stays meaningful (the two forms don't share the +runtime transform path). + +Field policy: all required fields (fully expanded), plus optional composite fields +(nested dataclass / list / map / enum) on the resource itself; nested objects contribute +only their required fields, which keeps examples bounded and avoids recursive schemas +(e.g. jobs Task -> ForEachTask -> Task, reachable only through an optional field). Optional +scalar, deprecated, and experimental fields are omitted. +""" + +from dataclasses import dataclass +from pathlib import Path +from string import Template +from typing import Union + +import codegen.jsonschema as openapi +import codegen.packages as packages +from codegen.generated_enum import _camel_to_upper_snake +from codegen.generated_wiring import _WiredResource, _wired_resources + +HEADER = "# Code generated by pydabs-codegen. DO NOT EDIT.\n\n" + +_TEST_CASE_TEMPLATE = Template( + (Path(__file__).parent / "test_case.py.tmpl").read_text() +) + + +# Synthesized value tree. Each node renders both as a dict literal (dict_example) +# and as a constructor expression (dataclass_example). + + +@dataclass +class _Scalar: + dict_src: str + dataclass_src: str + + +@dataclass +class _Enum: + value: str + class_name: str + module: str + member: str + + +@dataclass +class _Object: + class_name: str + module: str + fields: "list[tuple[str, _Value]]" + + +@dataclass +class _List: + item: "_Value" + + +@dataclass +class _Map: + key: str + value: "_Value" + + +_Value = Union[_Scalar, _Enum, _Object, _List, _Map] + + +def _ref_name(ref: str) -> str: + return ref.split("/")[-1] + + +def _is_composite(ref: str) -> bool: + if ref.startswith("#/$defs/slice/") or ref.startswith("#/$defs/map/"): + return True + + return _ref_name(ref) not in packages.PRIMITIVES + + +def _synth_scalar(name: str, hint: str) -> _Scalar: + if name == "string": + return _Scalar(f'"{hint}"', f'"{hint}"') + if name in ("integer", "int", "int64"): + return _Scalar("0", "0") + if name in ("number", "float", "float64"): + return _Scalar("0.0", "0.0") + if name in ("boolean", "bool"): + return _Scalar("True", "True") + + raise ValueError(f"Unknown primitive: {name}") + + +def _synth_ref( + namespace: str, + ref: str, + hint: str, + schemas: dict[str, openapi.Schema], + visiting: set[str], +) -> _Value: + if ref.startswith("#/$defs/slice/"): + element_ref = ref.replace("#/$defs/slice/", "#/$defs/") + + return _List(_synth_ref(namespace, element_ref, hint, schemas, visiting)) + + if ref.startswith("#/$defs/map/"): + # generate_type only ever produces dict[str, str] maps (map/string). + if ref != "#/$defs/map/string": + raise ValueError(f"Unsupported map ref: {ref}") + + return _Map("key", _Scalar('"value"', '"value"')) + + name = _ref_name(ref) + if name in packages.PRIMITIVES: + return _synth_scalar(name, hint) + + schema = schemas[name] + class_name = packages.get_class_name(ref) + module = packages.get_package(namespace, ref) + assert module + + if schema.type == openapi.SchemaType.STRING: + value = schema.enum[0] + + return _Enum(value, class_name, module, _camel_to_upper_snake(value)) + + # Only reachable through required fields at this depth (see _synth_object); a + # required cycle has no finite value, so fail loudly instead of looping. + if name in visiting: + raise ValueError(f"Required-field cycle through '{name}'") + + return _synth_object(namespace, name, schema, schemas, visiting, top_level=False) + + +def _synth_object( + namespace: str, + schema_name: str, + schema: openapi.Schema, + schemas: dict[str, openapi.Schema], + visiting: set[str], + top_level: bool, +) -> _Object: + visiting = visiting | {schema_name} + fields: list[tuple[str, _Value]] = [] + + for field_name, prop in schema.properties.items(): + required = field_name in schema.required + + if not required: + # Nested objects contribute only required fields; on the resource + # itself, also include stable optional composite fields. + if not top_level: + continue + if not _is_composite(prop.ref): + continue + if prop.deprecated or prop.stage == openapi.LaunchStage.PRIVATE_PREVIEW: + continue + + value = _synth_ref(namespace, prop.ref, field_name, schemas, visiting) + fields.append((field_name, value)) + + return _Object( + packages.get_class_name(schema_name), _module_of(namespace, schema_name), fields + ) + + +def _module_of(namespace: str, schema_name: str) -> str: + module = packages.get_package(namespace, schema_name) + assert module + + return module + + +def _render_dict(value: _Value) -> str: + if isinstance(value, _Scalar): + return value.dict_src + if isinstance(value, _Enum): + return f'"{value.value}"' + if isinstance(value, _List): + return f"[{_render_dict(value.item)}]" + if isinstance(value, _Map): + return "{" + f'"{value.key}": {_render_dict(value.value)}' + "}" + + fields = ", ".join( + f'"{name}": {_render_dict(child)}' for name, child in value.fields + ) + + return "{" + fields + "}" + + +def _render_dataclass(value: _Value) -> str: + if isinstance(value, _Scalar): + return value.dataclass_src + if isinstance(value, _Enum): + return f"{value.class_name}.{value.member}" + if isinstance(value, _List): + return f"[{_render_dataclass(value.item)}]" + if isinstance(value, _Map): + return "{" + f'"{value.key}": {_render_dataclass(value.value)}' + "}" + + fields = ", ".join( + f"{name}={_render_dataclass(child)}" for name, child in value.fields + ) + + return f"{value.class_name}({fields})" + + +def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: + if isinstance(value, _Enum): + out.add((value.module, value.class_name)) + elif isinstance(value, _Object): + out.add((value.module, value.class_name)) + for _, child in value.fields: + _collect_imports(child, out) + elif isinstance(value, _List): + _collect_imports(value.item, out) + elif isinstance(value, _Map): + _collect_imports(value.value, out) + + +def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): + resources = _wired_resources() + + generated_path = Path(output) / "databricks_tests" / "core" / "_generated" + generated_path.mkdir(parents=True, exist_ok=True) + + plural_to_ref = {ns: ref for ref, ns in packages.RESOURCE_NAMESPACE.items()} + + for r in resources: + resource_ref = plural_to_ref[r.plural_name] + schema = schemas[resource_ref] + + example = _synth_object( + r.plural_name, resource_ref, schema, schemas, set(), top_level=True + ) + + imports: set[tuple[str, str]] = set() + _collect_imports(example, imports) + model_imports = "\n".join( + f"from {module} import {class_name}" + for module, class_name in sorted(imports) + ) + + code = _TEST_CASE_TEMPLATE.substitute( + singular=r.singular_name, + plural=r.plural_name, + model_imports=model_imports, + dict_example=_render_dict(example), + dataclass_example=_render_dataclass(example), + ) + (generated_path / f"{r.plural_name}.py").write_text(HEADER + code) + + (generated_path / "__init__.py").write_text(HEADER + _collector_code(resources)) + + print(f"Writing test cases into {generated_path}") + + +def _collector_code(resources: list[_WiredResource]) -> str: + module_imports = "\n".join(f" {r.plural_name}," for r in resources) + entries = "\n".join(f" {r.plural_name}._test_case()," for r in resources) + + return f"""from databricks_tests.core._generated import ( +{module_imports} +) + +__all__ = ["test_cases"] + +test_cases = [ +{entries} +] +""" diff --git a/python/codegen/codegen/main.py b/python/codegen/codegen/main.py index 7927da85961..924ec269e88 100644 --- a/python/codegen/codegen/main.py +++ b/python/codegen/codegen/main.py @@ -8,6 +8,7 @@ import codegen.generated_dataclass_patch as generated_dataclass_patch import codegen.generated_enum as generated_enum import codegen.generated_imports as generated_imports +import codegen.generated_test_cases as generated_test_cases import codegen.generated_wiring as generated_wiring import codegen.jsonschema as openapi import codegen.jsonschema_patch as openapi_patch @@ -52,6 +53,9 @@ def main(output: str): # decorators, and the core package __init__). generated_wiring.write_wiring(output) + # Generate the per-resource TestCase data driving test_resources.py. + generated_test_cases.write_test_cases(output, schemas) + def _transitively_mark_deprecated_and_private( roots: list[str], diff --git a/python/codegen/codegen/test_case.py.tmpl b/python/codegen/codegen/test_case.py.tmpl new file mode 100644 index 00000000000..8abe9d1ce5e --- /dev/null +++ b/python/codegen/codegen/test_case.py.tmpl @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources, ${singular}_mutator +from databricks.bundles.core._generated.${plural} import _resource_type +from databricks_tests.core._resource_test_case import TestCase +$model_imports + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_${singular}, + dict_example=$dict_example, + dataclass_example=$dataclass_example, + mutator=${singular}_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/.gitattributes b/python/databricks_tests/.gitattributes new file mode 100644 index 00000000000..810eb0c20ec --- /dev/null +++ b/python/databricks_tests/.gitattributes @@ -0,0 +1,4 @@ +# Generated by pydabs-codegen (see python/codegen). The per-resource TestCase +# data under core/_generated/ drives the parametrized tests in test_resources.py; +# the rest of databricks_tests/ is hand-written. +core/_generated/** linguist-generated=true diff --git a/python/databricks_tests/core/_generated/__init__.py b/python/databricks_tests/core/_generated/__init__.py new file mode 100644 index 00000000000..9cf2cc18cee --- /dev/null +++ b/python/databricks_tests/core/_generated/__init__.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks_tests.core._generated import ( + alerts, + catalogs, + jobs, + pipelines, + schemas, + volumes, +) + +__all__ = ["test_cases"] + +test_cases = [ + alerts._test_case(), + catalogs._test_case(), + jobs._test_case(), + pipelines._test_case(), + schemas._test_case(), + volumes._test_case(), +] diff --git a/python/databricks_tests/core/_generated/alerts.py b/python/databricks_tests/core/_generated/alerts.py new file mode 100644 index 00000000000..ec85f6daeae --- /dev/null +++ b/python/databricks_tests/core/_generated/alerts.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.alerts._models.alert import Alert +from databricks.bundles.alerts._models.alert_v2_evaluation import AlertV2Evaluation +from databricks.bundles.alerts._models.alert_v2_operand_column import ( + AlertV2OperandColumn, +) +from databricks.bundles.alerts._models.alert_v2_run_as import AlertV2RunAs +from databricks.bundles.alerts._models.comparison_operator import ComparisonOperator +from databricks.bundles.alerts._models.cron_schedule import CronSchedule +from databricks.bundles.alerts._models.lifecycle import Lifecycle +from databricks.bundles.alerts._models.permission import Permission +from databricks.bundles.alerts._models.permission_level import PermissionLevel +from databricks.bundles.core import Resources, alert_mutator +from databricks.bundles.core._generated.alerts import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_alert, + dict_example={ + "display_name": "display_name", + "evaluation": { + "comparison_operator": "LESS_THAN", + "source": {"name": "name"}, + }, + "lifecycle": {}, + "permissions": [{"level": "CAN_MANAGE"}], + "query_text": "query_text", + "run_as": {}, + "schedule": { + "quartz_cron_schedule": "quartz_cron_schedule", + "timezone_id": "timezone_id", + }, + "warehouse_id": "warehouse_id", + }, + dataclass_example=Alert( + display_name="display_name", + evaluation=AlertV2Evaluation( + comparison_operator=ComparisonOperator.LESS_THAN, + source=AlertV2OperandColumn(name="name"), + ), + lifecycle=Lifecycle(), + permissions=[Permission(level=PermissionLevel.CAN_MANAGE)], + query_text="query_text", + run_as=AlertV2RunAs(), + schedule=CronSchedule( + quartz_cron_schedule="quartz_cron_schedule", + timezone_id="timezone_id", + ), + warehouse_id="warehouse_id", + ), + mutator=alert_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/catalogs.py b/python/databricks_tests/core/_generated/catalogs.py new file mode 100644 index 00000000000..177ada20428 --- /dev/null +++ b/python/databricks_tests/core/_generated/catalogs.py @@ -0,0 +1,35 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.catalogs._models.catalog import Catalog +from databricks.bundles.catalogs._models.encryption_settings import EncryptionSettings +from databricks.bundles.catalogs._models.lifecycle import Lifecycle +from databricks.bundles.catalogs._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.core import Resources, catalog_mutator +from databricks.bundles.core._generated.catalogs import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_catalog, + dict_example={ + "grants": [{}], + "lifecycle": {}, + "managed_encryption_settings": {}, + "name": "name", + "options": {"key": "value"}, + "properties": {"key": "value"}, + }, + dataclass_example=Catalog( + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + managed_encryption_settings=EncryptionSettings(), + name="name", + options={"key": "value"}, + properties={"key": "value"}, + ), + mutator=catalog_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/jobs.py b/python/databricks_tests/core/_generated/jobs.py new file mode 100644 index 00000000000..3a9dd6cec6d --- /dev/null +++ b/python/databricks_tests/core/_generated/jobs.py @@ -0,0 +1,92 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, job_mutator +from databricks.bundles.core._generated.jobs import _resource_type +from databricks.bundles.jobs._models.continuous import Continuous +from databricks.bundles.jobs._models.cron_schedule import CronSchedule +from databricks.bundles.jobs._models.git_provider import GitProvider +from databricks.bundles.jobs._models.git_source import GitSource +from databricks.bundles.jobs._models.job import Job +from databricks.bundles.jobs._models.job_cluster import JobCluster +from databricks.bundles.jobs._models.job_email_notifications import ( + JobEmailNotifications, +) +from databricks.bundles.jobs._models.job_environment import JobEnvironment +from databricks.bundles.jobs._models.job_notification_settings import ( + JobNotificationSettings, +) +from databricks.bundles.jobs._models.job_parameter_definition import ( + JobParameterDefinition, +) +from databricks.bundles.jobs._models.job_permission import JobPermission +from databricks.bundles.jobs._models.job_permission_level import JobPermissionLevel +from databricks.bundles.jobs._models.job_run_as import JobRunAs +from databricks.bundles.jobs._models.jobs_health_rules import JobsHealthRules +from databricks.bundles.jobs._models.lifecycle import Lifecycle +from databricks.bundles.jobs._models.performance_target import PerformanceTarget +from databricks.bundles.jobs._models.queue_settings import QueueSettings +from databricks.bundles.jobs._models.task import Task +from databricks.bundles.jobs._models.trigger_configuration import TriggerConfiguration +from databricks.bundles.jobs._models.trigger_settings import TriggerSettings +from databricks.bundles.jobs._models.webhook_notifications import WebhookNotifications +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_job, + dict_example={ + "continuous": {}, + "email_notifications": {}, + "environments": [{"environment_key": "environment_key"}], + "git_source": {"git_provider": "gitHub", "git_url": "git_url"}, + "health": {}, + "job_clusters": [{"job_cluster_key": "job_cluster_key"}], + "lifecycle": {}, + "notification_settings": {}, + "parameters": [{"default": "default", "name": "name"}], + "performance_target": "PERFORMANCE_OPTIMIZED", + "permissions": [{"level": "CAN_MANAGE"}], + "queue": {"enabled": True}, + "run_as": {}, + "schedule": { + "quartz_cron_expression": "quartz_cron_expression", + "timezone_id": "timezone_id", + }, + "tags": {"key": "value"}, + "tasks": [{"task_key": "task_key"}], + "trigger": {}, + "triggers": [{}], + "webhook_notifications": {}, + }, + dataclass_example=Job( + continuous=Continuous(), + email_notifications=JobEmailNotifications(), + environments=[JobEnvironment(environment_key="environment_key")], + git_source=GitSource( + git_provider=GitProvider.GIT_HUB, git_url="git_url" + ), + health=JobsHealthRules(), + job_clusters=[JobCluster(job_cluster_key="job_cluster_key")], + lifecycle=Lifecycle(), + notification_settings=JobNotificationSettings(), + parameters=[JobParameterDefinition(default="default", name="name")], + performance_target=PerformanceTarget.PERFORMANCE_OPTIMIZED, + permissions=[JobPermission(level=JobPermissionLevel.CAN_MANAGE)], + queue=QueueSettings(enabled=True), + run_as=JobRunAs(), + schedule=CronSchedule( + quartz_cron_expression="quartz_cron_expression", + timezone_id="timezone_id", + ), + tags={"key": "value"}, + tasks=[Task(task_key="task_key")], + trigger=TriggerSettings(), + triggers=[TriggerConfiguration()], + webhook_notifications=WebhookNotifications(), + ), + mutator=job_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/pipelines.py b/python/databricks_tests/core/_generated/pipelines.py new file mode 100644 index 00000000000..a4e65573317 --- /dev/null +++ b/python/databricks_tests/core/_generated/pipelines.py @@ -0,0 +1,65 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, pipeline_mutator +from databricks.bundles.core._generated.pipelines import _resource_type +from databricks.bundles.pipelines._models.event_log_spec import EventLogSpec +from databricks.bundles.pipelines._models.filters import Filters +from databricks.bundles.pipelines._models.ingestion_pipeline_definition import ( + IngestionPipelineDefinition, +) +from databricks.bundles.pipelines._models.lifecycle import Lifecycle +from databricks.bundles.pipelines._models.notifications import Notifications +from databricks.bundles.pipelines._models.pipeline import Pipeline +from databricks.bundles.pipelines._models.pipeline_cluster import PipelineCluster +from databricks.bundles.pipelines._models.pipeline_library import PipelineLibrary +from databricks.bundles.pipelines._models.pipeline_permission import PipelinePermission +from databricks.bundles.pipelines._models.pipeline_permission_level import ( + PipelinePermissionLevel, +) +from databricks.bundles.pipelines._models.pipelines_environment import ( + PipelinesEnvironment, +) +from databricks.bundles.pipelines._models.run_as import RunAs +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_pipeline, + dict_example={ + "clusters": [{}], + "configuration": {"key": "value"}, + "environment": {}, + "event_log": {}, + "filters": {}, + "ingestion_definition": {}, + "libraries": [{}], + "lifecycle": {}, + "notifications": [{}], + "parameters": {"key": "value"}, + "permissions": [{"level": "CAN_MANAGE"}], + "run_as": {}, + "tags": {"key": "value"}, + }, + dataclass_example=Pipeline( + clusters=[PipelineCluster()], + configuration={"key": "value"}, + environment=PipelinesEnvironment(), + event_log=EventLogSpec(), + filters=Filters(), + ingestion_definition=IngestionPipelineDefinition(), + libraries=[PipelineLibrary()], + lifecycle=Lifecycle(), + notifications=[Notifications()], + parameters={"key": "value"}, + permissions=[ + PipelinePermission(level=PipelinePermissionLevel.CAN_MANAGE) + ], + run_as=RunAs(), + tags={"key": "value"}, + ), + mutator=pipeline_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/schemas.py b/python/databricks_tests/core/_generated/schemas.py new file mode 100644 index 00000000000..49adceab523 --- /dev/null +++ b/python/databricks_tests/core/_generated/schemas.py @@ -0,0 +1,32 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, schema_mutator +from databricks.bundles.core._generated.schemas import _resource_type +from databricks.bundles.schemas._models.lifecycle import Lifecycle +from databricks.bundles.schemas._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.schemas._models.schema import Schema +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_schema, + dict_example={ + "catalog_name": "catalog_name", + "grants": [{}], + "lifecycle": {}, + "name": "name", + "properties": {"key": "value"}, + }, + dataclass_example=Schema( + catalog_name="catalog_name", + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + properties={"key": "value"}, + ), + mutator=schema_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/volumes.py b/python/databricks_tests/core/_generated/volumes.py new file mode 100644 index 00000000000..bf8b434adec --- /dev/null +++ b/python/databricks_tests/core/_generated/volumes.py @@ -0,0 +1,35 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, volume_mutator +from databricks.bundles.core._generated.volumes import _resource_type +from databricks.bundles.volumes._models.lifecycle import Lifecycle +from databricks.bundles.volumes._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.volumes._models.volume import Volume +from databricks.bundles.volumes._models.volume_type import VolumeType +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_volume, + dict_example={ + "catalog_name": "catalog_name", + "grants": [{}], + "lifecycle": {}, + "name": "name", + "schema_name": "schema_name", + "volume_type": "MANAGED", + }, + dataclass_example=Volume( + catalog_name="catalog_name", + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + schema_name="schema_name", + volume_type=VolumeType.MANAGED, + ), + mutator=volume_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_resource_test_case.py b/python/databricks_tests/core/_resource_test_case.py new file mode 100644 index 00000000000..a9755e8e95c --- /dev/null +++ b/python/databricks_tests/core/_resource_test_case.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from typing import Callable + +from databricks.bundles.core._resource import Resource + + +@dataclass(kw_only=True) +class TestCase: + add_resource: Callable + dict_example: dict + dataclass_example: Resource + mutator: Callable diff --git a/python/databricks_tests/core/test_resources.py b/python/databricks_tests/core/test_resources.py index e27b4331db2..ed50243d785 100644 --- a/python/databricks_tests/core/test_resources.py +++ b/python/databricks_tests/core/test_resources.py @@ -1,134 +1,15 @@ -from dataclasses import dataclass, replace -from typing import Callable +from dataclasses import replace import pytest -from databricks.bundles.alerts._models.alert import Alert -from databricks.bundles.alerts._models.alert_v2_evaluation import AlertV2Evaluation -from databricks.bundles.alerts._models.alert_v2_operand_column import ( - AlertV2OperandColumn, -) -from databricks.bundles.alerts._models.comparison_operator import ComparisonOperator -from databricks.bundles.alerts._models.cron_schedule import CronSchedule -from databricks.bundles.catalogs._models.catalog import Catalog -from databricks.bundles.core import ( - Location, - Resources, - Severity, - alert_mutator, - catalog_mutator, - job_mutator, - pipeline_mutator, - schema_mutator, - volume_mutator, -) +from databricks.bundles.core import Location, Resources, Severity from databricks.bundles.core._bundle import Bundle -from databricks.bundles.core._resource import Resource from databricks.bundles.core._resource_mutator import ResourceMutator from databricks.bundles.core._resource_type import _ResourceType from databricks.bundles.jobs._models.job import Job -from databricks.bundles.pipelines._models.pipeline import Pipeline -from databricks.bundles.schemas._models.schema import Schema -from databricks.bundles.volumes._models.volume import Volume - - -@dataclass(kw_only=True) -class TestCase: - add_resource: Callable - dict_example: dict - dataclass_example: Resource - mutator: Callable - - -resource_types = {tpe.resource_type: tpe for tpe in _ResourceType.all()} -test_cases = [ - ( - TestCase( - add_resource=Resources.add_job, - dict_example={"name": "My job"}, - dataclass_example=Job(name="My job"), - mutator=job_mutator, - ), - resource_types[Job], - ), - ( - TestCase( - add_resource=Resources.add_pipeline, - dict_example={"name": "My pipeline"}, - dataclass_example=Pipeline(name="My pipeline"), - mutator=pipeline_mutator, - ), - resource_types[Pipeline], - ), - ( - TestCase( - add_resource=Resources.add_volume, - dict_example={ - "name": "My Volume", - "catalog_name": "my_catalog", - "schema_name": "my_schema", - }, - dataclass_example=Volume( - catalog_name="my_catalog", - name="My Volume", - schema_name="my_schema", - ), - mutator=volume_mutator, - ), - resource_types[Volume], - ), - ( - TestCase( - add_resource=Resources.add_schema, - dict_example={"catalog_name": "my_catalog", "name": "my_schema"}, - dataclass_example=Schema(catalog_name="my_catalog", name="my_schema"), - mutator=schema_mutator, - ), - resource_types[Schema], - ), - ( - TestCase( - add_resource=Resources.add_alert, - dict_example={ - "display_name": "My Alert", - "query_text": "SELECT 1", - "warehouse_id": "my_warehouse", - "evaluation": { - "comparison_operator": "GREATER_THAN", - "source": {"name": "column_1"}, - }, - "schedule": { - "quartz_cron_schedule": "0 0 0 * * ?", - "timezone_id": "UTC", - }, - }, - dataclass_example=Alert( - display_name="My Alert", - query_text="SELECT 1", - warehouse_id="my_warehouse", - evaluation=AlertV2Evaluation( - comparison_operator=ComparisonOperator.GREATER_THAN, - source=AlertV2OperandColumn(name="column_1"), - ), - schedule=CronSchedule( - quartz_cron_schedule="0 0 0 * * ?", - timezone_id="UTC", - ), - ), - mutator=alert_mutator, - ), - resource_types[Alert], - ), - ( - TestCase( - add_resource=Resources.add_catalog, - dict_example={"name": "my_catalog"}, - dataclass_example=Catalog(name="my_catalog"), - mutator=catalog_mutator, - ), - resource_types[Catalog], - ), -] +from databricks_tests.core._generated import test_cases +from databricks_tests.core._resource_test_case import TestCase + test_case_ids = [tpe.plural_name for _, tpe in test_cases] From 14946e57218971e8f3e834ca2ef5fa2f7c47b7ef Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:45:17 +0000 Subject: [PATCH 30/52] Fix ruff lint in the test-case generator The generator source lives outside databricks/databricks_tests, so pydabs-codegen's targeted ruff --fix does not reach it, but the root ruff check does. Sort imports and merge the two startswith calls into a single tuple call. No change to generated output. Co-authored-by: Isaac --- python/codegen/codegen/generated_test_cases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index 7decc29a897..1de481b5d0a 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -26,7 +26,7 @@ import codegen.jsonschema as openapi import codegen.packages as packages from codegen.generated_enum import _camel_to_upper_snake -from codegen.generated_wiring import _WiredResource, _wired_resources +from codegen.generated_wiring import _wired_resources, _WiredResource HEADER = "# Code generated by pydabs-codegen. DO NOT EDIT.\n\n" @@ -79,7 +79,7 @@ def _ref_name(ref: str) -> str: def _is_composite(ref: str) -> bool: - if ref.startswith("#/$defs/slice/") or ref.startswith("#/$defs/map/"): + if ref.startswith(("#/$defs/slice/", "#/$defs/map/")): return True return _ref_name(ref) not in packages.PRIMITIVES From e4b67a4eb9ca297fd600abab697de86b184170de Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 12:17:15 +0000 Subject: [PATCH 31/52] added explainatory comments --- .../codegen/codegen/generated_test_cases.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index 1de481b5d0a..c3984879c46 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -75,10 +75,18 @@ class _Map: def _ref_name(ref: str) -> str: + """Last path segment of a JSON-schema ref -- the schema name. + + :param ref: a JSON-schema reference, e.g. "#/$defs/.../jobs.Task" or "#/$defs/string". + """ return ref.split("/")[-1] def _is_composite(ref: str) -> bool: + """Whether a ref is a composite type (list, map, object, or enum) rather than a scalar. + + :param ref: the JSON-schema reference of a field's type. + """ if ref.startswith(("#/$defs/slice/", "#/$defs/map/")): return True @@ -86,6 +94,11 @@ def _is_composite(ref: str) -> bool: def _synth_scalar(name: str, hint: str) -> _Scalar: + """Placeholder value for a primitive (str -> hint, int -> 0, float -> 0.0, bool -> True). + + :param name: the primitive's schema name, e.g. "string", "int", "boolean". + :param hint: enclosing field name, used as the string placeholder so examples read meaningfully. + """ if name == "string": return _Scalar(f'"{hint}"', f'"{hint}"') if name in ("integer", "int", "int64"): @@ -105,6 +118,14 @@ def _synth_ref( schemas: dict[str, openapi.Schema], visiting: set[str], ) -> _Value: + """Synthesize a value node for whatever type a ref points at: list, map, scalar, enum, or nested object. + + :param namespace: the resource's namespace (e.g. "jobs"); selects the module a referenced type is generated into. + :param ref: the JSON-schema reference of the type to synthesize. + :param hint: enclosing field name, passed through as the string placeholder. + :param schemas: all post-patch schemas keyed by schema name, for looking up nested/enum types. + :param visiting: ancestor object names on the current path, used to detect required cycles. + """ if ref.startswith("#/$defs/slice/"): element_ref = ref.replace("#/$defs/slice/", "#/$defs/") @@ -147,6 +168,15 @@ def _synth_object( visiting: set[str], top_level: bool, ) -> _Object: + """Synthesize an object value, choosing fields by policy: all required fields, plus (only at the resource top level) stable optional composite fields. + + :param namespace: the resource's namespace, threaded through to resolve nested types' modules. + :param schema_name: this object's schema name (e.g. "resources.Alert"). + :param schema: the Schema for this object -- its properties and required list. + :param schemas: all post-patch schemas, for recursing into nested types. + :param visiting: ancestor object names on the current path (cycle guard). + :param top_level: True only for the resource itself; when False, all optional fields are dropped. + """ visiting = visiting | {schema_name} fields: list[tuple[str, _Value]] = [] @@ -172,6 +202,11 @@ def _synth_object( def _module_of(namespace: str, schema_name: str) -> str: + """Python module a (non-primitive) schema's generated class lives in; asserts it exists. + + :param namespace: the resource's namespace; the type is generated under databricks.bundles.._models. + :param schema_name: the object/enum schema name to resolve. + """ module = packages.get_package(namespace, schema_name) assert module @@ -179,6 +214,10 @@ def _module_of(namespace: str, schema_name: str) -> str: def _render_dict(value: _Value) -> str: + """Render a synthesized value as a dict-literal source string (the dict_example form). + + :param value: the synthesized value node to render. + """ if isinstance(value, _Scalar): return value.dict_src if isinstance(value, _Enum): @@ -196,6 +235,10 @@ def _render_dict(value: _Value) -> str: def _render_dataclass(value: _Value) -> str: + """Render a synthesized value as a constructor-expression source string (the dataclass_example form). + + :param value: the synthesized value node to render. + """ if isinstance(value, _Scalar): return value.dataclass_src if isinstance(value, _Enum): @@ -213,6 +256,11 @@ def _render_dataclass(value: _Value) -> str: def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: + """Collect (module, class_name) pairs the dataclass_example needs, walking nested objects/enums. + + :param value: the synthesized value node to walk. + :param out: set accumulating the (module, class_name) import pairs; mutated in place. + """ if isinstance(value, _Enum): out.add((value.module, value.class_name)) elif isinstance(value, _Object): @@ -226,6 +274,11 @@ def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): + """Write one _generated/.py per wired resource plus the collector __init__.py. + + :param output: codegen output root (the python/ directory); files land under databricks_tests/core/_generated. + :param schemas: all post-patch schemas, used to synthesize each resource's dict/dataclass examples. + """ resources = _wired_resources() generated_path = Path(output) / "databricks_tests" / "core" / "_generated" @@ -263,6 +316,10 @@ def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): def _collector_code(resources: list[_WiredResource]) -> str: + """Source for _generated/__init__.py: imports the per-resource modules and assembles `test_cases`. + + :param resources: the wired resources, in the order their test cases are collected. + """ module_imports = "\n".join(f" {r.plural_name}," for r in resources) entries = "\n".join(f" {r.plural_name}._test_case()," for r in resources) From ec33340a77b5b81d3a620ba30c9ecd4dc1699444 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 15:04:11 +0000 Subject: [PATCH 32/52] Filter generated test-case fields by launch-stage maturity Skip optional top-level fields ranked below public preview (public-beta and private-preview), not just private-preview. Mirror the launch-stage rank from internal/clijson/launchstage.go (absent stage = GA) so the comparison uses maturity order rather than a string comparison. Drops jobs.triggers and pipelines.parameters from the generated examples. Co-authored-by: Isaac --- python/codegen/codegen/generated_test_cases.py | 16 +++++++++++++++- python/databricks_tests/core/_generated/jobs.py | 3 --- .../core/_generated/pipelines.py | 2 -- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index c3984879c46..8da404c8f0f 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -34,6 +34,16 @@ (Path(__file__).parent / "test_case.py.tmpl").read_text() ) +# Launch-stage maturity, mirroring internal/clijson/launchstage.go: +# GA < PUBLIC_PREVIEW < PUBLIC_BETA < PRIVATE_PREVIEW; absent stage = GA. +_STAGE_RANK = { + None: 0, + openapi.LaunchStage.GA: 0, + openapi.LaunchStage.PUBLIC_PREVIEW: 1, + openapi.LaunchStage.PUBLIC_BETA: 2, + openapi.LaunchStage.PRIVATE_PREVIEW: 3, +} + # Synthesized value tree. Each node renders both as a dict literal (dict_example) # and as a constructor expression (dataclass_example). @@ -190,7 +200,11 @@ def _synth_object( continue if not _is_composite(prop.ref): continue - if prop.deprecated or prop.stage == openapi.LaunchStage.PRIVATE_PREVIEW: + if ( + prop.deprecated + or _STAGE_RANK[prop.stage] + > _STAGE_RANK[openapi.LaunchStage.PUBLIC_PREVIEW] + ): continue value = _synth_ref(namespace, prop.ref, field_name, schemas, visiting) diff --git a/python/databricks_tests/core/_generated/jobs.py b/python/databricks_tests/core/_generated/jobs.py index 3a9dd6cec6d..878e916cd69 100644 --- a/python/databricks_tests/core/_generated/jobs.py +++ b/python/databricks_tests/core/_generated/jobs.py @@ -26,7 +26,6 @@ from databricks.bundles.jobs._models.performance_target import PerformanceTarget from databricks.bundles.jobs._models.queue_settings import QueueSettings from databricks.bundles.jobs._models.task import Task -from databricks.bundles.jobs._models.trigger_configuration import TriggerConfiguration from databricks.bundles.jobs._models.trigger_settings import TriggerSettings from databricks.bundles.jobs._models.webhook_notifications import WebhookNotifications from databricks_tests.core._resource_test_case import TestCase @@ -57,7 +56,6 @@ def _test_case(): "tags": {"key": "value"}, "tasks": [{"task_key": "task_key"}], "trigger": {}, - "triggers": [{}], "webhook_notifications": {}, }, dataclass_example=Job( @@ -83,7 +81,6 @@ def _test_case(): tags={"key": "value"}, tasks=[Task(task_key="task_key")], trigger=TriggerSettings(), - triggers=[TriggerConfiguration()], webhook_notifications=WebhookNotifications(), ), mutator=job_mutator, diff --git a/python/databricks_tests/core/_generated/pipelines.py b/python/databricks_tests/core/_generated/pipelines.py index a4e65573317..096a05e6012 100644 --- a/python/databricks_tests/core/_generated/pipelines.py +++ b/python/databricks_tests/core/_generated/pipelines.py @@ -37,7 +37,6 @@ def _test_case(): "libraries": [{}], "lifecycle": {}, "notifications": [{}], - "parameters": {"key": "value"}, "permissions": [{"level": "CAN_MANAGE"}], "run_as": {}, "tags": {"key": "value"}, @@ -52,7 +51,6 @@ def _test_case(): libraries=[PipelineLibrary()], lifecycle=Lifecycle(), notifications=[Notifications()], - parameters={"key": "value"}, permissions=[ PipelinePermission(level=PipelinePermissionLevel.CAN_MANAGE) ], From 5fcc59f263f250f945114f14cae0d13163b1c18e Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:19:38 +0000 Subject: [PATCH 33/52] add unit tests for the codegen to assert behaviour --- .../test_generated_test_cases.py | 350 ++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 python/codegen/codegen_tests/test_generated_test_cases.py diff --git a/python/codegen/codegen_tests/test_generated_test_cases.py b/python/codegen/codegen_tests/test_generated_test_cases.py new file mode 100644 index 00000000000..047749b5035 --- /dev/null +++ b/python/codegen/codegen_tests/test_generated_test_cases.py @@ -0,0 +1,350 @@ +"""Tests for generated_test_cases.py, the codegen that builds example resource +values for the generated pydabs test suite. + +For the unfamiliar: the generator reads a resource's JSON schema and synthesizes +one placeholder "value tree", then renders it two ways -- as a Python dict literal +and as a dataclass constructor call. Downstream tests use the pair to check that +converting the dict form yields the dataclass form. These tests cover the pieces +of that pipeline: parsing schema refs, synthesizing the value tree (and the rules +for which fields it includes), the two renderers, collecting the imports the +rendered code needs, and the source of the collector module that gathers it all. +""" + +import codegen.jsonschema as openapi +import pytest +from codegen.generated_test_cases import ( + _collect_imports, + _collector_code, + _Enum, + _is_composite, + _List, + _Map, + _Object, + _ref_name, + _render_dataclass, + _render_dict, + _Scalar, + _synth_object, + _synth_ref, + _synth_scalar, +) +from codegen.generated_wiring import _WiredResource +from codegen.jsonschema import Property, Schema, SchemaType + +# Full $refs as they appear in jsonschema.json; only the last segment is +# significant to the code under test, but keeping the SDK prefix makes the +# fixtures read like the real spec. +_SDK = "#/$defs/github.com/databricks/databricks-sdk-go/service" +_COND_REF = f"{_SDK}/sql.AlertCondition" +_OP_REF = f"{_SDK}/sql.ComparisonOperator" + + +# _ref_name pulls the type name (the last path segment) out of a schema $ref. +def test_ref_name(): + assert _ref_name(_COND_REF) == "sql.AlertCondition" + assert _ref_name("#/$defs/string") == "string" + + +# _is_composite separates refs that need recursive synthesis (list/map/object/enum) +# from plain scalar refs (string, int, ...). +def test_is_composite(): + assert _is_composite("#/$defs/slice/string") + assert _is_composite("#/$defs/map/string") + assert _is_composite(_COND_REF) + assert not _is_composite("#/$defs/string") + assert not _is_composite("#/$defs/int64") + + +# Each primitive type maps to a fixed placeholder value (a string uses the field +# name; numbers/bools use 0 / 0.0 / True). +@pytest.mark.parametrize( + "name,expected", + [ + ("string", _Scalar('"hint"', '"hint"')), + ("integer", _Scalar("0", "0")), + ("int", _Scalar("0", "0")), + ("int64", _Scalar("0", "0")), + ("number", _Scalar("0.0", "0.0")), + ("float64", _Scalar("0.0", "0.0")), + ("boolean", _Scalar("True", "True")), + ("bool", _Scalar("True", "True")), + ], +) +def test_synth_scalar(name, expected): + assert _synth_scalar(name, "hint") == expected + + +# An unrecognized primitive means the schema has a type the generator doesn't +# model, so it fails loudly rather than emitting a bad value. +def test_synth_scalar_unknown_raises(): + with pytest.raises(ValueError, match="Unknown primitive: duration"): + _synth_scalar("duration", "hint") + + +# A scalar ref uses the enclosing field's name as its string placeholder, so the +# generated example reads like "name" rather than a generic token. +def test_synth_ref_scalar_uses_field_name_as_hint(): + assert _synth_ref("jobs", "#/$defs/string", "name", {}, set()) == _Scalar( + '"name"', '"name"' + ) + + +# A list ref becomes a one-element list whose single item is synthesized from the +# element type. +def test_synth_ref_list_recurses_on_element(): + assert _synth_ref("jobs", "#/$defs/slice/string", "tags", {}, set()) == _List( + _Scalar('"tags"', '"tags"') + ) + + +# A map ref becomes one {"key": "value"} entry -- the generator only ever emits +# string-keyed, string-valued maps. +def test_synth_ref_map_is_always_string_keyed(): + assert _synth_ref("jobs", "#/$defs/map/string", "labels", {}, set()) == _Map( + "key", _Scalar('"value"', '"value"') + ) + + +# Any other kind of map is never produced, so hitting one fails loudly. +def test_synth_ref_non_string_map_raises(): + with pytest.raises(ValueError, match="Unsupported map ref"): + _synth_ref("jobs", "#/$defs/map/integer", "labels", {}, set()) + + +# An enum ref becomes an _Enum node carrying the chosen value plus the class name, +# module, and member the generated code will reference. +def test_synth_ref_enum(): + schemas = { + "sql.ComparisonOperator": Schema(type=SchemaType.STRING, enum=["greaterThan"]), + } + + assert _synth_ref("alerts", _OP_REF, "op", schemas, set()) == _Enum( + value="greaterThan", + class_name="ComparisonOperator", + module="databricks.bundles.alerts._models.comparison_operator", + member="GREATER_THAN", + ) + + +# A type that (transitively) requires itself has no finite example, so synthesis +# must detect the cycle and stop instead of recursing forever. +def test_synth_ref_required_cycle_raises(): + schemas = {"sql.AlertCondition": Schema(type=SchemaType.OBJECT)} + + # The referenced object is already on the current path: a required cycle has + # no finite value, so synthesis must fail rather than recurse forever. + with pytest.raises( + ValueError, match=r"Required-field cycle through 'sql.AlertCondition'" + ): + _synth_ref("alerts", _COND_REF, "condition", schemas, {"sql.AlertCondition"}) + + +# Which properties land in a resource's example: the field-selection policy. +def test_synth_object_field_policy(): + # A top-level resource keeps: all required fields (scalar + composite), and + # stable optional composite fields. It drops optional scalars. + schemas = { + "resources.Alert": Schema( + type=SchemaType.OBJECT, + properties={ + "display_name": Property(ref="#/$defs/string"), + "condition": Property(ref=_COND_REF), + "seconds_to_retrigger": Property(ref="#/$defs/int"), + "tags": Property(ref="#/$defs/slice/string"), + }, + required=["display_name", "condition"], + ), + "sql.AlertCondition": Schema( + type=SchemaType.OBJECT, + properties={ + "op": Property(ref="#/$defs/string"), + "threshold": Property(ref="#/$defs/slice/string"), + }, + required=["op"], + ), + } + + example = _synth_object( + "alerts", + "resources.Alert", + schemas["resources.Alert"], + schemas, + set(), + top_level=True, + ) + + assert example == _Object( + class_name="Alert", + module="databricks.bundles.alerts._models.alert", + fields=[ + ("display_name", _Scalar('"display_name"', '"display_name"')), + # Nested object contributes only its required field (op); the nested + # optional composite (threshold) is dropped because top_level is False. + ( + "condition", + _Object( + class_name="AlertCondition", + module="databricks.bundles.alerts._models.alert_condition", + fields=[("op", _Scalar('"op"', '"op"'))], + ), + ), + # seconds_to_retrigger (optional scalar) is dropped. + ("tags", _List(_Scalar('"tags"', '"tags"'))), + ], + ) + + +# An optional field is only included if it is "stable": deprecated fields and +# ones still in beta / private preview are left out (absent stage counts as GA). +@pytest.mark.parametrize( + "deprecated,stage,kept", + [ + (None, None, True), + (None, openapi.LaunchStage.PUBLIC_PREVIEW, True), + (True, None, False), + (None, openapi.LaunchStage.PUBLIC_BETA, False), + (None, openapi.LaunchStage.PRIVATE_PREVIEW, False), + ], +) +def test_synth_object_optional_composite_stability(deprecated, stage, kept): + schemas = { + "resources.Alert": Schema( + type=SchemaType.OBJECT, + properties={ + "tags": Property( + ref="#/$defs/slice/string", deprecated=deprecated, stage=stage + ), + }, + required=[], + ), + } + + example = _synth_object( + "alerts", + "resources.Alert", + schemas["resources.Alert"], + schemas, + set(), + top_level=True, + ) + + assert bool(example.fields) == kept + + +# Inside a nested object (anything that isn't the resource itself) only required +# fields are kept, which keeps examples bounded. +def test_synth_object_nested_drops_all_optional(): + schemas = { + "sql.AlertCondition": Schema( + type=SchemaType.OBJECT, + properties={ + "op": Property(ref="#/$defs/string"), + "operand": Property(ref="#/$defs/slice/string"), + }, + required=["op"], + ), + } + + example = _synth_object( + "alerts", + "sql.AlertCondition", + schemas["sql.AlertCondition"], + schemas, + set(), + top_level=False, + ) + + assert [name for name, _ in example.fields] == ["op"] + + +# --- rendering ------------------------------------------------------------- + +_VALUE_TREE = _Object( + class_name="Alert", + module="databricks.bundles.alerts._models.alert", + fields=[ + ("display_name", _Scalar('"display_name"', '"display_name"')), + ( + "op", + _Enum( + value="greaterThan", + class_name="ComparisonOperator", + module="databricks.bundles.alerts._models.comparison_operator", + member="GREATER_THAN", + ), + ), + ("tags", _List(_Scalar('"tags"', '"tags"'))), + ("labels", _Map("key", _Scalar('"value"', '"value"'))), + ], +) + + +# Rendering a value tree as a Python dict-literal string (the "dict_example" form). +def test_render_dict(): + assert _render_dict(_VALUE_TREE) == ( + '{"display_name": "display_name", "op": "greaterThan", ' + '"tags": ["tags"], "labels": {"key": "value"}}' + ) + + +# Rendering the same tree as a dataclass-constructor string (the "dataclass_example" +# form); the two renderers must agree on structure but differ on enums. +def test_render_dataclass(): + # Enums render as a class member reference, unlike the dict form's raw string. + assert _render_dataclass(_VALUE_TREE) == ( + 'Alert(display_name="display_name", op=ComparisonOperator.GREATER_THAN, ' + 'tags=["tags"], labels={"key": "value"})' + ) + + +# The dataclass example references object and enum classes; this collects the +# (module, class) imports it needs, reaching into lists and maps to find them. +def test_collect_imports_gathers_objects_and_enums_through_containers(): + out: set[tuple[str, str]] = set() + _collect_imports(_VALUE_TREE, out) + + assert out == { + ("databricks.bundles.alerts._models.alert", "Alert"), + ("databricks.bundles.alerts._models.comparison_operator", "ComparisonOperator"), + } + + +# A tree of only primitives references no classes, so it needs no imports. +def test_collect_imports_scalar_only_tree_is_empty(): + out: set[tuple[str, str]] = set() + _collect_imports(_Scalar('"x"', '"x"'), out) + + assert out == set() + + +# Source of the _generated/__init__.py that imports each resource's module and +# gathers their test cases into a single `test_cases` list. +def test_collector_code(): + resources = [ + _WiredResource( + class_name="Alert", + singular_name="alert", + plural_name="alerts", + model_module="databricks.bundles.alerts._models.alert", + ), + _WiredResource( + class_name="Job", + singular_name="job", + plural_name="jobs", + model_module="databricks.bundles.jobs._models.job", + ), + ] + + assert _collector_code(resources) == ( + "from databricks_tests.core._generated import (\n" + " alerts,\n" + " jobs,\n" + ")\n" + "\n" + '__all__ = ["test_cases"]\n' + "\n" + "test_cases = [\n" + " alerts._test_case(),\n" + " jobs._test_case(),\n" + "]\n" + ) From 49e68c8f118030edf0bb3bee36c51dedb71dc51e Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:54:18 +0000 Subject: [PATCH 34/52] Add pydabs-acceptance-test skill for authoring resource acceptance tests An AI Agent Skill that guides an agent to author the acceptance test for a newly-onboarded PyDABs resource: the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt). Includes fill-in templates (.tmpl so they stay out of linters). Complements the schema-synthesized unit-test generation; realistic field values are adapted from the resource's invariant config. Co-authored-by: Isaac --- .../skills/pydabs-acceptance-test/SKILL.md | 137 ++++++++++++++++++ .../templates/databricks.yml.tmpl | 15 ++ .../templates/mutators.py.tmpl | 11 ++ .../templates/resources.py.tmpl | 14 ++ .../templates/script.tmpl | 5 + .../templates/test.toml.tmpl | 7 + 6 files changed, 189 insertions(+) create mode 100644 .agents/skills/pydabs-acceptance-test/SKILL.md create mode 100644 .agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/script.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl diff --git a/.agents/skills/pydabs-acceptance-test/SKILL.md b/.agents/skills/pydabs-acceptance-test/SKILL.md new file mode 100644 index 00000000000..466177d0856 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/SKILL.md @@ -0,0 +1,137 @@ +--- +name: pydabs-acceptance-test +description: "Author the acceptance test for a PyDABs (Python DABs) resource. Use when onboarding a new PyDABs resource, when the test_python_support_coverage guard fails for a resource, or when the user says 'add a pydabs acceptance test', 'write the acceptance test for ', or 'the -support test is missing'. Produces the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt)." +user-invocable: true +allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion +--- + +# Author a PyDABs resource acceptance test + +PyDABs acceptance tests are hand-written, one fixture per resource under +`acceptance/bundle/python/-support/`. The OpenAPI spec has no examples, so +the realistic field values come from the resource's invariant config and your own +judgement — not from a generator. This skill guides you through authoring that +fixture deterministically and verifying it. + +The coverage guard `test_python_support_coverage` +(`python/databricks_tests/core/test_python_support.py`) fails CI for any PyDABs +resource that lacks a `-support` fixture, so every newly-onboarded resource +must get one. This skill is how you close that gap. + +Worked reference: `acceptance/bundle/python/alerts-support/` (a resource with required +nested fields) and `acceptance/bundle/python/catalogs-support/` (a direct-engine-only +resource). Read both before starting — the fixture you write mirrors them. + +## Input + +The resource to cover, as its **plural** name (the `resources:` key in +`databricks.yml`, e.g. `alerts`, `volumes`). If given a singular or a Go/Python +type name, resolve it to the plural first (step 1). + +## Step 1 — Verify the resource is wired in PyDABs + +The fixture cannot work unless the resource's Python surface exists. Confirm all of: + +- The package `python/databricks/bundles//` exists and has a `_models/` + subdirectory (this is what marks it a generated resource package). +- `add_` is a method on `Resources` and `_mutator` is exported + from `databricks.bundles.core`: + + ```sh + grep -rn "def add_\|_mutator" python/databricks/bundles/core/ + ``` + +If any is missing, the resource is not wired yet — stop and onboard it in PyDABs +first (that is a separate task). Note the exact `` and `` names +(the dataclass, e.g. `Alert`) from `python/databricks/bundles//__init__.py`; +you need them for `resources.py` and `mutators.py`. + +## Step 2 — Find the resource's required fields + +The generated dataclass is the source of truth. In +`python/databricks/bundles//_models/.py`, required fields are typed +`VariableOr[...]` (no default); optional fields are `VariableOrOptional[...] = None`. +You must set every required field, including required fields of required nested +objects (recurse into their `_models` files). Optional fields are usually omitted. + +```sh +grep -nE "VariableOr\[|VariableOrOptional\[" python/databricks/bundles//_models/.py +``` + +## Step 3 — Get realistic values (adapt, don't copy) + +The invariant config `acceptance/bundle/invariant/configs/.yml.tmpl` shows +realistic values for the same resource. **Adapt** it — do not copy verbatim: + +- Replace `$UNIQUE_NAME`, `$TEST_DEFAULT_WAREHOUSE_ID`, and every other `$VAR` + interpolation with plain string literals. This test runs locally with no cloud and + no variable substitution. +- Drop cloud-only / IAM blocks the invariant config carries for its real-workspace + run: `permissions`, `grants`, `file_path` pointing at an external asset, etc. Keep + the fixture to the resource's own fields so `bundle validate` is deterministic. + +If no invariant config exists, invent plausible literals that satisfy the field types +(a display name string, an enum's first member, a cron string, etc.). + +## Step 4 — Write the six fixture files + +Copy each `templates/*.tmpl` into `acceptance/bundle/python/-support/`, +dropping the `.tmpl` suffix (e.g. `resources.py.tmpl` → `resources.py`), and fill +them in. The `.tmpl` suffix keeps the placeholder files out of the repo's linters; +the copied fixture files are real Python/YAML/TOML and must pass lint (step 7). +Placeholders: `PLURAL`, `SINGULAR`, `CLASS`, `NAME` (a short stem, e.g. `alert`), +`FIELD` (a required **string** field to mutate). + +1. **`databricks.yml`** — `bundle.name: my_project`, `sync: {paths: []}`, a top-level + `python:` block wiring `resources:load_resources` and `mutators:update_`, + and one YAML-declared resource `resources..my__1` with all required + fields. (`bundle validate` normalizes the `python:` key to `experimental.python` + in the output — that is expected, don't fight it.) +2. **`resources.py`** — `load_resources()` adds a second instance `my__2` via + `resources.add_(...)`, same required fields, slightly different values. +3. **`mutators.py`** — a `@_mutator` that `assert isinstance(...)` on a + required string field and `replace(...)`s it to append `" (updated)"`. The mutator + runs on **both** instances, so the golden shows the transform applied to each. +4. **`script`** — copy `templates/script` verbatim (`bundle validate --output json` + piped through `jq "pick(.experimental.python, .resources)"`). +5. **`test.toml`** — `Cloud = false`. Add `EnvMatrix.PYDAB_VERSION = ["current"]` for + a brand-new resource (it only exists in the current wheel, not the pinned older + one). Add `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]` only for a direct-only + resource — terraform is deprecated, so never add a `["terraform", "direct"]` + matrix. When unsure, copy the engine convention from the newest existing fixture + (`catalogs-support`), not an old one. +6. **`output.txt`** — do NOT hand-write; generate it in step 5. + +## Step 5 — Generate the golden output + +```sh +go test ./acceptance -run 'TestAccept/bundle/python/-support' -update +``` + +(or `./task test-update` to regenerate the whole suite). This writes `output.txt`. +Inspect it: both `my__1` and `my__2` must appear with the mutated field +showing `" (updated)"`, and only `experimental.python` + `resources` keys are present. + +## Step 6 — Verify it reproduces deterministically + +Re-run **without** `-update`. It must pass against the golden you just generated: + +```sh +go test ./acceptance -run 'TestAccept/bundle/python/-support' -count=1 +``` + +A test that only passes with `-update` is nondeterministic — investigate before +finishing (a `$VAR` left in a value, a non-deterministic field, an EnvMatrix variant +producing different output). Never stop at "golden written". + +## Step 7 — Confirm coverage and format + +```sh +(cd python && uv run --python 3.11 pytest databricks_tests/core/test_python_support.py) +./task fmt && ./task lint-q +``` + +`test_python_support_coverage` should now be green for this resource. If the resource +was previously in the `_LACKING` allowlist +(`python/databricks_tests/core/test_python_support.py`), remove its entry — the list +only shrinks. diff --git a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl new file mode 100644 index 00000000000..18f303dd816 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl @@ -0,0 +1,15 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_SINGULAR" + +resources: + PLURAL: + my_NAME_1: + # required fields, realistic literal values (see SKILL.md steps 2-3) diff --git a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl new file mode 100644 index 00000000000..4a2bfb94d89 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.PLURAL import CLASS +from databricks.bundles.core import SINGULAR_mutator + + +@SINGULAR_mutator +def update_SINGULAR(SINGULAR: CLASS) -> CLASS: + assert isinstance(SINGULAR.FIELD, str) + + return replace(SINGULAR, FIELD=f"{SINGULAR.FIELD} (updated)") diff --git a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl new file mode 100644 index 00000000000..9360bec828a --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl @@ -0,0 +1,14 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_SINGULAR( + "my_NAME_2", + { + # same required fields as _1, slightly different values + }, + ) + + return resources diff --git a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl new file mode 100644 index 00000000000..4935b9b020a --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# new resource, only in the current wheel: +# EnvMatrix.PYDAB_VERSION = ["current"] + +# direct-only resource (terraform is deprecated): +# EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] From 0bf8684ce8b73878b7e560322bc1cdc5e420dff5 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:54:19 +0000 Subject: [PATCH 35/52] Assert every PyDABs resource has an acceptance test test_python_support_coverage fails until each resource in the _ResourceType registry has an acceptance/bundle/python/-support/ fixture, so coverage cannot silently regress as resources are onboarded. Mirrors the invariant-config coverage guard; shrink-only _LACKING allowlist ({jobs}, whose coverage predates the convention). Lives in the python test suite (runs in CI via pydabs-test) since it checks the filesystem rather than exercising the CLI. Co-authored-by: Isaac --- .../core/test_python_support.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 python/databricks_tests/core/test_python_support.py diff --git a/python/databricks_tests/core/test_python_support.py b/python/databricks_tests/core/test_python_support.py new file mode 100644 index 00000000000..ef8a113d56b --- /dev/null +++ b/python/databricks_tests/core/test_python_support.py @@ -0,0 +1,36 @@ +"""Coverage guard: every PyDABs resource must have an acceptance fixture. + +Asserts each resource in the _ResourceType registry has an +acceptance/bundle/python/-support/ fixture. New resources get one via the +pydabs-acceptance-test skill; this fails CI until it exists. +""" + +from pathlib import Path + +import pytest + +from databricks.bundles.core._resource_type import _ResourceType + +_ACCEPTANCE_DIR = Path(__file__).parents[3] / "acceptance" / "bundle" / "python" + +# Resources knowingly lacking a -support fixture. Shrink-only: the test fails +# if an entry here is actually covered, so gaps can only close. +_LACKING = { + # jobs predates the -support convention; covered across the suite instead. + "jobs", +} + +_PLURALS = sorted(t.plural_name for t in _ResourceType.all()) + + +@pytest.mark.parametrize("plural", _PLURALS) +def test_python_support_coverage(plural: str): + covered = (_ACCEPTANCE_DIR / f"{plural}-support" / "databricks.yml").exists() + + if plural in _LACKING: + assert not covered, f"{plural!r} now has a fixture; remove it from _LACKING" + else: + assert covered, ( + f"no acceptance/bundle/python/{plural}-support/ fixture for {plural!r}; " + "author one with the pydabs-acceptance-test skill or add it to _LACKING" + ) From e3d407d8b741bab84a2861c5792dfad88c95bc04 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:00:03 +0000 Subject: [PATCH 36/52] Replace acceptance-test skill with an auto-loaded rule + README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per review feedback (skills aren't reliably loaded, and the examples plus a verbose failure are enough): drop the pydabs-acceptance-test skill in favor of the repo's dresources pattern — a path-scoped .agents/rules/ file (auto-loaded when working under acceptance/bundle/python/**) pointing to a concise acceptance/bundle/python/README.md that leans on the existing fixtures. Retarget the coverage guard's message at the README. Co-authored-by: Isaac --- .agents/rules/pydabs-acceptance-tests.md | 8 + .../skills/pydabs-acceptance-test/SKILL.md | 137 ------------------ .../templates/databricks.yml.tmpl | 15 -- .../templates/mutators.py.tmpl | 11 -- .../templates/resources.py.tmpl | 14 -- .../templates/script.tmpl | 5 - .../templates/test.toml.tmpl | 7 - acceptance/bundle/python/README.md | 48 ++++++ .../core/test_python_support.py | 6 +- 9 files changed, 59 insertions(+), 192 deletions(-) create mode 100644 .agents/rules/pydabs-acceptance-tests.md delete mode 100644 .agents/skills/pydabs-acceptance-test/SKILL.md delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/script.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl create mode 100644 acceptance/bundle/python/README.md diff --git a/.agents/rules/pydabs-acceptance-tests.md b/.agents/rules/pydabs-acceptance-tests.md new file mode 100644 index 00000000000..924540845e7 --- /dev/null +++ b/.agents/rules/pydabs-acceptance-tests.md @@ -0,0 +1,8 @@ +--- +description: Rules for authoring PyDABs resource acceptance tests +globs: acceptance/bundle/python/** +paths: + - "acceptance/bundle/python/**" +--- + +**RULE: Before adding a PyDABs resource acceptance test, read `acceptance/bundle/python/README.md`.** It covers the `-support/` fixture layout, how to source and adapt realistic field values, the version/engine `test.toml` knobs, and the determinism re-run. Every PyDABs resource needs one (enforced by `test_python_support_coverage`). diff --git a/.agents/skills/pydabs-acceptance-test/SKILL.md b/.agents/skills/pydabs-acceptance-test/SKILL.md deleted file mode 100644 index 466177d0856..00000000000 --- a/.agents/skills/pydabs-acceptance-test/SKILL.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -name: pydabs-acceptance-test -description: "Author the acceptance test for a PyDABs (Python DABs) resource. Use when onboarding a new PyDABs resource, when the test_python_support_coverage guard fails for a resource, or when the user says 'add a pydabs acceptance test', 'write the acceptance test for ', or 'the -support test is missing'. Produces the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt)." -user-invocable: true -allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion ---- - -# Author a PyDABs resource acceptance test - -PyDABs acceptance tests are hand-written, one fixture per resource under -`acceptance/bundle/python/-support/`. The OpenAPI spec has no examples, so -the realistic field values come from the resource's invariant config and your own -judgement — not from a generator. This skill guides you through authoring that -fixture deterministically and verifying it. - -The coverage guard `test_python_support_coverage` -(`python/databricks_tests/core/test_python_support.py`) fails CI for any PyDABs -resource that lacks a `-support` fixture, so every newly-onboarded resource -must get one. This skill is how you close that gap. - -Worked reference: `acceptance/bundle/python/alerts-support/` (a resource with required -nested fields) and `acceptance/bundle/python/catalogs-support/` (a direct-engine-only -resource). Read both before starting — the fixture you write mirrors them. - -## Input - -The resource to cover, as its **plural** name (the `resources:` key in -`databricks.yml`, e.g. `alerts`, `volumes`). If given a singular or a Go/Python -type name, resolve it to the plural first (step 1). - -## Step 1 — Verify the resource is wired in PyDABs - -The fixture cannot work unless the resource's Python surface exists. Confirm all of: - -- The package `python/databricks/bundles//` exists and has a `_models/` - subdirectory (this is what marks it a generated resource package). -- `add_` is a method on `Resources` and `_mutator` is exported - from `databricks.bundles.core`: - - ```sh - grep -rn "def add_\|_mutator" python/databricks/bundles/core/ - ``` - -If any is missing, the resource is not wired yet — stop and onboard it in PyDABs -first (that is a separate task). Note the exact `` and `` names -(the dataclass, e.g. `Alert`) from `python/databricks/bundles//__init__.py`; -you need them for `resources.py` and `mutators.py`. - -## Step 2 — Find the resource's required fields - -The generated dataclass is the source of truth. In -`python/databricks/bundles//_models/.py`, required fields are typed -`VariableOr[...]` (no default); optional fields are `VariableOrOptional[...] = None`. -You must set every required field, including required fields of required nested -objects (recurse into their `_models` files). Optional fields are usually omitted. - -```sh -grep -nE "VariableOr\[|VariableOrOptional\[" python/databricks/bundles//_models/.py -``` - -## Step 3 — Get realistic values (adapt, don't copy) - -The invariant config `acceptance/bundle/invariant/configs/.yml.tmpl` shows -realistic values for the same resource. **Adapt** it — do not copy verbatim: - -- Replace `$UNIQUE_NAME`, `$TEST_DEFAULT_WAREHOUSE_ID`, and every other `$VAR` - interpolation with plain string literals. This test runs locally with no cloud and - no variable substitution. -- Drop cloud-only / IAM blocks the invariant config carries for its real-workspace - run: `permissions`, `grants`, `file_path` pointing at an external asset, etc. Keep - the fixture to the resource's own fields so `bundle validate` is deterministic. - -If no invariant config exists, invent plausible literals that satisfy the field types -(a display name string, an enum's first member, a cron string, etc.). - -## Step 4 — Write the six fixture files - -Copy each `templates/*.tmpl` into `acceptance/bundle/python/-support/`, -dropping the `.tmpl` suffix (e.g. `resources.py.tmpl` → `resources.py`), and fill -them in. The `.tmpl` suffix keeps the placeholder files out of the repo's linters; -the copied fixture files are real Python/YAML/TOML and must pass lint (step 7). -Placeholders: `PLURAL`, `SINGULAR`, `CLASS`, `NAME` (a short stem, e.g. `alert`), -`FIELD` (a required **string** field to mutate). - -1. **`databricks.yml`** — `bundle.name: my_project`, `sync: {paths: []}`, a top-level - `python:` block wiring `resources:load_resources` and `mutators:update_`, - and one YAML-declared resource `resources..my__1` with all required - fields. (`bundle validate` normalizes the `python:` key to `experimental.python` - in the output — that is expected, don't fight it.) -2. **`resources.py`** — `load_resources()` adds a second instance `my__2` via - `resources.add_(...)`, same required fields, slightly different values. -3. **`mutators.py`** — a `@_mutator` that `assert isinstance(...)` on a - required string field and `replace(...)`s it to append `" (updated)"`. The mutator - runs on **both** instances, so the golden shows the transform applied to each. -4. **`script`** — copy `templates/script` verbatim (`bundle validate --output json` - piped through `jq "pick(.experimental.python, .resources)"`). -5. **`test.toml`** — `Cloud = false`. Add `EnvMatrix.PYDAB_VERSION = ["current"]` for - a brand-new resource (it only exists in the current wheel, not the pinned older - one). Add `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]` only for a direct-only - resource — terraform is deprecated, so never add a `["terraform", "direct"]` - matrix. When unsure, copy the engine convention from the newest existing fixture - (`catalogs-support`), not an old one. -6. **`output.txt`** — do NOT hand-write; generate it in step 5. - -## Step 5 — Generate the golden output - -```sh -go test ./acceptance -run 'TestAccept/bundle/python/-support' -update -``` - -(or `./task test-update` to regenerate the whole suite). This writes `output.txt`. -Inspect it: both `my__1` and `my__2` must appear with the mutated field -showing `" (updated)"`, and only `experimental.python` + `resources` keys are present. - -## Step 6 — Verify it reproduces deterministically - -Re-run **without** `-update`. It must pass against the golden you just generated: - -```sh -go test ./acceptance -run 'TestAccept/bundle/python/-support' -count=1 -``` - -A test that only passes with `-update` is nondeterministic — investigate before -finishing (a `$VAR` left in a value, a non-deterministic field, an EnvMatrix variant -producing different output). Never stop at "golden written". - -## Step 7 — Confirm coverage and format - -```sh -(cd python && uv run --python 3.11 pytest databricks_tests/core/test_python_support.py) -./task fmt && ./task lint-q -``` - -`test_python_support_coverage` should now be green for this resource. If the resource -was previously in the `_LACKING` allowlist -(`python/databricks_tests/core/test_python_support.py`), remove its entry — the list -only shrinks. diff --git a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl deleted file mode 100644 index 18f303dd816..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -bundle: - name: my_project - -sync: {paths: []} # don't need to copy files - -python: - resources: - - "resources:load_resources" - mutators: - - "mutators:update_SINGULAR" - -resources: - PLURAL: - my_NAME_1: - # required fields, realistic literal values (see SKILL.md steps 2-3) diff --git a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl deleted file mode 100644 index 4a2bfb94d89..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses import replace - -from databricks.bundles.PLURAL import CLASS -from databricks.bundles.core import SINGULAR_mutator - - -@SINGULAR_mutator -def update_SINGULAR(SINGULAR: CLASS) -> CLASS: - assert isinstance(SINGULAR.FIELD, str) - - return replace(SINGULAR, FIELD=f"{SINGULAR.FIELD} (updated)") diff --git a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl deleted file mode 100644 index 9360bec828a..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -from databricks.bundles.core import Resources - - -def load_resources() -> Resources: - resources = Resources() - - resources.add_SINGULAR( - "my_NAME_2", - { - # same required fields as _1, slightly different values - }, - ) - - return resources diff --git a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl deleted file mode 100644 index e273fb45a53..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl +++ /dev/null @@ -1,5 +0,0 @@ - -trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ - jq "pick(.experimental.python, .resources)" - -rm -fr .databricks __pycache__ diff --git a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl deleted file mode 100644 index 4935b9b020a..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -Cloud = false # tests don't interact with APIs - -# new resource, only in the current wheel: -# EnvMatrix.PYDAB_VERSION = ["current"] - -# direct-only resource (terraform is deprecated): -# EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/README.md b/acceptance/bundle/python/README.md new file mode 100644 index 00000000000..942af63a6aa --- /dev/null +++ b/acceptance/bundle/python/README.md @@ -0,0 +1,48 @@ +# PyDABs resource acceptance tests + +Each `-support/` directory is the acceptance test for one PyDABs resource. It +checks that the resource loads both from YAML and from Python and that a mutator runs +over it. `test_python_support_coverage` +(`python/databricks_tests/core/test_python_support.py`) requires every PyDABs resource +to have one, so a newly-onboarded resource needs a fixture here. + +Copy an existing one — `alerts-support/` (a resource with required nested fields) or +`catalogs-support/` (direct-engine only) are the canonical examples. A fixture is six +files: + +- `databricks.yml` — `bundle.name: my_project`, `sync: {paths: []}`, a top-level + `python:` block wiring `resources:load_resources` + `mutators:update_`, and + one YAML-declared instance `.my__1`. +- `resources.py` — `load_resources()` adds a second instance `my__2` via + `resources.add_(...)`. +- `mutators.py` — a `@_mutator` that appends `" (updated)"` to a required + string field; it runs over both instances. +- `script` — copy it verbatim (`bundle validate --output json | jq "pick(...)"`). +- `test.toml` — `Cloud = false`. +- `output.txt` — generated, never hand-written. + +## Authoring a new one + +1. Confirm the resource is wired: `python/databricks/bundles//` exists, and + `add_` / `_mutator` are in `databricks.bundles.core`. If not, it + must be onboarded in PyDABs first. +2. Required fields are the `VariableOr[...]` (no default) fields in + `python/databricks/bundles//_models/.py`; set all of them, + recursing into required nested objects. `VariableOrOptional[...] = None` fields are + optional — omit them. +3. Get realistic values from `acceptance/bundle/invariant/configs/.yml.tmpl`, + but **adapt**: replace `$UNIQUE_NAME` / `$TEST_DEFAULT_WAREHOUSE_ID` and other `$VAR`s + with plain literals, and drop cloud-only blocks (`permissions`, `grants`, + `file_path`) — this test is local and deterministic. +4. `test.toml`: add `EnvMatrix.PYDAB_VERSION = ["current"]` for a brand-new resource + (it only exists in the current wheel), and `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = + ["direct"]` for a direct-only resource (terraform is deprecated — never a + `["terraform", "direct"]` matrix). Match the newest fixture when unsure. +5. Generate the golden: + `go test ./acceptance -run 'TestAccept/bundle/python/-support' -update`. +6. **Re-run without `-update`** — it must pass against the golden you just generated. A + test that only passes with `-update` is nondeterministic (usually a `$VAR` or a + volatile field left in); fix it before finishing. + +Note: `bundle validate` normalizes the `python:` key to `experimental.python` in the +output — that's expected. diff --git a/python/databricks_tests/core/test_python_support.py b/python/databricks_tests/core/test_python_support.py index ef8a113d56b..41a68d86943 100644 --- a/python/databricks_tests/core/test_python_support.py +++ b/python/databricks_tests/core/test_python_support.py @@ -1,8 +1,8 @@ """Coverage guard: every PyDABs resource must have an acceptance fixture. Asserts each resource in the _ResourceType registry has an -acceptance/bundle/python/-support/ fixture. New resources get one via the -pydabs-acceptance-test skill; this fails CI until it exists. +acceptance/bundle/python/-support/ fixture (see that directory's README.md for +how to author one); this fails CI until it exists. """ from pathlib import Path @@ -32,5 +32,5 @@ def test_python_support_coverage(plural: str): else: assert covered, ( f"no acceptance/bundle/python/{plural}-support/ fixture for {plural!r}; " - "author one with the pydabs-acceptance-test skill or add it to _LACKING" + "add one (see acceptance/bundle/python/README.md) or add it to _LACKING" ) From ad9328e6d5aa985b00225566d1a23d9b29b00554 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:04:40 +0000 Subject: [PATCH 37/52] update skill --- acceptance/bundle/python/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acceptance/bundle/python/README.md b/acceptance/bundle/python/README.md index 942af63a6aa..ba49b04fb3e 100644 --- a/acceptance/bundle/python/README.md +++ b/acceptance/bundle/python/README.md @@ -36,8 +36,7 @@ files: `file_path`) — this test is local and deterministic. 4. `test.toml`: add `EnvMatrix.PYDAB_VERSION = ["current"]` for a brand-new resource (it only exists in the current wheel), and `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = - ["direct"]` for a direct-only resource (terraform is deprecated — never a - `["terraform", "direct"]` matrix). Match the newest fixture when unsure. + ["direct"]` for a direct-only resource. 5. Generate the golden: `go test ./acceptance -run 'TestAccept/bundle/python/-support' -update`. 6. **Re-run without `-update`** — it must pass against the golden you just generated. A From a2854cd3c2107526cf5cc843e87efa7860bdb5b1 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:17:18 +0000 Subject: [PATCH 38/52] Check that .cursor/rules mirror .agents/rules Add tools/validate_cursor_rules.py (wired into `task checks`) so a rule under .agents/rules/ without its .cursor/rules/.mdc symlink fails CI; `--fix` auto-creates missing symlinks and drops stale ones. Also add the symlink for the new pydabs-acceptance-tests rule. Co-authored-by: Isaac --- .cursor/rules/pydabs-acceptance-tests.mdc | 1 + Taskfile.yml | 8 ++- tools/validate_cursor_rules.py | 72 +++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 120000 .cursor/rules/pydabs-acceptance-tests.mdc create mode 100755 tools/validate_cursor_rules.py diff --git a/.cursor/rules/pydabs-acceptance-tests.mdc b/.cursor/rules/pydabs-acceptance-tests.mdc new file mode 120000 index 00000000000..ffe41d4bbea --- /dev/null +++ b/.cursor/rules/pydabs-acceptance-tests.mdc @@ -0,0 +1 @@ +../../.agents/rules/pydabs-acceptance-tests.md \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 4d905d92eaf..cac5443f11e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -313,8 +313,13 @@ tasks: cmds: - "! git grep -lF databricks.com -- '*uv.lock' '*.py.lock'" + check-cursor-rules: + desc: Fail if a .agents/rules/*.md lacks its .cursor/rules/*.mdc symlink (--fix adds it) + cmds: + - "./tools/validate_cursor_rules.py" + checks: - desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles) + desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles, cursor-rules) # Sequential: `tidy` rewrites go.mod/go.sum and any future tidy work # touching more paths should not race with the whitespace scanner. cmds: @@ -323,6 +328,7 @@ tasks: - task: deadcode - task: check-changelog - task: check-lockfiles + - task: check-cursor-rules install-pythons: desc: Install Python 3.9-3.13 via uv diff --git a/tools/validate_cursor_rules.py b/tools/validate_cursor_rules.py new file mode 100755 index 00000000000..3ef9ce58953 --- /dev/null +++ b/tools/validate_cursor_rules.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.12" +# /// +"""Keep .cursor/rules/*.mdc symlinks in sync with .agents/rules/*.md. + +The canonical rules live in .agents/rules/.md; Cursor reads them from +.cursor/rules/.mdc, so each rule needs a .mdc symlink pointing back at its +.md. This validates that every rule has a correct symlink and that no symlink is +left dangling. Run with --fix to create missing symlinks and drop stale ones. + +Non-symlink .mdc files (e.g. the standalone 00-agents-context.mdc bootstrap) are +not mirrors of a rule and are left untouched. +""" + +import os +import sys + +AGENTS_RULES = ".agents/rules" +CURSOR_RULES = ".cursor/rules" + + +def link_target(stem): + # The .mdc lives in .cursor/rules/, so ../../ reaches the repo root. + return f"../../{AGENTS_RULES}/{stem}.md" + + +def main(): + fix = "--fix" in sys.argv + + stems = sorted(f[:-3] for f in os.listdir(AGENTS_RULES) if f.endswith(".md")) + problems = [] + + # Every rule must have a .mdc symlink pointing at its .md. + for stem in stems: + mdc = os.path.join(CURSOR_RULES, stem + ".mdc") + want = link_target(stem) + have = os.readlink(mdc) if os.path.islink(mdc) else None + if have == want: + continue + if fix: + if os.path.lexists(mdc): + os.remove(mdc) + os.symlink(want, mdc) + print(f"Linked {mdc} -> {want}") + else: + problems.append(f"{mdc}: missing or wrong symlink, expected -> {want}") + + # No .mdc symlink may point at a rule that no longer exists. + known = {stem + ".mdc" for stem in stems} + for name in sorted(os.listdir(CURSOR_RULES)): + path = os.path.join(CURSOR_RULES, name) + if not os.path.islink(path) or name in known: + continue + if fix: + os.remove(path) + print(f"Removed stale {path}") + else: + problems.append(f"{path}: stale symlink, no matching {AGENTS_RULES}/ rule") + + if problems: + print("\n".join(problems)) + print( + f"\n{len(problems)} problem(s). Run: ./tools/validate_cursor_rules.py --fix", + file=sys.stderr, + ) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From fda42a717b2e012a0b153bc7adc4fbb88074b5ed Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:34:09 +0000 Subject: [PATCH 39/52] Drop cursor-rules symlink lint (moving to a separate PR) Remove tools/validate_cursor_rules.py and its check-cursor-rules task; the symlink-mirror check is being shipped on its own. Keep the .cursor/rules/pydabs-acceptance-tests.mdc symlink for the rule added here. Co-authored-by: Isaac --- Taskfile.yml | 8 +--- tools/validate_cursor_rules.py | 72 ---------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) delete mode 100755 tools/validate_cursor_rules.py diff --git a/Taskfile.yml b/Taskfile.yml index cac5443f11e..4d905d92eaf 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -313,13 +313,8 @@ tasks: cmds: - "! git grep -lF databricks.com -- '*uv.lock' '*.py.lock'" - check-cursor-rules: - desc: Fail if a .agents/rules/*.md lacks its .cursor/rules/*.mdc symlink (--fix adds it) - cmds: - - "./tools/validate_cursor_rules.py" - checks: - desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles, cursor-rules) + desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles) # Sequential: `tidy` rewrites go.mod/go.sum and any future tidy work # touching more paths should not race with the whitespace scanner. cmds: @@ -328,7 +323,6 @@ tasks: - task: deadcode - task: check-changelog - task: check-lockfiles - - task: check-cursor-rules install-pythons: desc: Install Python 3.9-3.13 via uv diff --git a/tools/validate_cursor_rules.py b/tools/validate_cursor_rules.py deleted file mode 100755 index 3ef9ce58953..00000000000 --- a/tools/validate_cursor_rules.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -# /// script -# requires-python = ">=3.12" -# /// -"""Keep .cursor/rules/*.mdc symlinks in sync with .agents/rules/*.md. - -The canonical rules live in .agents/rules/.md; Cursor reads them from -.cursor/rules/.mdc, so each rule needs a .mdc symlink pointing back at its -.md. This validates that every rule has a correct symlink and that no symlink is -left dangling. Run with --fix to create missing symlinks and drop stale ones. - -Non-symlink .mdc files (e.g. the standalone 00-agents-context.mdc bootstrap) are -not mirrors of a rule and are left untouched. -""" - -import os -import sys - -AGENTS_RULES = ".agents/rules" -CURSOR_RULES = ".cursor/rules" - - -def link_target(stem): - # The .mdc lives in .cursor/rules/, so ../../ reaches the repo root. - return f"../../{AGENTS_RULES}/{stem}.md" - - -def main(): - fix = "--fix" in sys.argv - - stems = sorted(f[:-3] for f in os.listdir(AGENTS_RULES) if f.endswith(".md")) - problems = [] - - # Every rule must have a .mdc symlink pointing at its .md. - for stem in stems: - mdc = os.path.join(CURSOR_RULES, stem + ".mdc") - want = link_target(stem) - have = os.readlink(mdc) if os.path.islink(mdc) else None - if have == want: - continue - if fix: - if os.path.lexists(mdc): - os.remove(mdc) - os.symlink(want, mdc) - print(f"Linked {mdc} -> {want}") - else: - problems.append(f"{mdc}: missing or wrong symlink, expected -> {want}") - - # No .mdc symlink may point at a rule that no longer exists. - known = {stem + ".mdc" for stem in stems} - for name in sorted(os.listdir(CURSOR_RULES)): - path = os.path.join(CURSOR_RULES, name) - if not os.path.islink(path) or name in known: - continue - if fix: - os.remove(path) - print(f"Removed stale {path}") - else: - problems.append(f"{path}: stale symlink, no matching {AGENTS_RULES}/ rule") - - if problems: - print("\n".join(problems)) - print( - f"\n{len(problems)} problem(s). Run: ./tools/validate_cursor_rules.py --fix", - file=sys.stderr, - ) - return 1 - return 0 - - -if __name__ == "__main__": - sys.exit(main()) From 161095c25c940410f9dadbf2253dfbcdb2af89ad Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:22:34 +0000 Subject: [PATCH 40/52] Test the dataclass path in test_add_resource_type test_add_resource_type and test_add_resource_type_dict had byte-identical bodies, both feeding dict_example, so the add_(dataclass) normalization path went untested for the parametrized resources. Feed dataclass_example to the non-_dict variant, mirroring test_add_job vs test_add_job_dict. Co-authored-by: Isaac --- python/databricks_tests/core/test_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/databricks_tests/core/test_resources.py b/python/databricks_tests/core/test_resources.py index ee2ab7ec405..e27b4331db2 100644 --- a/python/databricks_tests/core/test_resources.py +++ b/python/databricks_tests/core/test_resources.py @@ -163,7 +163,7 @@ def test_add_resource_type(tc: TestCase, tpe: _ResourceType): resources, **{ "resource_name": "my_resource", - tpe.singular_name: tc.dict_example, + tpe.singular_name: tc.dataclass_example, }, ) From a09b78e878eddda84b66ebfbc7b452518377325b Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:22:56 +0000 Subject: [PATCH 41/52] Generate per-resource unit-test cases from the codegen model Stop hand-writing a TestCase per resource in test_resources.py. A new codegen step (generated_test_cases.py, rendered from test_case.py.tmpl) synthesizes dict_example and dataclass_example for every wired resource from the schema model and writes one file per resource under databricks_tests/core/_generated/, collected into test_cases. A newly wired resource now gets its unit-test coverage for free. dict_example and dataclass_example are rendered two independent ways from one synthesized value tree, so the dict->dataclass _transform assertion stays meaningful. Field policy: required fields fully expanded, plus optional composite fields on the resource itself; nested objects contribute only their required fields, which bounds example size and avoids the recursive Task/ForEachTask schema. Optional scalar, deprecated, and private-preview fields are omitted. The hand-written TestCase dataclass moves to _resource_test_case.py so the generated modules can import it without a cycle. Co-authored-by: Isaac --- python/Taskfile.yml | 2 + .../codegen/codegen/generated_test_cases.py | 278 ++++++++++++++++++ python/codegen/codegen/main.py | 4 + python/codegen/codegen/test_case.py.tmpl | 16 + python/databricks_tests/.gitattributes | 4 + .../core/_generated/__init__.py | 21 ++ .../core/_generated/alerts.py | 58 ++++ .../core/_generated/catalogs.py | 35 +++ .../databricks_tests/core/_generated/jobs.py | 92 ++++++ .../core/_generated/pipelines.py | 65 ++++ .../core/_generated/schemas.py | 32 ++ .../core/_generated/volumes.py | 35 +++ .../core/_resource_test_case.py | 12 + .../databricks_tests/core/test_resources.py | 129 +------- 14 files changed, 659 insertions(+), 124 deletions(-) create mode 100644 python/codegen/codegen/generated_test_cases.py create mode 100644 python/codegen/codegen/test_case.py.tmpl create mode 100644 python/databricks_tests/.gitattributes create mode 100644 python/databricks_tests/core/_generated/__init__.py create mode 100644 python/databricks_tests/core/_generated/alerts.py create mode 100644 python/databricks_tests/core/_generated/catalogs.py create mode 100644 python/databricks_tests/core/_generated/jobs.py create mode 100644 python/databricks_tests/core/_generated/pipelines.py create mode 100644 python/databricks_tests/core/_generated/schemas.py create mode 100644 python/databricks_tests/core/_generated/volumes.py create mode 100644 python/databricks_tests/core/_resource_test_case.py diff --git a/python/Taskfile.yml b/python/Taskfile.yml index 602e92028a5..49621efd6a6 100644 --- a/python/Taskfile.yml +++ b/python/Taskfile.yml @@ -78,6 +78,8 @@ tasks: -exec rm -rf {} \; # core/ is hand-written except for the generated wiring under _generated/. - rm -rf databricks/bundles/core/_generated + # test_resources.py is hand-written except for the generated TestCase data. + - rm -rf databricks_tests/core/_generated - cd codegen && uv run -m pytest codegen_tests - cd codegen && uv run -m codegen.main --output .. # Generated code is fixed and formatted by the global ruff (see ../ruff.toml). diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py new file mode 100644 index 00000000000..7decc29a897 --- /dev/null +++ b/python/codegen/codegen/generated_test_cases.py @@ -0,0 +1,278 @@ +""" +Generates the per-resource TestCase data driving databricks_tests/core/test_resources.py. + +For every wired resource a file _generated/.py is written (rendered from +test_case.py.tmpl) exposing _test_case() -> (TestCase, _ResourceType). The generated +_generated/__init__.py collects them into `test_cases`, which test_resources.py imports +and parametrizes its per-resource tests off. + +dict_example and dataclass_example are synthesized from one value tree and rendered two +independent ways -- a dict literal and a constructor expression -- so the dict->dataclass +_transform assertion in test_resources.py stays meaningful (the two forms don't share the +runtime transform path). + +Field policy: all required fields (fully expanded), plus optional composite fields +(nested dataclass / list / map / enum) on the resource itself; nested objects contribute +only their required fields, which keeps examples bounded and avoids recursive schemas +(e.g. jobs Task -> ForEachTask -> Task, reachable only through an optional field). Optional +scalar, deprecated, and experimental fields are omitted. +""" + +from dataclasses import dataclass +from pathlib import Path +from string import Template +from typing import Union + +import codegen.jsonschema as openapi +import codegen.packages as packages +from codegen.generated_enum import _camel_to_upper_snake +from codegen.generated_wiring import _WiredResource, _wired_resources + +HEADER = "# Code generated by pydabs-codegen. DO NOT EDIT.\n\n" + +_TEST_CASE_TEMPLATE = Template( + (Path(__file__).parent / "test_case.py.tmpl").read_text() +) + + +# Synthesized value tree. Each node renders both as a dict literal (dict_example) +# and as a constructor expression (dataclass_example). + + +@dataclass +class _Scalar: + dict_src: str + dataclass_src: str + + +@dataclass +class _Enum: + value: str + class_name: str + module: str + member: str + + +@dataclass +class _Object: + class_name: str + module: str + fields: "list[tuple[str, _Value]]" + + +@dataclass +class _List: + item: "_Value" + + +@dataclass +class _Map: + key: str + value: "_Value" + + +_Value = Union[_Scalar, _Enum, _Object, _List, _Map] + + +def _ref_name(ref: str) -> str: + return ref.split("/")[-1] + + +def _is_composite(ref: str) -> bool: + if ref.startswith("#/$defs/slice/") or ref.startswith("#/$defs/map/"): + return True + + return _ref_name(ref) not in packages.PRIMITIVES + + +def _synth_scalar(name: str, hint: str) -> _Scalar: + if name == "string": + return _Scalar(f'"{hint}"', f'"{hint}"') + if name in ("integer", "int", "int64"): + return _Scalar("0", "0") + if name in ("number", "float", "float64"): + return _Scalar("0.0", "0.0") + if name in ("boolean", "bool"): + return _Scalar("True", "True") + + raise ValueError(f"Unknown primitive: {name}") + + +def _synth_ref( + namespace: str, + ref: str, + hint: str, + schemas: dict[str, openapi.Schema], + visiting: set[str], +) -> _Value: + if ref.startswith("#/$defs/slice/"): + element_ref = ref.replace("#/$defs/slice/", "#/$defs/") + + return _List(_synth_ref(namespace, element_ref, hint, schemas, visiting)) + + if ref.startswith("#/$defs/map/"): + # generate_type only ever produces dict[str, str] maps (map/string). + if ref != "#/$defs/map/string": + raise ValueError(f"Unsupported map ref: {ref}") + + return _Map("key", _Scalar('"value"', '"value"')) + + name = _ref_name(ref) + if name in packages.PRIMITIVES: + return _synth_scalar(name, hint) + + schema = schemas[name] + class_name = packages.get_class_name(ref) + module = packages.get_package(namespace, ref) + assert module + + if schema.type == openapi.SchemaType.STRING: + value = schema.enum[0] + + return _Enum(value, class_name, module, _camel_to_upper_snake(value)) + + # Only reachable through required fields at this depth (see _synth_object); a + # required cycle has no finite value, so fail loudly instead of looping. + if name in visiting: + raise ValueError(f"Required-field cycle through '{name}'") + + return _synth_object(namespace, name, schema, schemas, visiting, top_level=False) + + +def _synth_object( + namespace: str, + schema_name: str, + schema: openapi.Schema, + schemas: dict[str, openapi.Schema], + visiting: set[str], + top_level: bool, +) -> _Object: + visiting = visiting | {schema_name} + fields: list[tuple[str, _Value]] = [] + + for field_name, prop in schema.properties.items(): + required = field_name in schema.required + + if not required: + # Nested objects contribute only required fields; on the resource + # itself, also include stable optional composite fields. + if not top_level: + continue + if not _is_composite(prop.ref): + continue + if prop.deprecated or prop.stage == openapi.LaunchStage.PRIVATE_PREVIEW: + continue + + value = _synth_ref(namespace, prop.ref, field_name, schemas, visiting) + fields.append((field_name, value)) + + return _Object( + packages.get_class_name(schema_name), _module_of(namespace, schema_name), fields + ) + + +def _module_of(namespace: str, schema_name: str) -> str: + module = packages.get_package(namespace, schema_name) + assert module + + return module + + +def _render_dict(value: _Value) -> str: + if isinstance(value, _Scalar): + return value.dict_src + if isinstance(value, _Enum): + return f'"{value.value}"' + if isinstance(value, _List): + return f"[{_render_dict(value.item)}]" + if isinstance(value, _Map): + return "{" + f'"{value.key}": {_render_dict(value.value)}' + "}" + + fields = ", ".join( + f'"{name}": {_render_dict(child)}' for name, child in value.fields + ) + + return "{" + fields + "}" + + +def _render_dataclass(value: _Value) -> str: + if isinstance(value, _Scalar): + return value.dataclass_src + if isinstance(value, _Enum): + return f"{value.class_name}.{value.member}" + if isinstance(value, _List): + return f"[{_render_dataclass(value.item)}]" + if isinstance(value, _Map): + return "{" + f'"{value.key}": {_render_dataclass(value.value)}' + "}" + + fields = ", ".join( + f"{name}={_render_dataclass(child)}" for name, child in value.fields + ) + + return f"{value.class_name}({fields})" + + +def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: + if isinstance(value, _Enum): + out.add((value.module, value.class_name)) + elif isinstance(value, _Object): + out.add((value.module, value.class_name)) + for _, child in value.fields: + _collect_imports(child, out) + elif isinstance(value, _List): + _collect_imports(value.item, out) + elif isinstance(value, _Map): + _collect_imports(value.value, out) + + +def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): + resources = _wired_resources() + + generated_path = Path(output) / "databricks_tests" / "core" / "_generated" + generated_path.mkdir(parents=True, exist_ok=True) + + plural_to_ref = {ns: ref for ref, ns in packages.RESOURCE_NAMESPACE.items()} + + for r in resources: + resource_ref = plural_to_ref[r.plural_name] + schema = schemas[resource_ref] + + example = _synth_object( + r.plural_name, resource_ref, schema, schemas, set(), top_level=True + ) + + imports: set[tuple[str, str]] = set() + _collect_imports(example, imports) + model_imports = "\n".join( + f"from {module} import {class_name}" + for module, class_name in sorted(imports) + ) + + code = _TEST_CASE_TEMPLATE.substitute( + singular=r.singular_name, + plural=r.plural_name, + model_imports=model_imports, + dict_example=_render_dict(example), + dataclass_example=_render_dataclass(example), + ) + (generated_path / f"{r.plural_name}.py").write_text(HEADER + code) + + (generated_path / "__init__.py").write_text(HEADER + _collector_code(resources)) + + print(f"Writing test cases into {generated_path}") + + +def _collector_code(resources: list[_WiredResource]) -> str: + module_imports = "\n".join(f" {r.plural_name}," for r in resources) + entries = "\n".join(f" {r.plural_name}._test_case()," for r in resources) + + return f"""from databricks_tests.core._generated import ( +{module_imports} +) + +__all__ = ["test_cases"] + +test_cases = [ +{entries} +] +""" diff --git a/python/codegen/codegen/main.py b/python/codegen/codegen/main.py index 7927da85961..924ec269e88 100644 --- a/python/codegen/codegen/main.py +++ b/python/codegen/codegen/main.py @@ -8,6 +8,7 @@ import codegen.generated_dataclass_patch as generated_dataclass_patch import codegen.generated_enum as generated_enum import codegen.generated_imports as generated_imports +import codegen.generated_test_cases as generated_test_cases import codegen.generated_wiring as generated_wiring import codegen.jsonschema as openapi import codegen.jsonschema_patch as openapi_patch @@ -52,6 +53,9 @@ def main(output: str): # decorators, and the core package __init__). generated_wiring.write_wiring(output) + # Generate the per-resource TestCase data driving test_resources.py. + generated_test_cases.write_test_cases(output, schemas) + def _transitively_mark_deprecated_and_private( roots: list[str], diff --git a/python/codegen/codegen/test_case.py.tmpl b/python/codegen/codegen/test_case.py.tmpl new file mode 100644 index 00000000000..8abe9d1ce5e --- /dev/null +++ b/python/codegen/codegen/test_case.py.tmpl @@ -0,0 +1,16 @@ +from databricks.bundles.core import Resources, ${singular}_mutator +from databricks.bundles.core._generated.${plural} import _resource_type +from databricks_tests.core._resource_test_case import TestCase +$model_imports + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_${singular}, + dict_example=$dict_example, + dataclass_example=$dataclass_example, + mutator=${singular}_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/.gitattributes b/python/databricks_tests/.gitattributes new file mode 100644 index 00000000000..810eb0c20ec --- /dev/null +++ b/python/databricks_tests/.gitattributes @@ -0,0 +1,4 @@ +# Generated by pydabs-codegen (see python/codegen). The per-resource TestCase +# data under core/_generated/ drives the parametrized tests in test_resources.py; +# the rest of databricks_tests/ is hand-written. +core/_generated/** linguist-generated=true diff --git a/python/databricks_tests/core/_generated/__init__.py b/python/databricks_tests/core/_generated/__init__.py new file mode 100644 index 00000000000..9cf2cc18cee --- /dev/null +++ b/python/databricks_tests/core/_generated/__init__.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks_tests.core._generated import ( + alerts, + catalogs, + jobs, + pipelines, + schemas, + volumes, +) + +__all__ = ["test_cases"] + +test_cases = [ + alerts._test_case(), + catalogs._test_case(), + jobs._test_case(), + pipelines._test_case(), + schemas._test_case(), + volumes._test_case(), +] diff --git a/python/databricks_tests/core/_generated/alerts.py b/python/databricks_tests/core/_generated/alerts.py new file mode 100644 index 00000000000..ec85f6daeae --- /dev/null +++ b/python/databricks_tests/core/_generated/alerts.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.alerts._models.alert import Alert +from databricks.bundles.alerts._models.alert_v2_evaluation import AlertV2Evaluation +from databricks.bundles.alerts._models.alert_v2_operand_column import ( + AlertV2OperandColumn, +) +from databricks.bundles.alerts._models.alert_v2_run_as import AlertV2RunAs +from databricks.bundles.alerts._models.comparison_operator import ComparisonOperator +from databricks.bundles.alerts._models.cron_schedule import CronSchedule +from databricks.bundles.alerts._models.lifecycle import Lifecycle +from databricks.bundles.alerts._models.permission import Permission +from databricks.bundles.alerts._models.permission_level import PermissionLevel +from databricks.bundles.core import Resources, alert_mutator +from databricks.bundles.core._generated.alerts import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_alert, + dict_example={ + "display_name": "display_name", + "evaluation": { + "comparison_operator": "LESS_THAN", + "source": {"name": "name"}, + }, + "lifecycle": {}, + "permissions": [{"level": "CAN_MANAGE"}], + "query_text": "query_text", + "run_as": {}, + "schedule": { + "quartz_cron_schedule": "quartz_cron_schedule", + "timezone_id": "timezone_id", + }, + "warehouse_id": "warehouse_id", + }, + dataclass_example=Alert( + display_name="display_name", + evaluation=AlertV2Evaluation( + comparison_operator=ComparisonOperator.LESS_THAN, + source=AlertV2OperandColumn(name="name"), + ), + lifecycle=Lifecycle(), + permissions=[Permission(level=PermissionLevel.CAN_MANAGE)], + query_text="query_text", + run_as=AlertV2RunAs(), + schedule=CronSchedule( + quartz_cron_schedule="quartz_cron_schedule", + timezone_id="timezone_id", + ), + warehouse_id="warehouse_id", + ), + mutator=alert_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/catalogs.py b/python/databricks_tests/core/_generated/catalogs.py new file mode 100644 index 00000000000..177ada20428 --- /dev/null +++ b/python/databricks_tests/core/_generated/catalogs.py @@ -0,0 +1,35 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.catalogs._models.catalog import Catalog +from databricks.bundles.catalogs._models.encryption_settings import EncryptionSettings +from databricks.bundles.catalogs._models.lifecycle import Lifecycle +from databricks.bundles.catalogs._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.core import Resources, catalog_mutator +from databricks.bundles.core._generated.catalogs import _resource_type +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_catalog, + dict_example={ + "grants": [{}], + "lifecycle": {}, + "managed_encryption_settings": {}, + "name": "name", + "options": {"key": "value"}, + "properties": {"key": "value"}, + }, + dataclass_example=Catalog( + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + managed_encryption_settings=EncryptionSettings(), + name="name", + options={"key": "value"}, + properties={"key": "value"}, + ), + mutator=catalog_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/jobs.py b/python/databricks_tests/core/_generated/jobs.py new file mode 100644 index 00000000000..3a9dd6cec6d --- /dev/null +++ b/python/databricks_tests/core/_generated/jobs.py @@ -0,0 +1,92 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, job_mutator +from databricks.bundles.core._generated.jobs import _resource_type +from databricks.bundles.jobs._models.continuous import Continuous +from databricks.bundles.jobs._models.cron_schedule import CronSchedule +from databricks.bundles.jobs._models.git_provider import GitProvider +from databricks.bundles.jobs._models.git_source import GitSource +from databricks.bundles.jobs._models.job import Job +from databricks.bundles.jobs._models.job_cluster import JobCluster +from databricks.bundles.jobs._models.job_email_notifications import ( + JobEmailNotifications, +) +from databricks.bundles.jobs._models.job_environment import JobEnvironment +from databricks.bundles.jobs._models.job_notification_settings import ( + JobNotificationSettings, +) +from databricks.bundles.jobs._models.job_parameter_definition import ( + JobParameterDefinition, +) +from databricks.bundles.jobs._models.job_permission import JobPermission +from databricks.bundles.jobs._models.job_permission_level import JobPermissionLevel +from databricks.bundles.jobs._models.job_run_as import JobRunAs +from databricks.bundles.jobs._models.jobs_health_rules import JobsHealthRules +from databricks.bundles.jobs._models.lifecycle import Lifecycle +from databricks.bundles.jobs._models.performance_target import PerformanceTarget +from databricks.bundles.jobs._models.queue_settings import QueueSettings +from databricks.bundles.jobs._models.task import Task +from databricks.bundles.jobs._models.trigger_configuration import TriggerConfiguration +from databricks.bundles.jobs._models.trigger_settings import TriggerSettings +from databricks.bundles.jobs._models.webhook_notifications import WebhookNotifications +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_job, + dict_example={ + "continuous": {}, + "email_notifications": {}, + "environments": [{"environment_key": "environment_key"}], + "git_source": {"git_provider": "gitHub", "git_url": "git_url"}, + "health": {}, + "job_clusters": [{"job_cluster_key": "job_cluster_key"}], + "lifecycle": {}, + "notification_settings": {}, + "parameters": [{"default": "default", "name": "name"}], + "performance_target": "PERFORMANCE_OPTIMIZED", + "permissions": [{"level": "CAN_MANAGE"}], + "queue": {"enabled": True}, + "run_as": {}, + "schedule": { + "quartz_cron_expression": "quartz_cron_expression", + "timezone_id": "timezone_id", + }, + "tags": {"key": "value"}, + "tasks": [{"task_key": "task_key"}], + "trigger": {}, + "triggers": [{}], + "webhook_notifications": {}, + }, + dataclass_example=Job( + continuous=Continuous(), + email_notifications=JobEmailNotifications(), + environments=[JobEnvironment(environment_key="environment_key")], + git_source=GitSource( + git_provider=GitProvider.GIT_HUB, git_url="git_url" + ), + health=JobsHealthRules(), + job_clusters=[JobCluster(job_cluster_key="job_cluster_key")], + lifecycle=Lifecycle(), + notification_settings=JobNotificationSettings(), + parameters=[JobParameterDefinition(default="default", name="name")], + performance_target=PerformanceTarget.PERFORMANCE_OPTIMIZED, + permissions=[JobPermission(level=JobPermissionLevel.CAN_MANAGE)], + queue=QueueSettings(enabled=True), + run_as=JobRunAs(), + schedule=CronSchedule( + quartz_cron_expression="quartz_cron_expression", + timezone_id="timezone_id", + ), + tags={"key": "value"}, + tasks=[Task(task_key="task_key")], + trigger=TriggerSettings(), + triggers=[TriggerConfiguration()], + webhook_notifications=WebhookNotifications(), + ), + mutator=job_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/pipelines.py b/python/databricks_tests/core/_generated/pipelines.py new file mode 100644 index 00000000000..a4e65573317 --- /dev/null +++ b/python/databricks_tests/core/_generated/pipelines.py @@ -0,0 +1,65 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, pipeline_mutator +from databricks.bundles.core._generated.pipelines import _resource_type +from databricks.bundles.pipelines._models.event_log_spec import EventLogSpec +from databricks.bundles.pipelines._models.filters import Filters +from databricks.bundles.pipelines._models.ingestion_pipeline_definition import ( + IngestionPipelineDefinition, +) +from databricks.bundles.pipelines._models.lifecycle import Lifecycle +from databricks.bundles.pipelines._models.notifications import Notifications +from databricks.bundles.pipelines._models.pipeline import Pipeline +from databricks.bundles.pipelines._models.pipeline_cluster import PipelineCluster +from databricks.bundles.pipelines._models.pipeline_library import PipelineLibrary +from databricks.bundles.pipelines._models.pipeline_permission import PipelinePermission +from databricks.bundles.pipelines._models.pipeline_permission_level import ( + PipelinePermissionLevel, +) +from databricks.bundles.pipelines._models.pipelines_environment import ( + PipelinesEnvironment, +) +from databricks.bundles.pipelines._models.run_as import RunAs +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_pipeline, + dict_example={ + "clusters": [{}], + "configuration": {"key": "value"}, + "environment": {}, + "event_log": {}, + "filters": {}, + "ingestion_definition": {}, + "libraries": [{}], + "lifecycle": {}, + "notifications": [{}], + "parameters": {"key": "value"}, + "permissions": [{"level": "CAN_MANAGE"}], + "run_as": {}, + "tags": {"key": "value"}, + }, + dataclass_example=Pipeline( + clusters=[PipelineCluster()], + configuration={"key": "value"}, + environment=PipelinesEnvironment(), + event_log=EventLogSpec(), + filters=Filters(), + ingestion_definition=IngestionPipelineDefinition(), + libraries=[PipelineLibrary()], + lifecycle=Lifecycle(), + notifications=[Notifications()], + parameters={"key": "value"}, + permissions=[ + PipelinePermission(level=PipelinePermissionLevel.CAN_MANAGE) + ], + run_as=RunAs(), + tags={"key": "value"}, + ), + mutator=pipeline_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/schemas.py b/python/databricks_tests/core/_generated/schemas.py new file mode 100644 index 00000000000..49adceab523 --- /dev/null +++ b/python/databricks_tests/core/_generated/schemas.py @@ -0,0 +1,32 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, schema_mutator +from databricks.bundles.core._generated.schemas import _resource_type +from databricks.bundles.schemas._models.lifecycle import Lifecycle +from databricks.bundles.schemas._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.schemas._models.schema import Schema +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_schema, + dict_example={ + "catalog_name": "catalog_name", + "grants": [{}], + "lifecycle": {}, + "name": "name", + "properties": {"key": "value"}, + }, + dataclass_example=Schema( + catalog_name="catalog_name", + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + properties={"key": "value"}, + ), + mutator=schema_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/volumes.py b/python/databricks_tests/core/_generated/volumes.py new file mode 100644 index 00000000000..bf8b434adec --- /dev/null +++ b/python/databricks_tests/core/_generated/volumes.py @@ -0,0 +1,35 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, volume_mutator +from databricks.bundles.core._generated.volumes import _resource_type +from databricks.bundles.volumes._models.lifecycle import Lifecycle +from databricks.bundles.volumes._models.privilege_assignment import PrivilegeAssignment +from databricks.bundles.volumes._models.volume import Volume +from databricks.bundles.volumes._models.volume_type import VolumeType +from databricks_tests.core._resource_test_case import TestCase + + +def _test_case(): + return ( + TestCase( + add_resource=Resources.add_volume, + dict_example={ + "catalog_name": "catalog_name", + "grants": [{}], + "lifecycle": {}, + "name": "name", + "schema_name": "schema_name", + "volume_type": "MANAGED", + }, + dataclass_example=Volume( + catalog_name="catalog_name", + grants=[PrivilegeAssignment()], + lifecycle=Lifecycle(), + name="name", + schema_name="schema_name", + volume_type=VolumeType.MANAGED, + ), + mutator=volume_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_resource_test_case.py b/python/databricks_tests/core/_resource_test_case.py new file mode 100644 index 00000000000..a9755e8e95c --- /dev/null +++ b/python/databricks_tests/core/_resource_test_case.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from typing import Callable + +from databricks.bundles.core._resource import Resource + + +@dataclass(kw_only=True) +class TestCase: + add_resource: Callable + dict_example: dict + dataclass_example: Resource + mutator: Callable diff --git a/python/databricks_tests/core/test_resources.py b/python/databricks_tests/core/test_resources.py index e27b4331db2..ed50243d785 100644 --- a/python/databricks_tests/core/test_resources.py +++ b/python/databricks_tests/core/test_resources.py @@ -1,134 +1,15 @@ -from dataclasses import dataclass, replace -from typing import Callable +from dataclasses import replace import pytest -from databricks.bundles.alerts._models.alert import Alert -from databricks.bundles.alerts._models.alert_v2_evaluation import AlertV2Evaluation -from databricks.bundles.alerts._models.alert_v2_operand_column import ( - AlertV2OperandColumn, -) -from databricks.bundles.alerts._models.comparison_operator import ComparisonOperator -from databricks.bundles.alerts._models.cron_schedule import CronSchedule -from databricks.bundles.catalogs._models.catalog import Catalog -from databricks.bundles.core import ( - Location, - Resources, - Severity, - alert_mutator, - catalog_mutator, - job_mutator, - pipeline_mutator, - schema_mutator, - volume_mutator, -) +from databricks.bundles.core import Location, Resources, Severity from databricks.bundles.core._bundle import Bundle -from databricks.bundles.core._resource import Resource from databricks.bundles.core._resource_mutator import ResourceMutator from databricks.bundles.core._resource_type import _ResourceType from databricks.bundles.jobs._models.job import Job -from databricks.bundles.pipelines._models.pipeline import Pipeline -from databricks.bundles.schemas._models.schema import Schema -from databricks.bundles.volumes._models.volume import Volume - - -@dataclass(kw_only=True) -class TestCase: - add_resource: Callable - dict_example: dict - dataclass_example: Resource - mutator: Callable - - -resource_types = {tpe.resource_type: tpe for tpe in _ResourceType.all()} -test_cases = [ - ( - TestCase( - add_resource=Resources.add_job, - dict_example={"name": "My job"}, - dataclass_example=Job(name="My job"), - mutator=job_mutator, - ), - resource_types[Job], - ), - ( - TestCase( - add_resource=Resources.add_pipeline, - dict_example={"name": "My pipeline"}, - dataclass_example=Pipeline(name="My pipeline"), - mutator=pipeline_mutator, - ), - resource_types[Pipeline], - ), - ( - TestCase( - add_resource=Resources.add_volume, - dict_example={ - "name": "My Volume", - "catalog_name": "my_catalog", - "schema_name": "my_schema", - }, - dataclass_example=Volume( - catalog_name="my_catalog", - name="My Volume", - schema_name="my_schema", - ), - mutator=volume_mutator, - ), - resource_types[Volume], - ), - ( - TestCase( - add_resource=Resources.add_schema, - dict_example={"catalog_name": "my_catalog", "name": "my_schema"}, - dataclass_example=Schema(catalog_name="my_catalog", name="my_schema"), - mutator=schema_mutator, - ), - resource_types[Schema], - ), - ( - TestCase( - add_resource=Resources.add_alert, - dict_example={ - "display_name": "My Alert", - "query_text": "SELECT 1", - "warehouse_id": "my_warehouse", - "evaluation": { - "comparison_operator": "GREATER_THAN", - "source": {"name": "column_1"}, - }, - "schedule": { - "quartz_cron_schedule": "0 0 0 * * ?", - "timezone_id": "UTC", - }, - }, - dataclass_example=Alert( - display_name="My Alert", - query_text="SELECT 1", - warehouse_id="my_warehouse", - evaluation=AlertV2Evaluation( - comparison_operator=ComparisonOperator.GREATER_THAN, - source=AlertV2OperandColumn(name="column_1"), - ), - schedule=CronSchedule( - quartz_cron_schedule="0 0 0 * * ?", - timezone_id="UTC", - ), - ), - mutator=alert_mutator, - ), - resource_types[Alert], - ), - ( - TestCase( - add_resource=Resources.add_catalog, - dict_example={"name": "my_catalog"}, - dataclass_example=Catalog(name="my_catalog"), - mutator=catalog_mutator, - ), - resource_types[Catalog], - ), -] +from databricks_tests.core._generated import test_cases +from databricks_tests.core._resource_test_case import TestCase + test_case_ids = [tpe.plural_name for _, tpe in test_cases] From 19ca487ef35fa9efd18e5eff97b0802b894b012b Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 11:45:17 +0000 Subject: [PATCH 42/52] Fix ruff lint in the test-case generator The generator source lives outside databricks/databricks_tests, so pydabs-codegen's targeted ruff --fix does not reach it, but the root ruff check does. Sort imports and merge the two startswith calls into a single tuple call. No change to generated output. Co-authored-by: Isaac --- python/codegen/codegen/generated_test_cases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index 7decc29a897..1de481b5d0a 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -26,7 +26,7 @@ import codegen.jsonschema as openapi import codegen.packages as packages from codegen.generated_enum import _camel_to_upper_snake -from codegen.generated_wiring import _WiredResource, _wired_resources +from codegen.generated_wiring import _wired_resources, _WiredResource HEADER = "# Code generated by pydabs-codegen. DO NOT EDIT.\n\n" @@ -79,7 +79,7 @@ def _ref_name(ref: str) -> str: def _is_composite(ref: str) -> bool: - if ref.startswith("#/$defs/slice/") or ref.startswith("#/$defs/map/"): + if ref.startswith(("#/$defs/slice/", "#/$defs/map/")): return True return _ref_name(ref) not in packages.PRIMITIVES From ffaf4002dd20377a4baca1de88e7e9f80a7e453a Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 28 Aug 2026 12:17:15 +0000 Subject: [PATCH 43/52] added explainatory comments --- .../codegen/codegen/generated_test_cases.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index 1de481b5d0a..c3984879c46 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -75,10 +75,18 @@ class _Map: def _ref_name(ref: str) -> str: + """Last path segment of a JSON-schema ref -- the schema name. + + :param ref: a JSON-schema reference, e.g. "#/$defs/.../jobs.Task" or "#/$defs/string". + """ return ref.split("/")[-1] def _is_composite(ref: str) -> bool: + """Whether a ref is a composite type (list, map, object, or enum) rather than a scalar. + + :param ref: the JSON-schema reference of a field's type. + """ if ref.startswith(("#/$defs/slice/", "#/$defs/map/")): return True @@ -86,6 +94,11 @@ def _is_composite(ref: str) -> bool: def _synth_scalar(name: str, hint: str) -> _Scalar: + """Placeholder value for a primitive (str -> hint, int -> 0, float -> 0.0, bool -> True). + + :param name: the primitive's schema name, e.g. "string", "int", "boolean". + :param hint: enclosing field name, used as the string placeholder so examples read meaningfully. + """ if name == "string": return _Scalar(f'"{hint}"', f'"{hint}"') if name in ("integer", "int", "int64"): @@ -105,6 +118,14 @@ def _synth_ref( schemas: dict[str, openapi.Schema], visiting: set[str], ) -> _Value: + """Synthesize a value node for whatever type a ref points at: list, map, scalar, enum, or nested object. + + :param namespace: the resource's namespace (e.g. "jobs"); selects the module a referenced type is generated into. + :param ref: the JSON-schema reference of the type to synthesize. + :param hint: enclosing field name, passed through as the string placeholder. + :param schemas: all post-patch schemas keyed by schema name, for looking up nested/enum types. + :param visiting: ancestor object names on the current path, used to detect required cycles. + """ if ref.startswith("#/$defs/slice/"): element_ref = ref.replace("#/$defs/slice/", "#/$defs/") @@ -147,6 +168,15 @@ def _synth_object( visiting: set[str], top_level: bool, ) -> _Object: + """Synthesize an object value, choosing fields by policy: all required fields, plus (only at the resource top level) stable optional composite fields. + + :param namespace: the resource's namespace, threaded through to resolve nested types' modules. + :param schema_name: this object's schema name (e.g. "resources.Alert"). + :param schema: the Schema for this object -- its properties and required list. + :param schemas: all post-patch schemas, for recursing into nested types. + :param visiting: ancestor object names on the current path (cycle guard). + :param top_level: True only for the resource itself; when False, all optional fields are dropped. + """ visiting = visiting | {schema_name} fields: list[tuple[str, _Value]] = [] @@ -172,6 +202,11 @@ def _synth_object( def _module_of(namespace: str, schema_name: str) -> str: + """Python module a (non-primitive) schema's generated class lives in; asserts it exists. + + :param namespace: the resource's namespace; the type is generated under databricks.bundles.._models. + :param schema_name: the object/enum schema name to resolve. + """ module = packages.get_package(namespace, schema_name) assert module @@ -179,6 +214,10 @@ def _module_of(namespace: str, schema_name: str) -> str: def _render_dict(value: _Value) -> str: + """Render a synthesized value as a dict-literal source string (the dict_example form). + + :param value: the synthesized value node to render. + """ if isinstance(value, _Scalar): return value.dict_src if isinstance(value, _Enum): @@ -196,6 +235,10 @@ def _render_dict(value: _Value) -> str: def _render_dataclass(value: _Value) -> str: + """Render a synthesized value as a constructor-expression source string (the dataclass_example form). + + :param value: the synthesized value node to render. + """ if isinstance(value, _Scalar): return value.dataclass_src if isinstance(value, _Enum): @@ -213,6 +256,11 @@ def _render_dataclass(value: _Value) -> str: def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: + """Collect (module, class_name) pairs the dataclass_example needs, walking nested objects/enums. + + :param value: the synthesized value node to walk. + :param out: set accumulating the (module, class_name) import pairs; mutated in place. + """ if isinstance(value, _Enum): out.add((value.module, value.class_name)) elif isinstance(value, _Object): @@ -226,6 +274,11 @@ def _collect_imports(value: _Value, out: set[tuple[str, str]]) -> None: def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): + """Write one _generated/.py per wired resource plus the collector __init__.py. + + :param output: codegen output root (the python/ directory); files land under databricks_tests/core/_generated. + :param schemas: all post-patch schemas, used to synthesize each resource's dict/dataclass examples. + """ resources = _wired_resources() generated_path = Path(output) / "databricks_tests" / "core" / "_generated" @@ -263,6 +316,10 @@ def write_test_cases(output: str, schemas: dict[str, openapi.Schema]): def _collector_code(resources: list[_WiredResource]) -> str: + """Source for _generated/__init__.py: imports the per-resource modules and assembles `test_cases`. + + :param resources: the wired resources, in the order their test cases are collected. + """ module_imports = "\n".join(f" {r.plural_name}," for r in resources) entries = "\n".join(f" {r.plural_name}._test_case()," for r in resources) From 4aa571ccd982ad4810b90471903d695acb828fdd Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Thu, 3 Sep 2026 15:04:11 +0000 Subject: [PATCH 44/52] Filter generated test-case fields by launch-stage maturity Skip optional top-level fields ranked below public preview (public-beta and private-preview), not just private-preview. Mirror the launch-stage rank from internal/clijson/launchstage.go (absent stage = GA) so the comparison uses maturity order rather than a string comparison. Drops jobs.triggers and pipelines.parameters from the generated examples. Co-authored-by: Isaac --- python/codegen/codegen/generated_test_cases.py | 16 +++++++++++++++- python/databricks_tests/core/_generated/jobs.py | 3 --- .../core/_generated/pipelines.py | 2 -- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/python/codegen/codegen/generated_test_cases.py b/python/codegen/codegen/generated_test_cases.py index c3984879c46..8da404c8f0f 100644 --- a/python/codegen/codegen/generated_test_cases.py +++ b/python/codegen/codegen/generated_test_cases.py @@ -34,6 +34,16 @@ (Path(__file__).parent / "test_case.py.tmpl").read_text() ) +# Launch-stage maturity, mirroring internal/clijson/launchstage.go: +# GA < PUBLIC_PREVIEW < PUBLIC_BETA < PRIVATE_PREVIEW; absent stage = GA. +_STAGE_RANK = { + None: 0, + openapi.LaunchStage.GA: 0, + openapi.LaunchStage.PUBLIC_PREVIEW: 1, + openapi.LaunchStage.PUBLIC_BETA: 2, + openapi.LaunchStage.PRIVATE_PREVIEW: 3, +} + # Synthesized value tree. Each node renders both as a dict literal (dict_example) # and as a constructor expression (dataclass_example). @@ -190,7 +200,11 @@ def _synth_object( continue if not _is_composite(prop.ref): continue - if prop.deprecated or prop.stage == openapi.LaunchStage.PRIVATE_PREVIEW: + if ( + prop.deprecated + or _STAGE_RANK[prop.stage] + > _STAGE_RANK[openapi.LaunchStage.PUBLIC_PREVIEW] + ): continue value = _synth_ref(namespace, prop.ref, field_name, schemas, visiting) diff --git a/python/databricks_tests/core/_generated/jobs.py b/python/databricks_tests/core/_generated/jobs.py index 3a9dd6cec6d..878e916cd69 100644 --- a/python/databricks_tests/core/_generated/jobs.py +++ b/python/databricks_tests/core/_generated/jobs.py @@ -26,7 +26,6 @@ from databricks.bundles.jobs._models.performance_target import PerformanceTarget from databricks.bundles.jobs._models.queue_settings import QueueSettings from databricks.bundles.jobs._models.task import Task -from databricks.bundles.jobs._models.trigger_configuration import TriggerConfiguration from databricks.bundles.jobs._models.trigger_settings import TriggerSettings from databricks.bundles.jobs._models.webhook_notifications import WebhookNotifications from databricks_tests.core._resource_test_case import TestCase @@ -57,7 +56,6 @@ def _test_case(): "tags": {"key": "value"}, "tasks": [{"task_key": "task_key"}], "trigger": {}, - "triggers": [{}], "webhook_notifications": {}, }, dataclass_example=Job( @@ -83,7 +81,6 @@ def _test_case(): tags={"key": "value"}, tasks=[Task(task_key="task_key")], trigger=TriggerSettings(), - triggers=[TriggerConfiguration()], webhook_notifications=WebhookNotifications(), ), mutator=job_mutator, diff --git a/python/databricks_tests/core/_generated/pipelines.py b/python/databricks_tests/core/_generated/pipelines.py index a4e65573317..096a05e6012 100644 --- a/python/databricks_tests/core/_generated/pipelines.py +++ b/python/databricks_tests/core/_generated/pipelines.py @@ -37,7 +37,6 @@ def _test_case(): "libraries": [{}], "lifecycle": {}, "notifications": [{}], - "parameters": {"key": "value"}, "permissions": [{"level": "CAN_MANAGE"}], "run_as": {}, "tags": {"key": "value"}, @@ -52,7 +51,6 @@ def _test_case(): libraries=[PipelineLibrary()], lifecycle=Lifecycle(), notifications=[Notifications()], - parameters={"key": "value"}, permissions=[ PipelinePermission(level=PipelinePermissionLevel.CAN_MANAGE) ], From 6f3cac83bc6540dbcb0b04014df9035733b62a48 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:19:38 +0000 Subject: [PATCH 45/52] add unit tests for the codegen to assert behaviour --- .../test_generated_test_cases.py | 350 ++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 python/codegen/codegen_tests/test_generated_test_cases.py diff --git a/python/codegen/codegen_tests/test_generated_test_cases.py b/python/codegen/codegen_tests/test_generated_test_cases.py new file mode 100644 index 00000000000..047749b5035 --- /dev/null +++ b/python/codegen/codegen_tests/test_generated_test_cases.py @@ -0,0 +1,350 @@ +"""Tests for generated_test_cases.py, the codegen that builds example resource +values for the generated pydabs test suite. + +For the unfamiliar: the generator reads a resource's JSON schema and synthesizes +one placeholder "value tree", then renders it two ways -- as a Python dict literal +and as a dataclass constructor call. Downstream tests use the pair to check that +converting the dict form yields the dataclass form. These tests cover the pieces +of that pipeline: parsing schema refs, synthesizing the value tree (and the rules +for which fields it includes), the two renderers, collecting the imports the +rendered code needs, and the source of the collector module that gathers it all. +""" + +import codegen.jsonschema as openapi +import pytest +from codegen.generated_test_cases import ( + _collect_imports, + _collector_code, + _Enum, + _is_composite, + _List, + _Map, + _Object, + _ref_name, + _render_dataclass, + _render_dict, + _Scalar, + _synth_object, + _synth_ref, + _synth_scalar, +) +from codegen.generated_wiring import _WiredResource +from codegen.jsonschema import Property, Schema, SchemaType + +# Full $refs as they appear in jsonschema.json; only the last segment is +# significant to the code under test, but keeping the SDK prefix makes the +# fixtures read like the real spec. +_SDK = "#/$defs/github.com/databricks/databricks-sdk-go/service" +_COND_REF = f"{_SDK}/sql.AlertCondition" +_OP_REF = f"{_SDK}/sql.ComparisonOperator" + + +# _ref_name pulls the type name (the last path segment) out of a schema $ref. +def test_ref_name(): + assert _ref_name(_COND_REF) == "sql.AlertCondition" + assert _ref_name("#/$defs/string") == "string" + + +# _is_composite separates refs that need recursive synthesis (list/map/object/enum) +# from plain scalar refs (string, int, ...). +def test_is_composite(): + assert _is_composite("#/$defs/slice/string") + assert _is_composite("#/$defs/map/string") + assert _is_composite(_COND_REF) + assert not _is_composite("#/$defs/string") + assert not _is_composite("#/$defs/int64") + + +# Each primitive type maps to a fixed placeholder value (a string uses the field +# name; numbers/bools use 0 / 0.0 / True). +@pytest.mark.parametrize( + "name,expected", + [ + ("string", _Scalar('"hint"', '"hint"')), + ("integer", _Scalar("0", "0")), + ("int", _Scalar("0", "0")), + ("int64", _Scalar("0", "0")), + ("number", _Scalar("0.0", "0.0")), + ("float64", _Scalar("0.0", "0.0")), + ("boolean", _Scalar("True", "True")), + ("bool", _Scalar("True", "True")), + ], +) +def test_synth_scalar(name, expected): + assert _synth_scalar(name, "hint") == expected + + +# An unrecognized primitive means the schema has a type the generator doesn't +# model, so it fails loudly rather than emitting a bad value. +def test_synth_scalar_unknown_raises(): + with pytest.raises(ValueError, match="Unknown primitive: duration"): + _synth_scalar("duration", "hint") + + +# A scalar ref uses the enclosing field's name as its string placeholder, so the +# generated example reads like "name" rather than a generic token. +def test_synth_ref_scalar_uses_field_name_as_hint(): + assert _synth_ref("jobs", "#/$defs/string", "name", {}, set()) == _Scalar( + '"name"', '"name"' + ) + + +# A list ref becomes a one-element list whose single item is synthesized from the +# element type. +def test_synth_ref_list_recurses_on_element(): + assert _synth_ref("jobs", "#/$defs/slice/string", "tags", {}, set()) == _List( + _Scalar('"tags"', '"tags"') + ) + + +# A map ref becomes one {"key": "value"} entry -- the generator only ever emits +# string-keyed, string-valued maps. +def test_synth_ref_map_is_always_string_keyed(): + assert _synth_ref("jobs", "#/$defs/map/string", "labels", {}, set()) == _Map( + "key", _Scalar('"value"', '"value"') + ) + + +# Any other kind of map is never produced, so hitting one fails loudly. +def test_synth_ref_non_string_map_raises(): + with pytest.raises(ValueError, match="Unsupported map ref"): + _synth_ref("jobs", "#/$defs/map/integer", "labels", {}, set()) + + +# An enum ref becomes an _Enum node carrying the chosen value plus the class name, +# module, and member the generated code will reference. +def test_synth_ref_enum(): + schemas = { + "sql.ComparisonOperator": Schema(type=SchemaType.STRING, enum=["greaterThan"]), + } + + assert _synth_ref("alerts", _OP_REF, "op", schemas, set()) == _Enum( + value="greaterThan", + class_name="ComparisonOperator", + module="databricks.bundles.alerts._models.comparison_operator", + member="GREATER_THAN", + ) + + +# A type that (transitively) requires itself has no finite example, so synthesis +# must detect the cycle and stop instead of recursing forever. +def test_synth_ref_required_cycle_raises(): + schemas = {"sql.AlertCondition": Schema(type=SchemaType.OBJECT)} + + # The referenced object is already on the current path: a required cycle has + # no finite value, so synthesis must fail rather than recurse forever. + with pytest.raises( + ValueError, match=r"Required-field cycle through 'sql.AlertCondition'" + ): + _synth_ref("alerts", _COND_REF, "condition", schemas, {"sql.AlertCondition"}) + + +# Which properties land in a resource's example: the field-selection policy. +def test_synth_object_field_policy(): + # A top-level resource keeps: all required fields (scalar + composite), and + # stable optional composite fields. It drops optional scalars. + schemas = { + "resources.Alert": Schema( + type=SchemaType.OBJECT, + properties={ + "display_name": Property(ref="#/$defs/string"), + "condition": Property(ref=_COND_REF), + "seconds_to_retrigger": Property(ref="#/$defs/int"), + "tags": Property(ref="#/$defs/slice/string"), + }, + required=["display_name", "condition"], + ), + "sql.AlertCondition": Schema( + type=SchemaType.OBJECT, + properties={ + "op": Property(ref="#/$defs/string"), + "threshold": Property(ref="#/$defs/slice/string"), + }, + required=["op"], + ), + } + + example = _synth_object( + "alerts", + "resources.Alert", + schemas["resources.Alert"], + schemas, + set(), + top_level=True, + ) + + assert example == _Object( + class_name="Alert", + module="databricks.bundles.alerts._models.alert", + fields=[ + ("display_name", _Scalar('"display_name"', '"display_name"')), + # Nested object contributes only its required field (op); the nested + # optional composite (threshold) is dropped because top_level is False. + ( + "condition", + _Object( + class_name="AlertCondition", + module="databricks.bundles.alerts._models.alert_condition", + fields=[("op", _Scalar('"op"', '"op"'))], + ), + ), + # seconds_to_retrigger (optional scalar) is dropped. + ("tags", _List(_Scalar('"tags"', '"tags"'))), + ], + ) + + +# An optional field is only included if it is "stable": deprecated fields and +# ones still in beta / private preview are left out (absent stage counts as GA). +@pytest.mark.parametrize( + "deprecated,stage,kept", + [ + (None, None, True), + (None, openapi.LaunchStage.PUBLIC_PREVIEW, True), + (True, None, False), + (None, openapi.LaunchStage.PUBLIC_BETA, False), + (None, openapi.LaunchStage.PRIVATE_PREVIEW, False), + ], +) +def test_synth_object_optional_composite_stability(deprecated, stage, kept): + schemas = { + "resources.Alert": Schema( + type=SchemaType.OBJECT, + properties={ + "tags": Property( + ref="#/$defs/slice/string", deprecated=deprecated, stage=stage + ), + }, + required=[], + ), + } + + example = _synth_object( + "alerts", + "resources.Alert", + schemas["resources.Alert"], + schemas, + set(), + top_level=True, + ) + + assert bool(example.fields) == kept + + +# Inside a nested object (anything that isn't the resource itself) only required +# fields are kept, which keeps examples bounded. +def test_synth_object_nested_drops_all_optional(): + schemas = { + "sql.AlertCondition": Schema( + type=SchemaType.OBJECT, + properties={ + "op": Property(ref="#/$defs/string"), + "operand": Property(ref="#/$defs/slice/string"), + }, + required=["op"], + ), + } + + example = _synth_object( + "alerts", + "sql.AlertCondition", + schemas["sql.AlertCondition"], + schemas, + set(), + top_level=False, + ) + + assert [name for name, _ in example.fields] == ["op"] + + +# --- rendering ------------------------------------------------------------- + +_VALUE_TREE = _Object( + class_name="Alert", + module="databricks.bundles.alerts._models.alert", + fields=[ + ("display_name", _Scalar('"display_name"', '"display_name"')), + ( + "op", + _Enum( + value="greaterThan", + class_name="ComparisonOperator", + module="databricks.bundles.alerts._models.comparison_operator", + member="GREATER_THAN", + ), + ), + ("tags", _List(_Scalar('"tags"', '"tags"'))), + ("labels", _Map("key", _Scalar('"value"', '"value"'))), + ], +) + + +# Rendering a value tree as a Python dict-literal string (the "dict_example" form). +def test_render_dict(): + assert _render_dict(_VALUE_TREE) == ( + '{"display_name": "display_name", "op": "greaterThan", ' + '"tags": ["tags"], "labels": {"key": "value"}}' + ) + + +# Rendering the same tree as a dataclass-constructor string (the "dataclass_example" +# form); the two renderers must agree on structure but differ on enums. +def test_render_dataclass(): + # Enums render as a class member reference, unlike the dict form's raw string. + assert _render_dataclass(_VALUE_TREE) == ( + 'Alert(display_name="display_name", op=ComparisonOperator.GREATER_THAN, ' + 'tags=["tags"], labels={"key": "value"})' + ) + + +# The dataclass example references object and enum classes; this collects the +# (module, class) imports it needs, reaching into lists and maps to find them. +def test_collect_imports_gathers_objects_and_enums_through_containers(): + out: set[tuple[str, str]] = set() + _collect_imports(_VALUE_TREE, out) + + assert out == { + ("databricks.bundles.alerts._models.alert", "Alert"), + ("databricks.bundles.alerts._models.comparison_operator", "ComparisonOperator"), + } + + +# A tree of only primitives references no classes, so it needs no imports. +def test_collect_imports_scalar_only_tree_is_empty(): + out: set[tuple[str, str]] = set() + _collect_imports(_Scalar('"x"', '"x"'), out) + + assert out == set() + + +# Source of the _generated/__init__.py that imports each resource's module and +# gathers their test cases into a single `test_cases` list. +def test_collector_code(): + resources = [ + _WiredResource( + class_name="Alert", + singular_name="alert", + plural_name="alerts", + model_module="databricks.bundles.alerts._models.alert", + ), + _WiredResource( + class_name="Job", + singular_name="job", + plural_name="jobs", + model_module="databricks.bundles.jobs._models.job", + ), + ] + + assert _collector_code(resources) == ( + "from databricks_tests.core._generated import (\n" + " alerts,\n" + " jobs,\n" + ")\n" + "\n" + '__all__ = ["test_cases"]\n' + "\n" + "test_cases = [\n" + " alerts._test_case(),\n" + " jobs._test_case(),\n" + "]\n" + ) From 4dcee95e1695db7a3e983955a433e3e1d5d0052c Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:54:18 +0000 Subject: [PATCH 46/52] Add pydabs-acceptance-test skill for authoring resource acceptance tests An AI Agent Skill that guides an agent to author the acceptance test for a newly-onboarded PyDABs resource: the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt). Includes fill-in templates (.tmpl so they stay out of linters). Complements the schema-synthesized unit-test generation; realistic field values are adapted from the resource's invariant config. Co-authored-by: Isaac --- .../skills/pydabs-acceptance-test/SKILL.md | 137 ++++++++++++++++++ .../templates/databricks.yml.tmpl | 15 ++ .../templates/mutators.py.tmpl | 11 ++ .../templates/resources.py.tmpl | 14 ++ .../templates/script.tmpl | 5 + .../templates/test.toml.tmpl | 7 + 6 files changed, 189 insertions(+) create mode 100644 .agents/skills/pydabs-acceptance-test/SKILL.md create mode 100644 .agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/script.tmpl create mode 100644 .agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl diff --git a/.agents/skills/pydabs-acceptance-test/SKILL.md b/.agents/skills/pydabs-acceptance-test/SKILL.md new file mode 100644 index 00000000000..466177d0856 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/SKILL.md @@ -0,0 +1,137 @@ +--- +name: pydabs-acceptance-test +description: "Author the acceptance test for a PyDABs (Python DABs) resource. Use when onboarding a new PyDABs resource, when the test_python_support_coverage guard fails for a resource, or when the user says 'add a pydabs acceptance test', 'write the acceptance test for ', or 'the -support test is missing'. Produces the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt)." +user-invocable: true +allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion +--- + +# Author a PyDABs resource acceptance test + +PyDABs acceptance tests are hand-written, one fixture per resource under +`acceptance/bundle/python/-support/`. The OpenAPI spec has no examples, so +the realistic field values come from the resource's invariant config and your own +judgement — not from a generator. This skill guides you through authoring that +fixture deterministically and verifying it. + +The coverage guard `test_python_support_coverage` +(`python/databricks_tests/core/test_python_support.py`) fails CI for any PyDABs +resource that lacks a `-support` fixture, so every newly-onboarded resource +must get one. This skill is how you close that gap. + +Worked reference: `acceptance/bundle/python/alerts-support/` (a resource with required +nested fields) and `acceptance/bundle/python/catalogs-support/` (a direct-engine-only +resource). Read both before starting — the fixture you write mirrors them. + +## Input + +The resource to cover, as its **plural** name (the `resources:` key in +`databricks.yml`, e.g. `alerts`, `volumes`). If given a singular or a Go/Python +type name, resolve it to the plural first (step 1). + +## Step 1 — Verify the resource is wired in PyDABs + +The fixture cannot work unless the resource's Python surface exists. Confirm all of: + +- The package `python/databricks/bundles//` exists and has a `_models/` + subdirectory (this is what marks it a generated resource package). +- `add_` is a method on `Resources` and `_mutator` is exported + from `databricks.bundles.core`: + + ```sh + grep -rn "def add_\|_mutator" python/databricks/bundles/core/ + ``` + +If any is missing, the resource is not wired yet — stop and onboard it in PyDABs +first (that is a separate task). Note the exact `` and `` names +(the dataclass, e.g. `Alert`) from `python/databricks/bundles//__init__.py`; +you need them for `resources.py` and `mutators.py`. + +## Step 2 — Find the resource's required fields + +The generated dataclass is the source of truth. In +`python/databricks/bundles//_models/.py`, required fields are typed +`VariableOr[...]` (no default); optional fields are `VariableOrOptional[...] = None`. +You must set every required field, including required fields of required nested +objects (recurse into their `_models` files). Optional fields are usually omitted. + +```sh +grep -nE "VariableOr\[|VariableOrOptional\[" python/databricks/bundles//_models/.py +``` + +## Step 3 — Get realistic values (adapt, don't copy) + +The invariant config `acceptance/bundle/invariant/configs/.yml.tmpl` shows +realistic values for the same resource. **Adapt** it — do not copy verbatim: + +- Replace `$UNIQUE_NAME`, `$TEST_DEFAULT_WAREHOUSE_ID`, and every other `$VAR` + interpolation with plain string literals. This test runs locally with no cloud and + no variable substitution. +- Drop cloud-only / IAM blocks the invariant config carries for its real-workspace + run: `permissions`, `grants`, `file_path` pointing at an external asset, etc. Keep + the fixture to the resource's own fields so `bundle validate` is deterministic. + +If no invariant config exists, invent plausible literals that satisfy the field types +(a display name string, an enum's first member, a cron string, etc.). + +## Step 4 — Write the six fixture files + +Copy each `templates/*.tmpl` into `acceptance/bundle/python/-support/`, +dropping the `.tmpl` suffix (e.g. `resources.py.tmpl` → `resources.py`), and fill +them in. The `.tmpl` suffix keeps the placeholder files out of the repo's linters; +the copied fixture files are real Python/YAML/TOML and must pass lint (step 7). +Placeholders: `PLURAL`, `SINGULAR`, `CLASS`, `NAME` (a short stem, e.g. `alert`), +`FIELD` (a required **string** field to mutate). + +1. **`databricks.yml`** — `bundle.name: my_project`, `sync: {paths: []}`, a top-level + `python:` block wiring `resources:load_resources` and `mutators:update_`, + and one YAML-declared resource `resources..my__1` with all required + fields. (`bundle validate` normalizes the `python:` key to `experimental.python` + in the output — that is expected, don't fight it.) +2. **`resources.py`** — `load_resources()` adds a second instance `my__2` via + `resources.add_(...)`, same required fields, slightly different values. +3. **`mutators.py`** — a `@_mutator` that `assert isinstance(...)` on a + required string field and `replace(...)`s it to append `" (updated)"`. The mutator + runs on **both** instances, so the golden shows the transform applied to each. +4. **`script`** — copy `templates/script` verbatim (`bundle validate --output json` + piped through `jq "pick(.experimental.python, .resources)"`). +5. **`test.toml`** — `Cloud = false`. Add `EnvMatrix.PYDAB_VERSION = ["current"]` for + a brand-new resource (it only exists in the current wheel, not the pinned older + one). Add `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]` only for a direct-only + resource — terraform is deprecated, so never add a `["terraform", "direct"]` + matrix. When unsure, copy the engine convention from the newest existing fixture + (`catalogs-support`), not an old one. +6. **`output.txt`** — do NOT hand-write; generate it in step 5. + +## Step 5 — Generate the golden output + +```sh +go test ./acceptance -run 'TestAccept/bundle/python/-support' -update +``` + +(or `./task test-update` to regenerate the whole suite). This writes `output.txt`. +Inspect it: both `my__1` and `my__2` must appear with the mutated field +showing `" (updated)"`, and only `experimental.python` + `resources` keys are present. + +## Step 6 — Verify it reproduces deterministically + +Re-run **without** `-update`. It must pass against the golden you just generated: + +```sh +go test ./acceptance -run 'TestAccept/bundle/python/-support' -count=1 +``` + +A test that only passes with `-update` is nondeterministic — investigate before +finishing (a `$VAR` left in a value, a non-deterministic field, an EnvMatrix variant +producing different output). Never stop at "golden written". + +## Step 7 — Confirm coverage and format + +```sh +(cd python && uv run --python 3.11 pytest databricks_tests/core/test_python_support.py) +./task fmt && ./task lint-q +``` + +`test_python_support_coverage` should now be green for this resource. If the resource +was previously in the `_LACKING` allowlist +(`python/databricks_tests/core/test_python_support.py`), remove its entry — the list +only shrinks. diff --git a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl new file mode 100644 index 00000000000..18f303dd816 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl @@ -0,0 +1,15 @@ +bundle: + name: my_project + +sync: {paths: []} # don't need to copy files + +python: + resources: + - "resources:load_resources" + mutators: + - "mutators:update_SINGULAR" + +resources: + PLURAL: + my_NAME_1: + # required fields, realistic literal values (see SKILL.md steps 2-3) diff --git a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl new file mode 100644 index 00000000000..4a2bfb94d89 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl @@ -0,0 +1,11 @@ +from dataclasses import replace + +from databricks.bundles.PLURAL import CLASS +from databricks.bundles.core import SINGULAR_mutator + + +@SINGULAR_mutator +def update_SINGULAR(SINGULAR: CLASS) -> CLASS: + assert isinstance(SINGULAR.FIELD, str) + + return replace(SINGULAR, FIELD=f"{SINGULAR.FIELD} (updated)") diff --git a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl new file mode 100644 index 00000000000..9360bec828a --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl @@ -0,0 +1,14 @@ +from databricks.bundles.core import Resources + + +def load_resources() -> Resources: + resources = Resources() + + resources.add_SINGULAR( + "my_NAME_2", + { + # same required fields as _1, slightly different values + }, + ) + + return resources diff --git a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl new file mode 100644 index 00000000000..e273fb45a53 --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl @@ -0,0 +1,5 @@ + +trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ + jq "pick(.experimental.python, .resources)" + +rm -fr .databricks __pycache__ diff --git a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl new file mode 100644 index 00000000000..4935b9b020a --- /dev/null +++ b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl @@ -0,0 +1,7 @@ +Cloud = false # tests don't interact with APIs + +# new resource, only in the current wheel: +# EnvMatrix.PYDAB_VERSION = ["current"] + +# direct-only resource (terraform is deprecated): +# EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] From 9f4290908c638340dc0ef009b8e56107c8d212c2 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 11:54:19 +0000 Subject: [PATCH 47/52] Assert every PyDABs resource has an acceptance test test_python_support_coverage fails until each resource in the _ResourceType registry has an acceptance/bundle/python/-support/ fixture, so coverage cannot silently regress as resources are onboarded. Mirrors the invariant-config coverage guard; shrink-only _LACKING allowlist ({jobs}, whose coverage predates the convention). Lives in the python test suite (runs in CI via pydabs-test) since it checks the filesystem rather than exercising the CLI. Co-authored-by: Isaac --- .../core/test_python_support.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 python/databricks_tests/core/test_python_support.py diff --git a/python/databricks_tests/core/test_python_support.py b/python/databricks_tests/core/test_python_support.py new file mode 100644 index 00000000000..ef8a113d56b --- /dev/null +++ b/python/databricks_tests/core/test_python_support.py @@ -0,0 +1,36 @@ +"""Coverage guard: every PyDABs resource must have an acceptance fixture. + +Asserts each resource in the _ResourceType registry has an +acceptance/bundle/python/-support/ fixture. New resources get one via the +pydabs-acceptance-test skill; this fails CI until it exists. +""" + +from pathlib import Path + +import pytest + +from databricks.bundles.core._resource_type import _ResourceType + +_ACCEPTANCE_DIR = Path(__file__).parents[3] / "acceptance" / "bundle" / "python" + +# Resources knowingly lacking a -support fixture. Shrink-only: the test fails +# if an entry here is actually covered, so gaps can only close. +_LACKING = { + # jobs predates the -support convention; covered across the suite instead. + "jobs", +} + +_PLURALS = sorted(t.plural_name for t in _ResourceType.all()) + + +@pytest.mark.parametrize("plural", _PLURALS) +def test_python_support_coverage(plural: str): + covered = (_ACCEPTANCE_DIR / f"{plural}-support" / "databricks.yml").exists() + + if plural in _LACKING: + assert not covered, f"{plural!r} now has a fixture; remove it from _LACKING" + else: + assert covered, ( + f"no acceptance/bundle/python/{plural}-support/ fixture for {plural!r}; " + "author one with the pydabs-acceptance-test skill or add it to _LACKING" + ) From a1ba7b36deaadb8fd07bb61e3b6fa350e3b98f37 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:00:03 +0000 Subject: [PATCH 48/52] Replace acceptance-test skill with an auto-loaded rule + README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per review feedback (skills aren't reliably loaded, and the examples plus a verbose failure are enough): drop the pydabs-acceptance-test skill in favor of the repo's dresources pattern — a path-scoped .agents/rules/ file (auto-loaded when working under acceptance/bundle/python/**) pointing to a concise acceptance/bundle/python/README.md that leans on the existing fixtures. Retarget the coverage guard's message at the README. Co-authored-by: Isaac --- .agents/rules/pydabs-acceptance-tests.md | 8 + .../skills/pydabs-acceptance-test/SKILL.md | 137 ------------------ .../templates/databricks.yml.tmpl | 15 -- .../templates/mutators.py.tmpl | 11 -- .../templates/resources.py.tmpl | 14 -- .../templates/script.tmpl | 5 - .../templates/test.toml.tmpl | 7 - acceptance/bundle/python/README.md | 48 ++++++ .../core/test_python_support.py | 6 +- 9 files changed, 59 insertions(+), 192 deletions(-) create mode 100644 .agents/rules/pydabs-acceptance-tests.md delete mode 100644 .agents/skills/pydabs-acceptance-test/SKILL.md delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/script.tmpl delete mode 100644 .agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl create mode 100644 acceptance/bundle/python/README.md diff --git a/.agents/rules/pydabs-acceptance-tests.md b/.agents/rules/pydabs-acceptance-tests.md new file mode 100644 index 00000000000..924540845e7 --- /dev/null +++ b/.agents/rules/pydabs-acceptance-tests.md @@ -0,0 +1,8 @@ +--- +description: Rules for authoring PyDABs resource acceptance tests +globs: acceptance/bundle/python/** +paths: + - "acceptance/bundle/python/**" +--- + +**RULE: Before adding a PyDABs resource acceptance test, read `acceptance/bundle/python/README.md`.** It covers the `-support/` fixture layout, how to source and adapt realistic field values, the version/engine `test.toml` knobs, and the determinism re-run. Every PyDABs resource needs one (enforced by `test_python_support_coverage`). diff --git a/.agents/skills/pydabs-acceptance-test/SKILL.md b/.agents/skills/pydabs-acceptance-test/SKILL.md deleted file mode 100644 index 466177d0856..00000000000 --- a/.agents/skills/pydabs-acceptance-test/SKILL.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -name: pydabs-acceptance-test -description: "Author the acceptance test for a PyDABs (Python DABs) resource. Use when onboarding a new PyDABs resource, when the test_python_support_coverage guard fails for a resource, or when the user says 'add a pydabs acceptance test', 'write the acceptance test for ', or 'the -support test is missing'. Produces the acceptance/bundle/python/-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt)." -user-invocable: true -allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion ---- - -# Author a PyDABs resource acceptance test - -PyDABs acceptance tests are hand-written, one fixture per resource under -`acceptance/bundle/python/-support/`. The OpenAPI spec has no examples, so -the realistic field values come from the resource's invariant config and your own -judgement — not from a generator. This skill guides you through authoring that -fixture deterministically and verifying it. - -The coverage guard `test_python_support_coverage` -(`python/databricks_tests/core/test_python_support.py`) fails CI for any PyDABs -resource that lacks a `-support` fixture, so every newly-onboarded resource -must get one. This skill is how you close that gap. - -Worked reference: `acceptance/bundle/python/alerts-support/` (a resource with required -nested fields) and `acceptance/bundle/python/catalogs-support/` (a direct-engine-only -resource). Read both before starting — the fixture you write mirrors them. - -## Input - -The resource to cover, as its **plural** name (the `resources:` key in -`databricks.yml`, e.g. `alerts`, `volumes`). If given a singular or a Go/Python -type name, resolve it to the plural first (step 1). - -## Step 1 — Verify the resource is wired in PyDABs - -The fixture cannot work unless the resource's Python surface exists. Confirm all of: - -- The package `python/databricks/bundles//` exists and has a `_models/` - subdirectory (this is what marks it a generated resource package). -- `add_` is a method on `Resources` and `_mutator` is exported - from `databricks.bundles.core`: - - ```sh - grep -rn "def add_\|_mutator" python/databricks/bundles/core/ - ``` - -If any is missing, the resource is not wired yet — stop and onboard it in PyDABs -first (that is a separate task). Note the exact `` and `` names -(the dataclass, e.g. `Alert`) from `python/databricks/bundles//__init__.py`; -you need them for `resources.py` and `mutators.py`. - -## Step 2 — Find the resource's required fields - -The generated dataclass is the source of truth. In -`python/databricks/bundles//_models/.py`, required fields are typed -`VariableOr[...]` (no default); optional fields are `VariableOrOptional[...] = None`. -You must set every required field, including required fields of required nested -objects (recurse into their `_models` files). Optional fields are usually omitted. - -```sh -grep -nE "VariableOr\[|VariableOrOptional\[" python/databricks/bundles//_models/.py -``` - -## Step 3 — Get realistic values (adapt, don't copy) - -The invariant config `acceptance/bundle/invariant/configs/.yml.tmpl` shows -realistic values for the same resource. **Adapt** it — do not copy verbatim: - -- Replace `$UNIQUE_NAME`, `$TEST_DEFAULT_WAREHOUSE_ID`, and every other `$VAR` - interpolation with plain string literals. This test runs locally with no cloud and - no variable substitution. -- Drop cloud-only / IAM blocks the invariant config carries for its real-workspace - run: `permissions`, `grants`, `file_path` pointing at an external asset, etc. Keep - the fixture to the resource's own fields so `bundle validate` is deterministic. - -If no invariant config exists, invent plausible literals that satisfy the field types -(a display name string, an enum's first member, a cron string, etc.). - -## Step 4 — Write the six fixture files - -Copy each `templates/*.tmpl` into `acceptance/bundle/python/-support/`, -dropping the `.tmpl` suffix (e.g. `resources.py.tmpl` → `resources.py`), and fill -them in. The `.tmpl` suffix keeps the placeholder files out of the repo's linters; -the copied fixture files are real Python/YAML/TOML and must pass lint (step 7). -Placeholders: `PLURAL`, `SINGULAR`, `CLASS`, `NAME` (a short stem, e.g. `alert`), -`FIELD` (a required **string** field to mutate). - -1. **`databricks.yml`** — `bundle.name: my_project`, `sync: {paths: []}`, a top-level - `python:` block wiring `resources:load_resources` and `mutators:update_`, - and one YAML-declared resource `resources..my__1` with all required - fields. (`bundle validate` normalizes the `python:` key to `experimental.python` - in the output — that is expected, don't fight it.) -2. **`resources.py`** — `load_resources()` adds a second instance `my__2` via - `resources.add_(...)`, same required fields, slightly different values. -3. **`mutators.py`** — a `@_mutator` that `assert isinstance(...)` on a - required string field and `replace(...)`s it to append `" (updated)"`. The mutator - runs on **both** instances, so the golden shows the transform applied to each. -4. **`script`** — copy `templates/script` verbatim (`bundle validate --output json` - piped through `jq "pick(.experimental.python, .resources)"`). -5. **`test.toml`** — `Cloud = false`. Add `EnvMatrix.PYDAB_VERSION = ["current"]` for - a brand-new resource (it only exists in the current wheel, not the pinned older - one). Add `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]` only for a direct-only - resource — terraform is deprecated, so never add a `["terraform", "direct"]` - matrix. When unsure, copy the engine convention from the newest existing fixture - (`catalogs-support`), not an old one. -6. **`output.txt`** — do NOT hand-write; generate it in step 5. - -## Step 5 — Generate the golden output - -```sh -go test ./acceptance -run 'TestAccept/bundle/python/-support' -update -``` - -(or `./task test-update` to regenerate the whole suite). This writes `output.txt`. -Inspect it: both `my__1` and `my__2` must appear with the mutated field -showing `" (updated)"`, and only `experimental.python` + `resources` keys are present. - -## Step 6 — Verify it reproduces deterministically - -Re-run **without** `-update`. It must pass against the golden you just generated: - -```sh -go test ./acceptance -run 'TestAccept/bundle/python/-support' -count=1 -``` - -A test that only passes with `-update` is nondeterministic — investigate before -finishing (a `$VAR` left in a value, a non-deterministic field, an EnvMatrix variant -producing different output). Never stop at "golden written". - -## Step 7 — Confirm coverage and format - -```sh -(cd python && uv run --python 3.11 pytest databricks_tests/core/test_python_support.py) -./task fmt && ./task lint-q -``` - -`test_python_support_coverage` should now be green for this resource. If the resource -was previously in the `_LACKING` allowlist -(`python/databricks_tests/core/test_python_support.py`), remove its entry — the list -only shrinks. diff --git a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl deleted file mode 100644 index 18f303dd816..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/databricks.yml.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -bundle: - name: my_project - -sync: {paths: []} # don't need to copy files - -python: - resources: - - "resources:load_resources" - mutators: - - "mutators:update_SINGULAR" - -resources: - PLURAL: - my_NAME_1: - # required fields, realistic literal values (see SKILL.md steps 2-3) diff --git a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl deleted file mode 100644 index 4a2bfb94d89..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/mutators.py.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses import replace - -from databricks.bundles.PLURAL import CLASS -from databricks.bundles.core import SINGULAR_mutator - - -@SINGULAR_mutator -def update_SINGULAR(SINGULAR: CLASS) -> CLASS: - assert isinstance(SINGULAR.FIELD, str) - - return replace(SINGULAR, FIELD=f"{SINGULAR.FIELD} (updated)") diff --git a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl b/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl deleted file mode 100644 index 9360bec828a..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/resources.py.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -from databricks.bundles.core import Resources - - -def load_resources() -> Resources: - resources = Resources() - - resources.add_SINGULAR( - "my_NAME_2", - { - # same required fields as _1, slightly different values - }, - ) - - return resources diff --git a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl b/.agents/skills/pydabs-acceptance-test/templates/script.tmpl deleted file mode 100644 index e273fb45a53..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/script.tmpl +++ /dev/null @@ -1,5 +0,0 @@ - -trace uv run $UV_ARGS -q $CLI bundle validate --output json | \ - jq "pick(.experimental.python, .resources)" - -rm -fr .databricks __pycache__ diff --git a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl b/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl deleted file mode 100644 index 4935b9b020a..00000000000 --- a/.agents/skills/pydabs-acceptance-test/templates/test.toml.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -Cloud = false # tests don't interact with APIs - -# new resource, only in the current wheel: -# EnvMatrix.PYDAB_VERSION = ["current"] - -# direct-only resource (terraform is deprecated): -# EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] diff --git a/acceptance/bundle/python/README.md b/acceptance/bundle/python/README.md new file mode 100644 index 00000000000..942af63a6aa --- /dev/null +++ b/acceptance/bundle/python/README.md @@ -0,0 +1,48 @@ +# PyDABs resource acceptance tests + +Each `-support/` directory is the acceptance test for one PyDABs resource. It +checks that the resource loads both from YAML and from Python and that a mutator runs +over it. `test_python_support_coverage` +(`python/databricks_tests/core/test_python_support.py`) requires every PyDABs resource +to have one, so a newly-onboarded resource needs a fixture here. + +Copy an existing one — `alerts-support/` (a resource with required nested fields) or +`catalogs-support/` (direct-engine only) are the canonical examples. A fixture is six +files: + +- `databricks.yml` — `bundle.name: my_project`, `sync: {paths: []}`, a top-level + `python:` block wiring `resources:load_resources` + `mutators:update_`, and + one YAML-declared instance `.my__1`. +- `resources.py` — `load_resources()` adds a second instance `my__2` via + `resources.add_(...)`. +- `mutators.py` — a `@_mutator` that appends `" (updated)"` to a required + string field; it runs over both instances. +- `script` — copy it verbatim (`bundle validate --output json | jq "pick(...)"`). +- `test.toml` — `Cloud = false`. +- `output.txt` — generated, never hand-written. + +## Authoring a new one + +1. Confirm the resource is wired: `python/databricks/bundles//` exists, and + `add_` / `_mutator` are in `databricks.bundles.core`. If not, it + must be onboarded in PyDABs first. +2. Required fields are the `VariableOr[...]` (no default) fields in + `python/databricks/bundles//_models/.py`; set all of them, + recursing into required nested objects. `VariableOrOptional[...] = None` fields are + optional — omit them. +3. Get realistic values from `acceptance/bundle/invariant/configs/.yml.tmpl`, + but **adapt**: replace `$UNIQUE_NAME` / `$TEST_DEFAULT_WAREHOUSE_ID` and other `$VAR`s + with plain literals, and drop cloud-only blocks (`permissions`, `grants`, + `file_path`) — this test is local and deterministic. +4. `test.toml`: add `EnvMatrix.PYDAB_VERSION = ["current"]` for a brand-new resource + (it only exists in the current wheel), and `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = + ["direct"]` for a direct-only resource (terraform is deprecated — never a + `["terraform", "direct"]` matrix). Match the newest fixture when unsure. +5. Generate the golden: + `go test ./acceptance -run 'TestAccept/bundle/python/-support' -update`. +6. **Re-run without `-update`** — it must pass against the golden you just generated. A + test that only passes with `-update` is nondeterministic (usually a `$VAR` or a + volatile field left in); fix it before finishing. + +Note: `bundle validate` normalizes the `python:` key to `experimental.python` in the +output — that's expected. diff --git a/python/databricks_tests/core/test_python_support.py b/python/databricks_tests/core/test_python_support.py index ef8a113d56b..41a68d86943 100644 --- a/python/databricks_tests/core/test_python_support.py +++ b/python/databricks_tests/core/test_python_support.py @@ -1,8 +1,8 @@ """Coverage guard: every PyDABs resource must have an acceptance fixture. Asserts each resource in the _ResourceType registry has an -acceptance/bundle/python/-support/ fixture. New resources get one via the -pydabs-acceptance-test skill; this fails CI until it exists. +acceptance/bundle/python/-support/ fixture (see that directory's README.md for +how to author one); this fails CI until it exists. """ from pathlib import Path @@ -32,5 +32,5 @@ def test_python_support_coverage(plural: str): else: assert covered, ( f"no acceptance/bundle/python/{plural}-support/ fixture for {plural!r}; " - "author one with the pydabs-acceptance-test skill or add it to _LACKING" + "add one (see acceptance/bundle/python/README.md) or add it to _LACKING" ) From 9efbf121216d7ca100485788415ee33881252e84 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:04:40 +0000 Subject: [PATCH 49/52] update skill --- acceptance/bundle/python/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acceptance/bundle/python/README.md b/acceptance/bundle/python/README.md index 942af63a6aa..ba49b04fb3e 100644 --- a/acceptance/bundle/python/README.md +++ b/acceptance/bundle/python/README.md @@ -36,8 +36,7 @@ files: `file_path`) — this test is local and deterministic. 4. `test.toml`: add `EnvMatrix.PYDAB_VERSION = ["current"]` for a brand-new resource (it only exists in the current wheel), and `EnvMatrix.DATABRICKS_BUNDLE_ENGINE = - ["direct"]` for a direct-only resource (terraform is deprecated — never a - `["terraform", "direct"]` matrix). Match the newest fixture when unsure. + ["direct"]` for a direct-only resource. 5. Generate the golden: `go test ./acceptance -run 'TestAccept/bundle/python/-support' -update`. 6. **Re-run without `-update`** — it must pass against the golden you just generated. A From 3f15d684f188c6f7604cd0493d4966a4d0936325 Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:17:18 +0000 Subject: [PATCH 50/52] Check that .cursor/rules mirror .agents/rules Add tools/validate_cursor_rules.py (wired into `task checks`) so a rule under .agents/rules/ without its .cursor/rules/.mdc symlink fails CI; `--fix` auto-creates missing symlinks and drops stale ones. Also add the symlink for the new pydabs-acceptance-tests rule. Co-authored-by: Isaac --- .cursor/rules/pydabs-acceptance-tests.mdc | 1 + Taskfile.yml | 8 ++- tools/validate_cursor_rules.py | 72 +++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 120000 .cursor/rules/pydabs-acceptance-tests.mdc create mode 100755 tools/validate_cursor_rules.py diff --git a/.cursor/rules/pydabs-acceptance-tests.mdc b/.cursor/rules/pydabs-acceptance-tests.mdc new file mode 120000 index 00000000000..ffe41d4bbea --- /dev/null +++ b/.cursor/rules/pydabs-acceptance-tests.mdc @@ -0,0 +1 @@ +../../.agents/rules/pydabs-acceptance-tests.md \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 4d905d92eaf..cac5443f11e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -313,8 +313,13 @@ tasks: cmds: - "! git grep -lF databricks.com -- '*uv.lock' '*.py.lock'" + check-cursor-rules: + desc: Fail if a .agents/rules/*.md lacks its .cursor/rules/*.mdc symlink (--fix adds it) + cmds: + - "./tools/validate_cursor_rules.py" + checks: - desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles) + desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles, cursor-rules) # Sequential: `tidy` rewrites go.mod/go.sum and any future tidy work # touching more paths should not race with the whitespace scanner. cmds: @@ -323,6 +328,7 @@ tasks: - task: deadcode - task: check-changelog - task: check-lockfiles + - task: check-cursor-rules install-pythons: desc: Install Python 3.9-3.13 via uv diff --git a/tools/validate_cursor_rules.py b/tools/validate_cursor_rules.py new file mode 100755 index 00000000000..3ef9ce58953 --- /dev/null +++ b/tools/validate_cursor_rules.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.12" +# /// +"""Keep .cursor/rules/*.mdc symlinks in sync with .agents/rules/*.md. + +The canonical rules live in .agents/rules/.md; Cursor reads them from +.cursor/rules/.mdc, so each rule needs a .mdc symlink pointing back at its +.md. This validates that every rule has a correct symlink and that no symlink is +left dangling. Run with --fix to create missing symlinks and drop stale ones. + +Non-symlink .mdc files (e.g. the standalone 00-agents-context.mdc bootstrap) are +not mirrors of a rule and are left untouched. +""" + +import os +import sys + +AGENTS_RULES = ".agents/rules" +CURSOR_RULES = ".cursor/rules" + + +def link_target(stem): + # The .mdc lives in .cursor/rules/, so ../../ reaches the repo root. + return f"../../{AGENTS_RULES}/{stem}.md" + + +def main(): + fix = "--fix" in sys.argv + + stems = sorted(f[:-3] for f in os.listdir(AGENTS_RULES) if f.endswith(".md")) + problems = [] + + # Every rule must have a .mdc symlink pointing at its .md. + for stem in stems: + mdc = os.path.join(CURSOR_RULES, stem + ".mdc") + want = link_target(stem) + have = os.readlink(mdc) if os.path.islink(mdc) else None + if have == want: + continue + if fix: + if os.path.lexists(mdc): + os.remove(mdc) + os.symlink(want, mdc) + print(f"Linked {mdc} -> {want}") + else: + problems.append(f"{mdc}: missing or wrong symlink, expected -> {want}") + + # No .mdc symlink may point at a rule that no longer exists. + known = {stem + ".mdc" for stem in stems} + for name in sorted(os.listdir(CURSOR_RULES)): + path = os.path.join(CURSOR_RULES, name) + if not os.path.islink(path) or name in known: + continue + if fix: + os.remove(path) + print(f"Removed stale {path}") + else: + problems.append(f"{path}: stale symlink, no matching {AGENTS_RULES}/ rule") + + if problems: + print("\n".join(problems)) + print( + f"\n{len(problems)} problem(s). Run: ./tools/validate_cursor_rules.py --fix", + file=sys.stderr, + ) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From bcca02da9301148fc2ff07cead5544111d459f6d Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Fri, 4 Sep 2026 13:34:09 +0000 Subject: [PATCH 51/52] Drop cursor-rules symlink lint (moving to a separate PR) Remove tools/validate_cursor_rules.py and its check-cursor-rules task; the symlink-mirror check is being shipped on its own. Keep the .cursor/rules/pydabs-acceptance-tests.mdc symlink for the rule added here. Co-authored-by: Isaac --- Taskfile.yml | 8 +--- tools/validate_cursor_rules.py | 72 ---------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) delete mode 100755 tools/validate_cursor_rules.py diff --git a/Taskfile.yml b/Taskfile.yml index cac5443f11e..4d905d92eaf 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -313,13 +313,8 @@ tasks: cmds: - "! git grep -lF databricks.com -- '*uv.lock' '*.py.lock'" - check-cursor-rules: - desc: Fail if a .agents/rules/*.md lacks its .cursor/rules/*.mdc symlink (--fix adds it) - cmds: - - "./tools/validate_cursor_rules.py" - checks: - desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles, cursor-rules) + desc: Run quick checks (tidy, whitespace, deadcode, changelog, lockfiles) # Sequential: `tidy` rewrites go.mod/go.sum and any future tidy work # touching more paths should not race with the whitespace scanner. cmds: @@ -328,7 +323,6 @@ tasks: - task: deadcode - task: check-changelog - task: check-lockfiles - - task: check-cursor-rules install-pythons: desc: Install Python 3.9-3.13 via uv diff --git a/tools/validate_cursor_rules.py b/tools/validate_cursor_rules.py deleted file mode 100755 index 3ef9ce58953..00000000000 --- a/tools/validate_cursor_rules.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -# /// script -# requires-python = ">=3.12" -# /// -"""Keep .cursor/rules/*.mdc symlinks in sync with .agents/rules/*.md. - -The canonical rules live in .agents/rules/.md; Cursor reads them from -.cursor/rules/.mdc, so each rule needs a .mdc symlink pointing back at its -.md. This validates that every rule has a correct symlink and that no symlink is -left dangling. Run with --fix to create missing symlinks and drop stale ones. - -Non-symlink .mdc files (e.g. the standalone 00-agents-context.mdc bootstrap) are -not mirrors of a rule and are left untouched. -""" - -import os -import sys - -AGENTS_RULES = ".agents/rules" -CURSOR_RULES = ".cursor/rules" - - -def link_target(stem): - # The .mdc lives in .cursor/rules/, so ../../ reaches the repo root. - return f"../../{AGENTS_RULES}/{stem}.md" - - -def main(): - fix = "--fix" in sys.argv - - stems = sorted(f[:-3] for f in os.listdir(AGENTS_RULES) if f.endswith(".md")) - problems = [] - - # Every rule must have a .mdc symlink pointing at its .md. - for stem in stems: - mdc = os.path.join(CURSOR_RULES, stem + ".mdc") - want = link_target(stem) - have = os.readlink(mdc) if os.path.islink(mdc) else None - if have == want: - continue - if fix: - if os.path.lexists(mdc): - os.remove(mdc) - os.symlink(want, mdc) - print(f"Linked {mdc} -> {want}") - else: - problems.append(f"{mdc}: missing or wrong symlink, expected -> {want}") - - # No .mdc symlink may point at a rule that no longer exists. - known = {stem + ".mdc" for stem in stems} - for name in sorted(os.listdir(CURSOR_RULES)): - path = os.path.join(CURSOR_RULES, name) - if not os.path.islink(path) or name in known: - continue - if fix: - os.remove(path) - print(f"Removed stale {path}") - else: - problems.append(f"{path}: stale symlink, no matching {AGENTS_RULES}/ rule") - - if problems: - print("\n".join(problems)) - print( - f"\n{len(problems)} problem(s). Run: ./tools/validate_cursor_rules.py --fix", - file=sys.stderr, - ) - return 1 - return 0 - - -if __name__ == "__main__": - sys.exit(main()) From 6f4a0b40909ff5d359096b72a70737dd38e6063b Mon Sep 17 00:00:00 2001 From: Sankalp-Mittal Date: Tue, 8 Sep 2026 15:03:56 +0000 Subject: [PATCH 52/52] Fail loudly on enum member name collisions Two distinct enum values that sanitize to the same member name (e.g. "a-b" and "a_b") would silently overwrite each other in the values dict, dropping a member. Raise instead. No collisions today. Co-authored-by: Isaac --- python/codegen/codegen/generated_enum.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/codegen/codegen/generated_enum.py b/python/codegen/codegen/generated_enum.py index 8f6b4ecbcaa..a9a551a26a1 100644 --- a/python/codegen/codegen/generated_enum.py +++ b/python/codegen/codegen/generated_enum.py @@ -28,7 +28,13 @@ def generate_enum(namespace: str, schema_name: str, schema: Schema) -> Generated assert package for value in schema.enum: - values[_camel_to_upper_snake(value)] = value + name = _camel_to_upper_snake(value) + # Distinct values must not collapse to the same member (e.g. "a-b" and "a_b"). + if name in values: + raise ValueError( + f"{schema_name}: enum values {values[name]!r} and {value!r} both map to member {name!r}" + ) + values[name] = value return GeneratedEnum( class_name=class_name,