From 042c8d88c6f7af28221ad125d8aece8e6a7131d5 Mon Sep 17 00:00:00 2001 From: Ilya Kuznetsov Date: Wed, 18 Dec 2024 11:19:14 +0100 Subject: [PATCH] Custom annotations for bundle-specific JSON schema fields (#1957) ## Changes Adds annotations to json-schema for fields which are not covered by OpenAPI spec. Custom descriptions were copy-pasted from documentation PR which is still WIP so descriptions for some fields are missing Further improvements: * documentation autogen based on json-schema * fix missing descriptions ## Tests This script is not part of CLI package so I didn't test all corner cases. Few high-level tests were added to be sure that schema annotations is in sync with actual config --------- Co-authored-by: Pieter Noordhuis --- .codegen.json | 2 +- .github/workflows/push.yml | 9 +- Makefile | 6 +- bundle/internal/schema/annotations.go | 209 ++ bundle/internal/schema/annotations.yml | 501 ++++ .../internal/schema/annotations_openapi.yml | 2585 +++++++++++++++++ .../schema/annotations_openapi_overrides.yml | 155 + bundle/internal/schema/annotations_test.go | 44 + bundle/internal/schema/main.go | 45 +- bundle/internal/schema/main_test.go | 125 + bundle/internal/schema/parser.go | 110 +- .../schema/testdata/pass/target_variable.yml | 5 + bundle/schema/embed_test.go | 6 +- bundle/schema/jsonschema.json | 601 ++-- libs/jsonschema/extension.go | 6 + libs/jsonschema/schema.go | 7 + 16 files changed, 4143 insertions(+), 273 deletions(-) create mode 100644 bundle/internal/schema/annotations.go create mode 100644 bundle/internal/schema/annotations.yml create mode 100644 bundle/internal/schema/annotations_openapi.yml create mode 100644 bundle/internal/schema/annotations_openapi_overrides.yml create mode 100644 bundle/internal/schema/annotations_test.go create mode 100644 bundle/internal/schema/main_test.go create mode 100644 bundle/internal/schema/testdata/pass/target_variable.yml diff --git a/.codegen.json b/.codegen.json index 73ab8c2a..735e1ee3 100644 --- a/.codegen.json +++ b/.codegen.json @@ -11,7 +11,7 @@ "required": ["go"], "post_generate": [ "go test -timeout 240s -run TestConsistentDatabricksSdkVersion github.com/databricks/cli/internal/build", - "go run ./bundle/internal/schema/*.go ./bundle/schema/jsonschema.json", + "make schema", "echo 'bundle/internal/tf/schema/\\*.go linguist-generated=true' >> ./.gitattributes", "echo 'go.sum linguist-generated=true' >> ./.gitattributes", "echo 'bundle/schema/jsonschema.json linguist-generated=true' >> ./.gitattributes" diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6e07f461..ea561805 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -99,14 +99,19 @@ jobs: # By default the ajv-cli runs in strict mode which will fail if the schema # itself is not valid. Strict mode is more strict than the JSON schema # specification. See for details: https://ajv.js.org/options.html#strict-mode-options + # The ajv-cli is configured to use the markdownDescription keyword which is not part of the JSON schema specification, + # but is used in editors like VSCode to render markdown in the description field - name: Validate bundle schema run: | go run main.go bundle schema > schema.json + # Add markdownDescription keyword to ajv + echo "module.exports=function(a){a.addKeyword('markdownDescription')}" >> keywords.js + for file in ./bundle/internal/schema/testdata/pass/*.yml; do - ajv test -s schema.json -d $file --valid + ajv test -s schema.json -d $file --valid -c=./keywords.js done for file in ./bundle/internal/schema/testdata/fail/*.yml; do - ajv test -s schema.json -d $file --invalid + ajv test -s schema.json -d $file --invalid -c=./keywords.js done diff --git a/Makefile b/Makefile index a7c0584f..f8e7834a 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,10 @@ snapshot: vendor: @echo "✓ Filling vendor folder with library code ..." @go mod vendor + +schema: + @echo "✓ Generating json-schema ..." + @go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json INTEGRATION = gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h @@ -38,4 +42,4 @@ integration: integration-short: $(INTEGRATION) -short -.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration integration-short +.PHONY: lint lintcheck test testonly coverage build snapshot vendor schema integration integration-short diff --git a/bundle/internal/schema/annotations.go b/bundle/internal/schema/annotations.go new file mode 100644 index 00000000..aec5e68b --- /dev/null +++ b/bundle/internal/schema/annotations.go @@ -0,0 +1,209 @@ +package main + +import ( + "bytes" + "fmt" + "os" + "reflect" + "regexp" + "strings" + + yaml3 "gopkg.in/yaml.v3" + + "github.com/databricks/cli/libs/dyn" + "github.com/databricks/cli/libs/dyn/convert" + "github.com/databricks/cli/libs/dyn/merge" + "github.com/databricks/cli/libs/dyn/yamlloader" + "github.com/databricks/cli/libs/dyn/yamlsaver" + "github.com/databricks/cli/libs/jsonschema" +) + +type annotation struct { + Description string `json:"description,omitempty"` + MarkdownDescription string `json:"markdown_description,omitempty"` + Title string `json:"title,omitempty"` + Default any `json:"default,omitempty"` + Enum []any `json:"enum,omitempty"` +} + +type annotationHandler struct { + // Annotations read from all annotation files including all overrides + parsedAnnotations annotationFile + // Missing annotations for fields that are found in config that need to be added to the annotation file + missingAnnotations annotationFile +} + +/** + * Parsed file with annotations, expected format: + * github.com/databricks/cli/bundle/config.Bundle: + * cluster_id: + * description: "Description" + */ +type annotationFile map[string]map[string]annotation + +const Placeholder = "PLACEHOLDER" + +// Adds annotations to the JSON schema reading from the annotation files. +// More details https://json-schema.org/understanding-json-schema/reference/annotations +func newAnnotationHandler(sources []string) (*annotationHandler, error) { + prev := dyn.NilValue + for _, path := range sources { + b, err := os.ReadFile(path) + if err != nil { + return nil, err + } + generated, err := yamlloader.LoadYAML(path, bytes.NewBuffer(b)) + if err != nil { + return nil, err + } + prev, err = merge.Merge(prev, generated) + if err != nil { + return nil, err + } + } + + var data annotationFile + + err := convert.ToTyped(&data, prev) + if err != nil { + return nil, err + } + + d := &annotationHandler{} + d.parsedAnnotations = data + d.missingAnnotations = annotationFile{} + return d, nil +} + +func (d *annotationHandler) addAnnotations(typ reflect.Type, s jsonschema.Schema) jsonschema.Schema { + refPath := getPath(typ) + shouldHandle := strings.HasPrefix(refPath, "github.com") + if !shouldHandle { + return s + } + + annotations := d.parsedAnnotations[refPath] + if annotations == nil { + annotations = map[string]annotation{} + } + + rootTypeAnnotation, ok := annotations[RootTypeKey] + if ok { + assignAnnotation(&s, rootTypeAnnotation) + } + + for k, v := range s.Properties { + item := annotations[k] + if item.Description == "" { + item.Description = Placeholder + + emptyAnnotations := d.missingAnnotations[refPath] + if emptyAnnotations == nil { + emptyAnnotations = map[string]annotation{} + d.missingAnnotations[refPath] = emptyAnnotations + } + emptyAnnotations[k] = item + } + assignAnnotation(v, item) + } + return s +} + +// Writes missing annotations with placeholder values back to the annotation file +func (d *annotationHandler) syncWithMissingAnnotations(outputPath string) error { + existingFile, err := os.ReadFile(outputPath) + if err != nil { + return err + } + existing, err := yamlloader.LoadYAML("", bytes.NewBuffer(existingFile)) + if err != nil { + return err + } + missingAnnotations, err := convert.FromTyped(&d.missingAnnotations, dyn.NilValue) + if err != nil { + return err + } + + output, err := merge.Merge(existing, missingAnnotations) + if err != nil { + return err + } + + err = saveYamlWithStyle(outputPath, output) + if err != nil { + return err + } + return nil +} + +func getPath(typ reflect.Type) string { + return typ.PkgPath() + "." + typ.Name() +} + +func assignAnnotation(s *jsonschema.Schema, a annotation) { + if a.Description != Placeholder { + s.Description = a.Description + } + + if a.Default != nil { + s.Default = a.Default + } + s.MarkdownDescription = convertLinksToAbsoluteUrl(a.MarkdownDescription) + s.Title = a.Title + s.Enum = a.Enum +} + +func saveYamlWithStyle(outputPath string, input dyn.Value) error { + style := map[string]yaml3.Style{} + file, _ := input.AsMap() + for _, v := range file.Keys() { + style[v.MustString()] = yaml3.LiteralStyle + } + + saver := yamlsaver.NewSaverWithStyle(style) + err := saver.SaveAsYAML(file, outputPath, true) + if err != nil { + return err + } + return nil +} + +func convertLinksToAbsoluteUrl(s string) string { + if s == "" { + return s + } + base := "https://docs.databricks.com" + referencePage := "/dev-tools/bundles/reference.html" + + // Regular expression to match Markdown-style links like [_](link) + re := regexp.MustCompile(`\[_\]\(([^)]+)\)`) + result := re.ReplaceAllStringFunc(s, func(match string) string { + matches := re.FindStringSubmatch(match) + if len(matches) < 2 { + return match + } + link := matches[1] + var text, absoluteURL string + + if strings.HasPrefix(link, "#") { + text = strings.TrimPrefix(link, "#") + absoluteURL = fmt.Sprintf("%s%s%s", base, referencePage, link) + + // Handle relative paths like /dev-tools/bundles/resources.html#dashboard + } else if strings.HasPrefix(link, "/") { + absoluteURL = strings.ReplaceAll(fmt.Sprintf("%s%s", base, link), ".md", ".html") + if strings.Contains(link, "#") { + parts := strings.Split(link, "#") + text = parts[1] + } else { + text = "link" + } + } else { + return match + } + + return fmt.Sprintf("[%s](%s)", text, absoluteURL) + }) + + return result +} diff --git a/bundle/internal/schema/annotations.yml b/bundle/internal/schema/annotations.yml new file mode 100644 index 00000000..e52189da --- /dev/null +++ b/bundle/internal/schema/annotations.yml @@ -0,0 +1,501 @@ +github.com/databricks/cli/bundle/config.Artifact: + "build": + "description": |- + An optional set of non-default build commands that you want to run locally before deployment. + + For Python wheel builds, the Databricks CLI assumes that it can find a local install of the Python wheel package to run builds, and it runs the command python setup.py bdist_wheel by default during each bundle deployment. + + To specify multiple build commands, separate each command with double-ampersand (&&) characters. + "executable": + "description": |- + The executable type. + "files": + "description": |- + The source files for the artifact. + "markdown_description": |- + The source files for the artifact, defined as an [_](#artifact_file). + "path": + "description": |- + The location where the built artifact will be saved. + "type": + "description": |- + The type of the artifact. + "markdown_description": |- + The type of the artifact. Valid values are `wheel` or `jar` +github.com/databricks/cli/bundle/config.ArtifactFile: + "source": + "description": |- + The path of the files used to build the artifact. +github.com/databricks/cli/bundle/config.Bundle: + "cluster_id": + "description": |- + The ID of a cluster to use to run the bundle. + "markdown_description": |- + The ID of a cluster to use to run the bundle. See [_](/dev-tools/bundles/settings.md#cluster_id). + "compute_id": + "description": |- + PLACEHOLDER + "databricks_cli_version": + "description": |- + The Databricks CLI version to use for the bundle. + "markdown_description": |- + The Databricks CLI version to use for the bundle. See [_](/dev-tools/bundles/settings.md#databricks_cli_version). + "deployment": + "description": |- + The definition of the bundle deployment + "markdown_description": |- + The definition of the bundle deployment. For supported attributes, see [_](#deployment) and [_](/dev-tools/bundles/deployment-modes.md). + "git": + "description": |- + The Git version control details that are associated with your bundle. + "markdown_description": |- + The Git version control details that are associated with your bundle. For supported attributes, see [_](#git) and [_](/dev-tools/bundles/settings.md#git). + "name": + "description": |- + The name of the bundle. + "uuid": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config.Deployment: + "fail_on_active_runs": + "description": |- + Whether to fail on active runs. If this is set to true a deployment that is running can be interrupted. + "lock": + "description": |- + The deployment lock attributes. + "markdown_description": |- + The deployment lock attributes. See [_](#lock). +github.com/databricks/cli/bundle/config.Experimental: + "pydabs": + "description": |- + The PyDABs configuration. + "python_wheel_wrapper": + "description": |- + Whether to use a Python wheel wrapper + "scripts": + "description": |- + The commands to run + "use_legacy_run_as": + "description": |- + Whether to use the legacy run_as behavior +github.com/databricks/cli/bundle/config.Git: + "branch": + "description": |- + The Git branch name. + "markdown_description": |- + The Git branch name. See [_](/dev-tools/bundles/settings.md#git). + "origin_url": + "description": |- + The origin URL of the repository. + "markdown_description": |- + The origin URL of the repository. See [_](/dev-tools/bundles/settings.md#git). +github.com/databricks/cli/bundle/config.Lock: + "enabled": + "description": |- + Whether this lock is enabled. + "force": + "description": |- + Whether to force this lock if it is enabled. +github.com/databricks/cli/bundle/config.Presets: + "jobs_max_concurrent_runs": + "description": |- + The maximum concurrent runs for a job. + "name_prefix": + "description": |- + The prefix for job runs of the bundle. + "pipelines_development": + "description": |- + Whether pipeline deployments should be locked in development mode. + "source_linked_deployment": + "description": |- + Whether to link the deployment to the bundle source. + "tags": + "description": |- + The tags for the bundle deployment. + "trigger_pause_status": + "description": |- + A pause status to apply to all job triggers and schedules. Valid values are PAUSED or UNPAUSED. +github.com/databricks/cli/bundle/config.PyDABs: + "enabled": + "description": |- + Whether or not PyDABs (Private Preview) is enabled + "import": + "description": |- + The PyDABs project to import to discover resources, resource generator and mutators + "venv_path": + "description": |- + The Python virtual environment path +github.com/databricks/cli/bundle/config.Resources: + "clusters": + "description": |- + The cluster definitions for the bundle. + "markdown_description": |- + The cluster definitions for the bundle. See [_](/dev-tools/bundles/resources.md#cluster) + "dashboards": + "description": |- + The dashboard definitions for the bundle. + "markdown_description": |- + The dashboard definitions for the bundle. See [_](/dev-tools/bundles/resources.md#dashboard) + "experiments": + "description": |- + The experiment definitions for the bundle. + "markdown_description": |- + The experiment definitions for the bundle. See [_](/dev-tools/bundles/resources.md#experiment) + "jobs": + "description": |- + The job definitions for the bundle. + "markdown_description": |- + The job definitions for the bundle. See [_](/dev-tools/bundles/resources.md#job) + "model_serving_endpoints": + "description": |- + The model serving endpoint definitions for the bundle. + "markdown_description": |- + The model serving endpoint definitions for the bundle. See [_](/dev-tools/bundles/resources.md#model_serving_endpoint) + "models": + "description": |- + The model definitions for the bundle. + "markdown_description": |- + The model definitions for the bundle. See [_](/dev-tools/bundles/resources.md#model) + "pipelines": + "description": |- + The pipeline definitions for the bundle. + "markdown_description": |- + The pipeline definitions for the bundle. See [_](/dev-tools/bundles/resources.md#pipeline) + "quality_monitors": + "description": |- + The quality monitor definitions for the bundle. + "markdown_description": |- + The quality monitor definitions for the bundle. See [_](/dev-tools/bundles/resources.md#quality_monitor) + "registered_models": + "description": |- + The registered model definitions for the bundle. + "markdown_description": |- + The registered model definitions for the bundle. See [_](/dev-tools/bundles/resources.md#registered_model) + "schemas": + "description": |- + The schema definitions for the bundle. + "markdown_description": |- + The schema definitions for the bundle. See [_](/dev-tools/bundles/resources.md#schema) + "volumes": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config.Root: + "artifacts": + "description": |- + Defines the attributes to build an artifact + "bundle": + "description": |- + The attributes of the bundle. + "markdown_description": |- + The attributes of the bundle. See [_](/dev-tools/bundles/settings.md#bundle) + "experimental": + "description": |- + Defines attributes for experimental features. + "include": + "description": |- + Specifies a list of path globs that contain configuration files to include within the bundle. + "markdown_description": |- + Specifies a list of path globs that contain configuration files to include within the bundle. See [_](/dev-tools/bundles/settings.md#include) + "permissions": + "description": |- + Defines the permissions to apply to experiments, jobs, pipelines, and models defined in the bundle + "markdown_description": |- + Defines the permissions to apply to experiments, jobs, pipelines, and models defined in the bundle. See [_](/dev-tools/bundles/settings.md#permissions) and [_](/dev-tools/bundles/permissions.md). + "presets": + "description": |- + Defines bundle deployment presets. + "markdown_description": |- + Defines bundle deployment presets. See [_](/dev-tools/bundles/deployment-modes.md#presets). + "resources": + "description": |- + Specifies information about the Databricks resources used by the bundle + "markdown_description": |- + Specifies information about the Databricks resources used by the bundle. See [_](/dev-tools/bundles/resources.md). + "run_as": + "description": |- + The identity to use to run the bundle. + "sync": + "description": |- + The files and file paths to include or exclude in the bundle. + "markdown_description": |- + The files and file paths to include or exclude in the bundle. See [_](/dev-tools/bundles/) + "targets": + "description": |- + Defines deployment targets for the bundle. + "variables": + "description": |- + A Map that defines the custom variables for the bundle, where each key is the name of the variable, and the value is a Map that defines the variable. + "workspace": + "description": |- + Defines the Databricks workspace for the bundle. +github.com/databricks/cli/bundle/config.Sync: + "exclude": + "description": |- + A list of files or folders to exclude from the bundle. + "include": + "description": |- + A list of files or folders to include in the bundle. + "paths": + "description": |- + The local folder paths, which can be outside the bundle root, to synchronize to the workspace when the bundle is deployed. +github.com/databricks/cli/bundle/config.Target: + "artifacts": + "description": |- + The artifacts to include in the target deployment. + "markdown_description": |- + The artifacts to include in the target deployment. See [_](#artifact) + "bundle": + "description": |- + The name of the bundle when deploying to this target. + "cluster_id": + "description": |- + The ID of the cluster to use for this target. + "compute_id": + "description": |- + Deprecated. The ID of the compute to use for this target. + "default": + "description": |- + Whether this target is the default target. + "git": + "description": |- + The Git version control settings for the target. + "markdown_description": |- + The Git version control settings for the target. See [_](#git). + "mode": + "description": |- + The deployment mode for the target. + "markdown_description": |- + The deployment mode for the target. Valid values are `development` or `production`. See [_](/dev-tools/bundles/deployment-modes.md). + "permissions": + "description": |- + The permissions for deploying and running the bundle in the target. + "markdown_description": |- + The permissions for deploying and running the bundle in the target. See [_](#permission). + "presets": + "description": |- + The deployment presets for the target. + "markdown_description": |- + The deployment presets for the target. See [_](#preset). + "resources": + "description": |- + The resource definitions for the target. + "markdown_description": |- + The resource definitions for the target. See [_](#resources). + "run_as": + "description": |- + The identity to use to run the bundle. + "markdown_description": |- + The identity to use to run the bundle. See [_](#job_run_as) and [_](/dev-tools/bundles/run_as.md). + "sync": + "description": |- + The local paths to sync to the target workspace when a bundle is run or deployed. + "markdown_description": |- + The local paths to sync to the target workspace when a bundle is run or deployed. See [_](#sync). + "variables": + "description": |- + The custom variable definitions for the target. + "markdown_description": |- + The custom variable definitions for the target. See [_](/dev-tools/bundles/settings.md#variables) and [_](/dev-tools/bundles/variables.md). + "workspace": + "description": |- + The Databricks workspace for the target. + "markdown_description": |- + The Databricks workspace for the target. [_](#workspace) +github.com/databricks/cli/bundle/config.Workspace: + "artifact_path": + "description": |- + The artifact path to use within the workspace for both deployments and workflow runs + "auth_type": + "description": |- + The authentication type. + "azure_client_id": + "description": |- + The Azure client ID + "azure_environment": + "description": |- + The Azure environment + "azure_login_app_id": + "description": |- + The Azure login app ID + "azure_tenant_id": + "description": |- + The Azure tenant ID + "azure_use_msi": + "description": |- + Whether to use MSI for Azure + "azure_workspace_resource_id": + "description": |- + The Azure workspace resource ID + "client_id": + "description": |- + The client ID for the workspace + "file_path": + "description": |- + The file path to use within the workspace for both deployments and workflow runs + "google_service_account": + "description": |- + The Google service account name + "host": + "description": |- + The Databricks workspace host URL + "profile": + "description": |- + The Databricks workspace profile name + "resource_path": + "description": |- + The workspace resource path + "root_path": + "description": |- + The Databricks workspace root path + "state_path": + "description": |- + The workspace state path +github.com/databricks/cli/bundle/config/resources.Grant: + "principal": + "description": |- + The name of the principal that will be granted privileges + "privileges": + "description": |- + The privileges to grant to the specified entity +github.com/databricks/cli/bundle/config/resources.Permission: + "group_name": + "description": |- + The name of the group that has the permission set in level. + "level": + "description": |- + The allowed permission for user, group, service principal defined for this permission. + "service_principal_name": + "description": |- + The name of the service principal that has the permission set in level. + "user_name": + "description": |- + The name of the user that has the permission set in level. +github.com/databricks/cli/bundle/config/variable.Lookup: + "alert": + "description": |- + PLACEHOLDER + "cluster": + "description": |- + PLACEHOLDER + "cluster_policy": + "description": |- + PLACEHOLDER + "dashboard": + "description": |- + PLACEHOLDER + "instance_pool": + "description": |- + PLACEHOLDER + "job": + "description": |- + PLACEHOLDER + "metastore": + "description": |- + PLACEHOLDER + "notification_destination": + "description": |- + PLACEHOLDER + "pipeline": + "description": |- + PLACEHOLDER + "query": + "description": |- + PLACEHOLDER + "service_principal": + "description": |- + PLACEHOLDER + "warehouse": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/variable.TargetVariable: + "default": + "description": |- + PLACEHOLDER + "description": + "description": |- + The description of the variable. + "lookup": + "description": |- + The name of the alert, cluster_policy, cluster, dashboard, instance_pool, job, metastore, pipeline, query, service_principal, or warehouse object for which to retrieve an ID. + "type": + "description": |- + The type of the variable. + "markdown_description": + "description": |- + The type of the variable. +github.com/databricks/cli/bundle/config/variable.Variable: + "default": + "description": |- + PLACEHOLDER + "description": + "description": |- + The description of the variable + "lookup": + "description": |- + The name of the alert, cluster_policy, cluster, dashboard, instance_pool, job, metastore, pipeline, query, service_principal, or warehouse object for which to retrieve an ID. + "markdown_description": |- + The name of the `alert`, `cluster_policy`, `cluster`, `dashboard`, `instance_pool`, `job`, `metastore`, `pipeline`, `query`, `service_principal`, or `warehouse` object for which to retrieve an ID." + "type": + "description": |- + The type of the variable. +github.com/databricks/databricks-sdk-go/service/serving.Ai21LabsConfig: + "ai21labs_api_key": + "description": |- + PLACEHOLDER + "ai21labs_api_key_plaintext": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/serving.GoogleCloudVertexAiConfig: + "private_key": + "description": |- + PLACEHOLDER + "private_key_plaintext": + "description": |- + PLACEHOLDER + "project_id": + "description": |- + PLACEHOLDER + "region": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/serving.OpenAiConfig: + "microsoft_entra_client_id": + "description": |- + PLACEHOLDER + "microsoft_entra_client_secret": + "description": |- + PLACEHOLDER + "microsoft_entra_client_secret_plaintext": + "description": |- + PLACEHOLDER + "microsoft_entra_tenant_id": + "description": |- + PLACEHOLDER + "openai_api_base": + "description": |- + PLACEHOLDER + "openai_api_key": + "description": |- + PLACEHOLDER + "openai_api_key_plaintext": + "description": |- + PLACEHOLDER + "openai_api_type": + "description": |- + PLACEHOLDER + "openai_api_version": + "description": |- + PLACEHOLDER + "openai_deployment_name": + "description": |- + PLACEHOLDER + "openai_organization": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/serving.PaLmConfig: + "palm_api_key": + "description": |- + PLACEHOLDER + "palm_api_key_plaintext": + "description": |- + PLACEHOLDER diff --git a/bundle/internal/schema/annotations_openapi.yml b/bundle/internal/schema/annotations_openapi.yml new file mode 100644 index 00000000..8cedada5 --- /dev/null +++ b/bundle/internal/schema/annotations_openapi.yml @@ -0,0 +1,2585 @@ +# This file is auto-generated. DO NOT EDIT. +github.com/databricks/cli/bundle/config/resources.Cluster: + 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. + autoscale: + description: |- + 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: + description: |- + 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: + description: |- + 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: + description: |- + 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: + description: |- + The configuration for delivering spark logs to a long-term storage destination. + Two kinds of destinations (dbfs and s3) 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: + description: | + 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. + custom_tags: + description: |- + 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: {} + docker_image: {} + driver_instance_pool_id: + description: |- + 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_id: + description: | + 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. + enable_elastic_disk: + description: |- + Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + space when its Spark workers are running low on disk space. This feature requires specific AWS + permissions to function correctly - refer to the User Guide for more details. + enable_local_disk_encryption: + description: Whether to enable LUKS on cluster VMs' local disks + gcp_attributes: + description: |- + 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: + 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 `//init_scripts`. + instance_pool_id: + description: The optional ID of the instance pool to which the cluster belongs. + node_type_id: + description: | + 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 :method:clusters/listNodeTypes API call. + num_workers: + description: |- + 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. + policy_id: + description: The ID of the cluster policy used to create the cluster if applicable. + runtime_engine: {} + single_user_name: + description: Single user name if data_security_mode is `SINGLE_USER` + spark_conf: + description: | + 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: + description: |- + 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: + description: | + 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 :method:clusters/sparkVersions API call. + ssh_public_keys: + description: |- + 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. + workload_type: {} +github.com/databricks/cli/bundle/config/resources.Dashboard: + create_time: + description: The timestamp of when the dashboard was created. + dashboard_id: + description: UUID identifying the dashboard. + display_name: + description: The display name of the dashboard. + etag: + description: |- + The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard + has not been modified since the last read. + This field is excluded in List Dashboards responses. + lifecycle_state: + description: The state of the dashboard resource. Used for tracking trashed status. + parent_path: + description: |- + The workspace path of the folder containing the dashboard. Includes leading slash and no + trailing slash. + This field is excluded in List Dashboards responses. + path: + description: |- + The workspace path of the dashboard asset, including the file name. + Exported dashboards always have the file extension `.lvdash.json`. + This field is excluded in List Dashboards responses. + serialized_dashboard: + description: |- + The contents of the dashboard in serialized string form. + This field is excluded in List Dashboards responses. + Use the [get dashboard API](https://docs.databricks.com/api/workspace/lakeview/get) + to retrieve an example response, which includes the `serialized_dashboard` field. + This field provides the structure of the JSON string that represents the dashboard's + layout and components. + update_time: + description: |- + The timestamp of when the dashboard was last updated by the user. + This field is excluded in List Dashboards responses. + warehouse_id: + description: The warehouse ID used to run the dashboard. +github.com/databricks/cli/bundle/config/resources.Job: + budget_policy_id: + description: |- + The id of the user specified budget policy to use for this job. + If not specified, a default budget policy may be applied when creating or modifying the job. + See `effective_budget_policy_id` for the budget policy used by this workload. + 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. + deployment: + description: Deployment information for jobs managed by external sources. + description: + description: An optional description for the job. The maximum length is 27700 + characters in UTF-8 encoding. + edit_mode: + description: |- + Edit mode of the job. + + * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. + * `EDITABLE`: The job is in an editable state and can be modified. + 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. + environments: + description: |- + A list of task execution environment specifications that can be referenced by serverless tasks of this job. + An environment is required to be present for serverless tasks. + For serverless notebook tasks, the environment is accessible in the notebook environment panel. + For other serverless tasks, the task environment is required to be specified using environment_key in the task settings. + format: + description: Used to tell what is the format of the job. This field is ignored + in Create/Update/Reset calls. When using the Jobs API 2.1 this value is always + set to `"MULTI_TASK"`. + 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. + + If `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. + + Note: 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. + health: {} + 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. + max_concurrent_runs: + description: |- + An optional maximum allowed number of concurrent runs of the job. + Set this value if you want to be able to execute multiple runs of the same job concurrently. + This 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. + This 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. + However, from then on, new runs are skipped unless there are fewer than 3 active runs. + This value cannot exceed 1000. Setting this value to `0` causes all new runs to be skipped. + name: + description: An optional name for the job. The maximum length is 4096 bytes in + UTF-8 encoding. + notification_settings: + description: Optional notification settings that are used when sending notifications + to each of the `email_notifications` and `webhook_notifications` for this job. + parameters: + description: Job-level parameter definitions + queue: + description: The queue settings of the job. + run_as: {} + 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`. + 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. + tasks: + description: A list of task specifications to be executed by this job. + timeout_seconds: + description: An optional timeout applied to each run of this job. A value of `0` + means no timeout. + 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`. + webhook_notifications: + description: A collection of system notification IDs to notify when runs of this + job begin or complete. +github.com/databricks/cli/bundle/config/resources.MlflowExperiment: + artifact_location: + description: Location where artifacts for the experiment are stored. + creation_time: + description: Creation time + experiment_id: + description: Unique identifier for the experiment. + last_update_time: + description: Last update time + lifecycle_stage: + description: |- + Current life cycle stage of the experiment: "active" or "deleted". + Deleted experiments are not returned by APIs. + name: + description: Human readable name that identifies the experiment. + tags: + description: 'Tags: Additional metadata key-value pairs.' +github.com/databricks/cli/bundle/config/resources.MlflowModel: + creation_timestamp: + description: Timestamp recorded when this `registered_model` was created. + description: + description: Description of this `registered_model`. + last_updated_timestamp: + description: Timestamp recorded when metadata for this `registered_model` was + last updated. + latest_versions: + description: |- + Collection of latest model versions for each stage. + Only contains models with current `READY` status. + name: + description: Unique name for the model. + tags: + description: 'Tags: Additional metadata key-value pairs for this `registered_model`.' + user_id: + description: User that created this `registered_model` +github.com/databricks/cli/bundle/config/resources.ModelServingEndpoint: + ai_gateway: + description: 'The AI Gateway configuration for the serving endpoint. NOTE: only + external model endpoints are supported as of now.' + config: + description: The core config of the serving endpoint. + name: + description: | + 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. + 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.' + route_optimized: + description: Enable route optimization for the serving endpoint. + tags: + description: Tags to be attached to the serving endpoint and automatically propagated + to billing logs. +github.com/databricks/cli/bundle/config/resources.Pipeline: + budget_policy_id: + description: Budget policy of this pipeline. + 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. + channel: + description: DLT Release Channel that specifies which version to use. + clusters: + description: Cluster settings for this pipeline deployment. + configuration: + description: String-String configuration for this pipeline execution. + continuous: + description: Whether the pipeline is continuous or triggered. This replaces `trigger`. + deployment: + description: Deployment type of this pipeline. + development: + description: Whether the pipeline is in Development mode. Defaults to false. + edition: + description: Pipeline product edition. + filters: + description: Filters on which Pipeline packages to include in the deployed graph. + gateway_definition: + description: The definition of a gateway pipeline to support change data capture. + id: + description: Unique identifier for this pipeline. + ingestion_definition: + description: The configuration for a managed ingestion pipeline. These settings + cannot be used with the 'libraries', 'target' or 'catalog' settings. + libraries: + description: Libraries or code needed by this deployment. + name: + description: Friendly identifier for this pipeline. + notifications: + description: List of notification settings for this pipeline. + photon: + description: Whether Photon is enabled for this pipeline. + restart_window: + description: Restart window of this pipeline. + schema: + description: The default schema (database) where tables are read from or published + to. The presence of this field implies that the pipeline is in direct publishing + mode. + serverless: + description: Whether serverless compute is enabled for this pipeline. + storage: + description: DBFS root directory for storing checkpoints and tables. + target: + description: Target schema (database) to add tables in this pipeline to. If not + specified, no data is published to the Hive metastore or Unity Catalog. To publish + to Unity Catalog, also specify `catalog`. + trigger: + description: 'Which pipeline trigger to use. Deprecated: Use `continuous` instead.' +github.com/databricks/cli/bundle/config/resources.QualityMonitor: + assets_dir: + description: The directory to store monitoring assets (e.g. dashboard, metric + tables). + baseline_table_name: + description: | + Name of the baseline table from which drift metrics are computed from. + Columns in the monitored table should also be present in the baseline table. + custom_metrics: + description: | + Custom metrics to compute on the monitored table. These can be aggregate metrics, derived + metrics (from already computed aggregate metrics), or drift metrics (comparing metrics across time + windows). + data_classification_config: + description: The data classification config for the monitor. + inference_log: + description: Configuration for monitoring inference logs. + notifications: + description: The notification settings for the monitor. + output_schema_name: + description: Schema where output metric tables are created. + schedule: + description: The schedule for automatically updating and refreshing metric tables. + skip_builtin_dashboard: + description: Whether to skip creating a default dashboard summarizing data quality + metrics. + slicing_exprs: + description: | + 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 high-cardinality columns, only the top 100 unique values by frequency will + generate slices. + snapshot: + description: Configuration for monitoring snapshot tables. + time_series: + description: Configuration for monitoring time series tables. + warehouse_id: + description: | + Optional argument to specify the warehouse for dashboard creation. If not specified, the first running + warehouse will be used. +github.com/databricks/cli/bundle/config/resources.RegisteredModel: + catalog_name: + description: The name of the catalog where the schema and the registered model + reside + comment: + description: The comment attached to the registered model + name: + description: The name of the registered model + schema_name: + description: The name of the schema where the registered model resides + storage_location: + description: The storage location on the cloud under which model version data + files are stored +github.com/databricks/cli/bundle/config/resources.Schema: + catalog_name: + description: Name of parent catalog. + comment: + description: User-provided free-form text description. + name: + description: Name of schema, relative to parent catalog. + properties: {} + storage_root: + description: Storage root URL for managed tables within schema. +github.com/databricks/cli/bundle/config/resources.Volume: + catalog_name: + description: The name of the catalog where the schema and the volume are + comment: + description: The comment attached to the volume + name: + description: The name of the volume + schema_name: + description: The name of the schema where the volume is + storage_location: + description: The storage location on the cloud + volume_type: {} +github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedule: + pause_status: + description: Read only field that indicates whether a schedule is paused or not. + 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). + timezone_id: + description: | + The timezone id (e.g., ``"PST"``) in which to evaluate the quartz expression. +github.com/databricks/databricks-sdk-go/service/catalog.MonitorCronSchedulePauseStatus: + _: + description: Read only field that indicates whether a schedule is paused or not. + enum: + - UNPAUSED + - PAUSED +github.com/databricks/databricks-sdk-go/service/catalog.MonitorDataClassificationConfig: + enabled: + description: Whether data classification is enabled. +github.com/databricks/databricks-sdk-go/service/catalog.MonitorDestination: + email_addresses: + description: The list of email addresses to send the notification to. A maximum + of 5 email addresses is supported. +github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLog: + granularities: + description: | + Granularities for aggregating data into time windows based on their timestamp. Currently the following static + granularities are supported: + {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" week(s)"``, ``"1 month"``, ``"1 year"``}. + label_col: + description: Optional column that contains the ground truth for the prediction. + model_id_col: + description: | + Column that contains the id of the model generating the predictions. Metrics will be computed per model id by + default, and also across all model ids. + prediction_col: + description: Column that contains the output/prediction from the model. + prediction_proba_col: + description: | + Optional column that contains the prediction probabilities for each class in a classification problem type. + The values in this column should be a map, mapping each class label to the prediction probability for a given + sample. The map should be of PySpark MapType(). + problem_type: + description: Problem type the model aims to solve. Determines the type of model-quality + metrics that will be computed. + timestamp_col: + description: | + Column that contains the timestamps of requests. The column must be one of the following: + - A ``TimestampType`` column + - A column whose values can be converted to timestamps through the pyspark + ``to_timestamp`` [function](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html). +github.com/databricks/databricks-sdk-go/service/catalog.MonitorInferenceLogProblemType: + _: + description: Problem type the model aims to solve. Determines the type of model-quality + metrics that will be computed. + enum: + - PROBLEM_TYPE_CLASSIFICATION + - PROBLEM_TYPE_REGRESSION +github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetric: + 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). + input_columns: + description: | + 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. + name: + description: Name of the metric in the output tables. + output_data_type: + description: The output type of the custom metric. + type: + description: | + 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 +github.com/databricks/databricks-sdk-go/service/catalog.MonitorMetricType: + _: + description: | + 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 + enum: + - CUSTOM_METRIC_TYPE_AGGREGATE + - CUSTOM_METRIC_TYPE_DERIVED + - CUSTOM_METRIC_TYPE_DRIFT +github.com/databricks/databricks-sdk-go/service/catalog.MonitorNotifications: + on_failure: + description: Who to send notifications to on monitor failure. + on_new_classification_tag_detected: + description: Who to send notifications to when new data classification tags are + detected. +github.com/databricks/databricks-sdk-go/service/catalog.MonitorSnapshot: {} +github.com/databricks/databricks-sdk-go/service/catalog.MonitorTimeSeries: + granularities: + description: | + Granularities for aggregating data into time windows based on their timestamp. Currently the following static + granularities are supported: + {``"5 minutes"``, ``"30 minutes"``, ``"1 hour"``, ``"1 day"``, ``" week(s)"``, ``"1 month"``, ``"1 year"``}. + timestamp_col: + description: | + Column that contains the timestamps of requests. The column must be one of the following: + - A ``TimestampType`` column + - A column whose values can be converted to timestamps through the pyspark + ``to_timestamp`` [function](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.to_timestamp.html). +github.com/databricks/databricks-sdk-go/service/catalog.VolumeType: + _: + enum: + - EXTERNAL + - MANAGED +github.com/databricks/databricks-sdk-go/service/compute.Adlsgen2Info: + destination: + description: abfss destination, e.g. `abfss://@.dfs.core.windows.net/`. +github.com/databricks/databricks-sdk-go/service/compute.AutoScale: + max_workers: + description: |- + 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: + description: |- + 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. +github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes: + availability: {} + ebs_volume_count: + description: |- + 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: + 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. + ebs_volume_size: + description: |- + 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: + 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. + ebs_volume_type: {} + first_on_demand: + description: |- + 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: + description: |- + 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. + + If this field is ommitted, we will pull in the default from the conf if it exists. + spot_bid_price_percent: + description: |- + 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. + + The default value and documentation here should be kept consistent with + CommonConf.defaultSpotBidPricePercent and CommonConf.maxSpotBidPricePercent. + zone_id: + description: |- + 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. + 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. +github.com/databricks/databricks-sdk-go/service/compute.AwsAvailability: + _: + description: | + 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. + enum: + - SPOT + - ON_DEMAND + - SPOT_WITH_FALLBACK +github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes: + availability: {} + first_on_demand: + description: |- + 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: + description: Defines values necessary to configure and run Azure Log Analytics + agent + spot_bid_max_price: + description: |- + 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. +github.com/databricks/databricks-sdk-go/service/compute.AzureAvailability: + _: + description: |- + Availability type used for all subsequent nodes past the `first_on_demand` ones. + Note: If `first_on_demand` is zero (which only happens on pool clusters), this availability + type will be used for the entire cluster. + enum: + - SPOT_AZURE + - ON_DEMAND_AZURE + - SPOT_WITH_FALLBACK_AZURE +github.com/databricks/databricks-sdk-go/service/compute.ClientsTypes: + jobs: + description: With jobs set, the cluster can be used for jobs + notebooks: + description: With notebooks set, this cluster can be used for notebooks +github.com/databricks/databricks-sdk-go/service/compute.ClusterLogConf: + dbfs: + description: |- + destination needs to be provided. e.g. + `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + s3: + description: |- + 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. +github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec: + 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. + autoscale: + description: |- + 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: + description: |- + 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: + description: |- + 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: + description: |- + 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: + description: |- + The configuration for delivering spark logs to a long-term storage destination. + Two kinds of destinations (dbfs and s3) 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: + description: | + 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. + custom_tags: + description: |- + 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: {} + docker_image: {} + driver_instance_pool_id: + description: |- + 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_id: + description: | + 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. + enable_elastic_disk: + description: |- + Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + space when its Spark workers are running low on disk space. This feature requires specific AWS + permissions to function correctly - refer to the User Guide for more details. + enable_local_disk_encryption: + description: Whether to enable LUKS on cluster VMs' local disks + gcp_attributes: + description: |- + 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: + 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 `//init_scripts`. + instance_pool_id: + description: The optional ID of the instance pool to which the cluster belongs. + node_type_id: + description: | + 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 :method:clusters/listNodeTypes API call. + num_workers: + description: |- + 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. + policy_id: + description: The ID of the cluster policy used to create the cluster if applicable. + runtime_engine: {} + single_user_name: + description: Single user name if data_security_mode is `SINGLE_USER` + spark_conf: + description: | + 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: + description: |- + 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: + description: | + 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 :method:clusters/sparkVersions API call. + ssh_public_keys: + description: |- + 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. + workload_type: {} +github.com/databricks/databricks-sdk-go/service/compute.DataSecurityMode: + _: + description: | + Data security mode decides what data governance model to use when accessing data + from a cluster. + + * `NONE`: No security isolation for multiple users sharing the cluster. Data governance features are not available in this mode. + * `SINGLE_USER`: 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. + * `USER_ISOLATION`: 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. + + 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. + enum: + - NONE + - SINGLE_USER + - USER_ISOLATION + - LEGACY_TABLE_ACL + - LEGACY_PASSTHROUGH + - LEGACY_SINGLE_USER + - LEGACY_SINGLE_USER_STANDARD +github.com/databricks/databricks-sdk-go/service/compute.DbfsStorageInfo: + destination: + description: dbfs destination, e.g. `dbfs:/my/path` +github.com/databricks/databricks-sdk-go/service/compute.DockerBasicAuth: + password: + description: Password of the user + username: + description: Name of the user +github.com/databricks/databricks-sdk-go/service/compute.DockerImage: + basic_auth: {} + url: + description: URL of the docker image. +github.com/databricks/databricks-sdk-go/service/compute.EbsVolumeType: + _: + description: The type of EBS volumes that will be launched with this cluster. + enum: + - GENERAL_PURPOSE_SSD + - THROUGHPUT_OPTIMIZED_HDD +github.com/databricks/databricks-sdk-go/service/compute.Environment: + _: + description: |- + The environment entity used to preserve serverless environment side panel and jobs' environment for non-notebook task. + In this minimal environment spec, only pip dependencies are supported. + client: + description: |- + Client version used by the environment + The client is the user-facing environment of the runtime. + Each client comes with a specific set of pre-installed libraries. + The version is a string, consisting of the major client version. + dependencies: + description: |- + List of pip dependencies, as supported by the version of pip in this environment. + Each dependency is a pip requirement file line https://pip.pypa.io/en/stable/reference/requirements-file-format/ + Allowed dependency could be , , (WSFS or Volumes in Databricks), + E.g. dependencies: ["foo==0.0.1", "-r /Workspace/test/requirements.txt"] +github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes: + availability: {} + boot_disk_size: + description: boot disk size in GB + google_service_account: + description: |- + 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: + description: 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: + description: |- + 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: + description: |- + 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. +github.com/databricks/databricks-sdk-go/service/compute.GcpAvailability: + _: + description: |- + 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. + enum: + - PREEMPTIBLE_GCP + - ON_DEMAND_GCP + - PREEMPTIBLE_WITH_FALLBACK_GCP +github.com/databricks/databricks-sdk-go/service/compute.GcsStorageInfo: + destination: + description: GCS destination/URI, e.g. `gs://my-bucket/some-prefix` +github.com/databricks/databricks-sdk-go/service/compute.InitScriptInfo: + abfss: + description: |- + destination needs to be provided. e.g. + `{ "abfss" : { "destination" : "abfss://@.dfs.core.windows.net/" } } + dbfs: + description: |- + destination needs to be provided. e.g. + `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + file: + description: |- + destination needs to be provided. e.g. + `{ "file" : { "destination" : "file:/my/local/file.sh" } }` + gcs: + description: |- + destination needs to be provided. e.g. + `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }` + s3: + description: |- + 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: + description: |- + destination needs to be provided. e.g. + `{ "volumes" : { "destination" : "/Volumes/my-init.sh" } }` + workspace: + description: |- + destination needs to be provided. e.g. + `{ "workspace" : { "destination" : "/Users/user1@databricks.com/my-init.sh" } }` +github.com/databricks/databricks-sdk-go/service/compute.Library: + cran: + description: Specification of a CRAN library to be installed as part of the library + 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. + jar: + description: |- + URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + For example: `{ "jar": "/Workspace/path/to/library.jar" }`, `{ "jar" : "/Volumes/path/to/library.jar" }` or + `{ "jar": "s3://my-bucket/library.jar" }`. + If S3 is used, please make sure the cluster has read access on the library. You may need to + launch the cluster with an IAM role to access the S3 URI. + maven: + description: |- + Specification of a maven library to be installed. For example: + `{ "coordinates": "org.jsoup:jsoup:1.7.2" }` + pypi: + description: |- + Specification of a PyPi library to be installed. For example: + `{ "package": "simplejson" }` + requirements: + description: |- + URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes paths are supported. + For example: `{ "requirements": "/Workspace/path/to/requirements.txt" }` or `{ "requirements" : "/Volumes/path/to/requirements.txt" }` + whl: + description: |- + URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + For example: `{ "whl": "/Workspace/path/to/library.whl" }`, `{ "whl" : "/Volumes/path/to/library.whl" }` or + `{ "whl": "s3://my-bucket/library.whl" }`. + If S3 is used, please make sure the cluster has read access on the library. You may need to + launch the cluster with an IAM role to access the S3 URI. +github.com/databricks/databricks-sdk-go/service/compute.LocalFileInfo: + destination: + description: local file destination, e.g. `file:/my/local/file.sh` +github.com/databricks/databricks-sdk-go/service/compute.LogAnalyticsInfo: + log_analytics_primary_key: + description: + log_analytics_workspace_id: + description: +github.com/databricks/databricks-sdk-go/service/compute.MavenLibrary: + coordinates: + description: 'Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2".' + exclusions: + description: |- + List of dependences to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + + Maven dependency exclusions: + https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. + repo: + description: |- + Maven repo to install the Maven package from. If omitted, both Maven Central Repository + and Spark Packages are searched. +github.com/databricks/databricks-sdk-go/service/compute.PythonPyPiLibrary: + package: + description: |- + The name of the pypi package to install. An optional exact version specification is also + supported. Examples: "simplejson" and "simplejson==3.8.0". + repo: + description: |- + The repository where the package can be found. If not specified, the default pip index is + used. +github.com/databricks/databricks-sdk-go/service/compute.RCranLibrary: + package: + description: The name of the CRAN package to install. + repo: + description: The repository where the package can be found. If not specified, + the default CRAN repo is used. +github.com/databricks/databricks-sdk-go/service/compute.RuntimeEngine: + _: + description: | + 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. + enum: + - "NULL" + - STANDARD + - PHOTON +github.com/databricks/databricks-sdk-go/service/compute.S3StorageInfo: + canned_acl: + description: |- + (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. + destination: + description: |- + 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. + enable_encryption: + description: (Optional) Flag to enable server side encryption, `false` by default. + encryption_type: + description: |- + (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: + description: |- + 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: + description: (Optional) Kms key which will be used if encryption is enabled and + encryption type is set to `sse-kms`. + region: + description: |- + S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + endpoint will be used. +github.com/databricks/databricks-sdk-go/service/compute.VolumesStorageInfo: + destination: + description: Unity Catalog Volumes file destination, e.g. `/Volumes/my-init.sh` +github.com/databricks/databricks-sdk-go/service/compute.WorkloadType: + clients: + description: ' defined what type of clients can use the cluster. E.g. Notebooks, + Jobs' +github.com/databricks/databricks-sdk-go/service/compute.WorkspaceStorageInfo: + destination: + description: workspace files destination, e.g. `/Users/user1@databricks.com/my-init.sh` +github.com/databricks/databricks-sdk-go/service/dashboards.LifecycleState: + _: + enum: + - ACTIVE + - TRASHED +github.com/databricks/databricks-sdk-go/service/jobs.Condition: + _: + enum: + - ANY_UPDATED + - ALL_UPDATED +github.com/databricks/databricks-sdk-go/service/jobs.ConditionTask: + left: + description: The left operand of the condition task. Can be either a string value + or a job state or parameter reference. + op: + description: |- + * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their operands. This means that `“12.0” == “12”` will evaluate to `false`. + * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL` operators perform numeric comparison of their operands. `“12.0” >= “12”` will evaluate to `true`, `“10.0” >= “12”` will evaluate to `false`. + + The 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. + right: + description: The right operand of the condition task. Can be either a string value + or a job state or parameter reference. +github.com/databricks/databricks-sdk-go/service/jobs.ConditionTaskOp: + _: + description: |- + * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their operands. This means that `“12.0” == “12”` will evaluate to `false`. + * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL` operators perform numeric comparison of their operands. `“12.0” >= “12”` will evaluate to `true`, `“10.0” >= “12”` will evaluate to `false`. + + The 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. + enum: + - EQUAL_TO + - GREATER_THAN + - GREATER_THAN_OR_EQUAL + - LESS_THAN + - LESS_THAN_OR_EQUAL + - NOT_EQUAL +github.com/databricks/databricks-sdk-go/service/jobs.Continuous: + pause_status: + description: Indicate whether the continuous execution of the job is paused or + not. Defaults to UNPAUSED. +github.com/databricks/databricks-sdk-go/service/jobs.CronSchedule: + pause_status: + description: Indicate whether this schedule is paused or not. + 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. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.DbtTask: + 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 + >= 1.1.1. + 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. + 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. + project_directory: + description: |- + Path to the project directory. Optional for Git sourced tasks, in which + case if no value is provided, the root of the Git repository is used. + 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. + source: + description: |- + Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved + from the local Databricks workspace. When set to `GIT`, the project will be retrieved from a Git repository + defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + + * `WORKSPACE`: Project is located in Databricks workspace. + * `GIT`: Project is located in cloud Git provider. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.FileArrivalTriggerConfiguration: + min_time_between_triggers_seconds: + description: |- + If set, the trigger starts a run only after the specified amount of time passed since + the last time the trigger fired. The minimum allowed value is 60 seconds + url: + description: URL to be monitored for file arrivals. The path must point to the + root or a subpath of the external location. + 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. + This makes it possible to wait for a batch of incoming files to arrive before triggering a run. The + minimum allowed value is 60 seconds. +github.com/databricks/databricks-sdk-go/service/jobs.ForEachTask: + concurrency: + description: |- + An optional maximum allowed number of concurrent runs of the task. + Set this value if you want to be able to execute multiple runs of the task concurrently. + inputs: + description: |- + Array for task to iterate on. This can be a JSON string or a reference to + an array parameter. + task: + description: Configuration for the task that will be run for each element in the + array +github.com/databricks/databricks-sdk-go/service/jobs.Format: + _: + enum: + - SINGLE_TASK + - MULTI_TASK +github.com/databricks/databricks-sdk-go/service/jobs.GitProvider: + _: + enum: + - gitHub + - bitbucketCloud + - azureDevOpsServices + - gitHubEnterprise + - bitbucketServer + - gitLab + - gitLabEnterpriseEdition + - awsCodeCommit +github.com/databricks/databricks-sdk-go/service/jobs.GitSnapshot: + _: + description: Read-only state of the remote repository at the time the job was + run. This field is only included on job runs. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.GitSource: + _: + 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. + + If `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. + + Note: 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. + 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. + 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. + git_provider: + description: Unique identifier of the service used to host the Git repository. + The value is case insensitive. + git_snapshot: {} + 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. + git_url: + description: URL of the repository to be cloned by this job. + job_source: + description: The source of the job specification in the remote repository when + the job is source controlled. +github.com/databricks/databricks-sdk-go/service/jobs.JobCluster: + job_cluster_key: + description: |- + A unique name for the job cluster. This field is required and must be unique within the job. + `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution. + new_cluster: + description: If new_cluster, a description of a cluster that is created for each + task. +github.com/databricks/databricks-sdk-go/service/jobs.JobDeployment: + kind: + description: |- + The kind of deployment that manages the job. + + * `BUNDLE`: The job is managed by Databricks Asset Bundle. + metadata_file_path: + description: Path of the file that contains deployment metadata. +github.com/databricks/databricks-sdk-go/service/jobs.JobDeploymentKind: + _: + description: '* `BUNDLE`: The job is managed by Databricks Asset Bundle.' + enum: + - BUNDLE +github.com/databricks/databricks-sdk-go/service/jobs.JobEditMode: + _: + description: |- + Edit mode of the job. + + * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. + * `EDITABLE`: The job is in an editable state and can be modified. + enum: + - UI_LOCKED + - EDITABLE +github.com/databricks/databricks-sdk-go/service/jobs.JobEmailNotifications: + no_alert_for_skipped_runs: + description: |- + If true, do not send email to recipients specified in `on_failure` if the run is skipped. + This field is `deprecated`. Please use the `notification_settings.no_alert_for_skipped_runs` field. + 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. + 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. + 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. + on_streaming_backlog_exceeded: + description: |- + A list of email addresses to notify when any streaming backlog thresholds are exceeded for any stream. + Streaming 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`. + Alerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.JobEnvironment: + environment_key: + description: The key of an environment. It has to be unique within a job. + spec: {} +github.com/databricks/databricks-sdk-go/service/jobs.JobNotificationSettings: + no_alert_for_canceled_runs: + description: If true, do not send notifications to recipients specified in `on_failure` + if the run is canceled. + no_alert_for_skipped_runs: + description: If true, do not send notifications to recipients specified in `on_failure` + if the run is skipped. +github.com/databricks/databricks-sdk-go/service/jobs.JobParameterDefinition: + default: + description: Default value of the parameter. + name: + description: The name of the defined parameter. May only contain alphanumeric + characters, `_`, `-`, and `.` +github.com/databricks/databricks-sdk-go/service/jobs.JobRunAs: + _: + description: |- + Write-only setting. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job. + + Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown. + service_principal_name: + description: Application ID of an active service principal. Setting this field + requires the `servicePrincipal/user` role. + user_name: + description: The email of an active workspace user. Non-admin users can only set + this field to their own email. +github.com/databricks/databricks-sdk-go/service/jobs.JobSource: + _: + description: The source of the job specification in the remote repository when + the job is source controlled. + dirty_state: + description: |- + Dirty state indicates the job is not fully synced with the job specification in the remote repository. + + Possible values are: + * `NOT_SYNCED`: The job is not yet synced with the remote job specification. Import the remote job specification from UI to make the job fully synced. + * `DISCONNECTED`: The job is temporary disconnected from the remote job specification and is allowed for live edit. Import the remote job specification again from UI to make the job fully synced. + import_from_git_branch: + description: Name of the branch which the job is imported from. + job_config_path: + description: Path of the job YAML file that contains the job specification. +github.com/databricks/databricks-sdk-go/service/jobs.JobSourceDirtyState: + _: + description: |- + Dirty state indicates the job is not fully synced with the job specification + in the remote repository. + + Possible values are: + * `NOT_SYNCED`: The job is not yet synced with the remote job specification. Import the remote job specification from UI to make the job fully synced. + * `DISCONNECTED`: The job is temporary disconnected from the remote job specification and is allowed for live edit. Import the remote job specification again from UI to make the job fully synced. + enum: + - NOT_SYNCED + - DISCONNECTED +github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthMetric: + _: + description: |- + Specifies the health metric that is being evaluated for a particular health rule. + + * `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. + * `STREAMING_BACKLOG_BYTES`: An estimate of the maximum bytes of data waiting to be consumed across all streams. This metric is in Private Preview. + * `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset lag across all streams. This metric is in Private Preview. + * `STREAMING_BACKLOG_SECONDS`: An estimate of the maximum consumer delay across all streams. This metric is in Private Preview. + * `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of outstanding files across all streams. This metric is in Private Preview. + enum: + - RUN_DURATION_SECONDS + - STREAMING_BACKLOG_BYTES + - STREAMING_BACKLOG_RECORDS + - STREAMING_BACKLOG_SECONDS + - STREAMING_BACKLOG_FILES +github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthOperator: + _: + description: Specifies the operator used to compare the health metric value with + the specified threshold. + enum: + - GREATER_THAN +github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRule: + metric: {} + op: {} + value: + description: Specifies the threshold value that the health metric should obey + to satisfy the health rule. +github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRules: + _: + description: An optional set of health rules that can be defined for this job. + rules: {} +github.com/databricks/databricks-sdk-go/service/jobs.NotebookTask: + 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 + Now with parameters specified, the two parameters maps are merged. If the same key is specified in + `base_parameters` and in `run-now`, the value from `run-now` is used. + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + + If the notebook takes a parameter that is not specified in the job’s `base_parameters` or the `run-now` override parameters, + the default value from the notebook is used. + + Retrieve these parameters in a notebook using [dbutils.widgets.get](https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-widgets). + + The JSON representation of this field cannot exceed 1MB. + notebook_path: + description: |- + The path of the notebook to be run in the Databricks workspace or remote repository. + For notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash. + For notebooks stored in a remote repository, the path must be relative. This field is required. + 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 + defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + * `WORKSPACE`: Notebook is located in Databricks workspace. + * `GIT`: Notebook is located in cloud Git provider. + 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. + + Note that SQL warehouses only support SQL cells; if the notebook contains non-SQL cells, the run will fail. +github.com/databricks/databricks-sdk-go/service/jobs.PauseStatus: + _: + enum: + - UNPAUSED + - PAUSED +github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfiguration: + interval: + description: The interval at which the trigger should run. + unit: + description: The unit of time for the interval. +github.com/databricks/databricks-sdk-go/service/jobs.PeriodicTriggerConfigurationTimeUnit: + _: + enum: + - HOURS + - DAYS + - WEEKS +github.com/databricks/databricks-sdk-go/service/jobs.PipelineParams: + full_refresh: + description: If true, triggers a full refresh on the delta live table. +github.com/databricks/databricks-sdk-go/service/jobs.PipelineTask: + full_refresh: + description: If true, triggers a full refresh on the delta live table. + pipeline_id: + description: The full name of the pipeline task to execute. +github.com/databricks/databricks-sdk-go/service/jobs.PythonWheelTask: + 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()` + 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. + package_name: + description: Name of the package to execute + parameters: + description: Command-line parameters passed to Python wheel task. Leave it empty + if `named_parameters` is not null. +github.com/databricks/databricks-sdk-go/service/jobs.QueueSettings: + enabled: + description: If true, enable queueing for the job. This is a required field. +github.com/databricks/databricks-sdk-go/service/jobs.RunIf: + _: + description: |- + An optional value indicating the condition that determines whether the task should be run once its dependencies have been completed. When omitted, defaults to `ALL_SUCCESS`. + + Possible values are: + * `ALL_SUCCESS`: All dependencies have executed and succeeded + * `AT_LEAST_ONE_SUCCESS`: At least one dependency has succeeded + * `NONE_FAILED`: None of the dependencies have failed and at least one was executed + * `ALL_DONE`: All dependencies have been completed + * `AT_LEAST_ONE_FAILED`: At least one dependency failed + * `ALL_FAILED`: ALl dependencies have failed + enum: + - ALL_SUCCESS + - ALL_DONE + - NONE_FAILED + - AT_LEAST_ONE_SUCCESS + - ALL_FAILED + - AT_LEAST_ONE_FAILED +github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: + dbt_commands: + description: 'An array of commands to execute for jobs with the dbt task, for + example `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt + run"]`' + jar_params: + description: |- + A list of parameters for jobs with Spark JAR tasks, for example `"jar_params": ["john doe", "35"]`. + The parameters are used to invoke the main function of the main class specified in the Spark JAR task. + If not specified upon `run-now`, it defaults to an empty list. + jar_params cannot be specified in conjunction with notebook_params. + The JSON representation of this field (for example `{"jar_params":["john doe","35"]}`) cannot exceed 10,000 bytes. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + job_id: + description: ID of the job to trigger. + job_parameters: + description: Job-level parameters used to trigger the job. + notebook_params: + description: |- + A map from keys to values for jobs with notebook task, for example `"notebook_params": {"name": "john doe", "age": "35"}`. + The map is passed to the notebook and is accessible through the [dbutils.widgets.get](https://docs.databricks.com/dev-tools/databricks-utils.html) function. + + If not specified upon `run-now`, the triggered run uses the job’s base parameters. + + notebook_params cannot be specified in conjunction with jar_params. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + + The JSON representation of this field (for example `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed 10,000 bytes. + pipeline_params: + description: Controls whether the pipeline should perform a full refresh + python_named_params: {} + python_params: + description: |- + A list of parameters for jobs with Python tasks, for example `"python_params": ["john doe", "35"]`. + The parameters are passed to Python file as command-line parameters. If specified upon `run-now`, it would overwrite + the parameters specified in job setting. The JSON representation of this field (for example `{"python_params":["john doe","35"]}`) + cannot exceed 10,000 bytes. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + + Important + + These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. + Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis. + spark_submit_params: + description: |- + A list of parameters for jobs with spark submit task, for example `"spark_submit_params": ["--class", "org.apache.spark.examples.SparkPi"]`. + The parameters are passed to spark-submit script as command-line parameters. If specified upon `run-now`, it would overwrite the + parameters specified in job setting. The JSON representation of this field (for example `{"python_params":["john doe","35"]}`) + cannot exceed 10,000 bytes. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs + + Important + + These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. + Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis. + sql_params: + description: 'A map from keys to values for jobs with SQL task, for example `"sql_params": + {"name": "john doe", "age": "35"}`. The SQL alert task does not support custom + parameters.' +github.com/databricks/databricks-sdk-go/service/jobs.Source: + _: + description: |- + Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved\ + from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository + defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + + * `WORKSPACE`: SQL file is located in Databricks workspace. + * `GIT`: SQL file is located in cloud Git provider. + enum: + - WORKSPACE + - GIT +github.com/databricks/databricks-sdk-go/service/jobs.SparkJarTask: + jar_uri: + description: Deprecated since 04/2016. Provide a `jar` through the `libraries` + field instead. For an example, see :method:jobs/create. + 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. + + The code must use `SparkContext.getOrCreate` to obtain a Spark context; otherwise, runs of the job fail. + parameters: + description: |- + Parameters passed to the main method. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. +github.com/databricks/databricks-sdk-go/service/jobs.SparkPythonTask: + parameters: + description: |- + Command line parameters passed to the Python file. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. + 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. + source: + description: |- + Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved from the local + Databricks workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`, + the Python file will be retrieved from a Git repository defined in `git_source`. + + * `WORKSPACE`: The Python file is located in a Databricks workspace or at a cloud filesystem URI. + * `GIT`: The Python file is located in a remote Git repository. +github.com/databricks/databricks-sdk-go/service/jobs.SparkSubmitTask: + parameters: + description: |- + Command-line parameters passed to spark submit. + + Use [Task parameter variables](https://docs.databricks.com/jobs.html#parameter-variables) to set parameters containing information about job runs. +github.com/databricks/databricks-sdk-go/service/jobs.SqlTask: + alert: + description: If alert, indicates that this job must refresh a SQL alert. + dashboard: + description: If dashboard, indicates that this job must refresh a SQL dashboard. + file: + description: If file, indicates that this job runs a SQL file in a remote Git + repository. + parameters: + description: Parameters to be used for each run of this job. The SQL alert task + does not support custom parameters. + query: + description: If query, indicates that this job must execute a SQL query. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskAlert: + alert_id: + description: The canonical identifier of the SQL alert. + pause_subscriptions: + description: If true, the alert notifications are not sent to subscribers. + subscriptions: + description: If specified, alert notifications are sent to subscribers. +github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskDashboard: + custom_subject: + description: Subject of the email sent to subscribers of this task. + dashboard_id: + description: The canonical identifier of the SQL dashboard. + pause_subscriptions: + description: If true, the dashboard snapshot is not taken, and emails are not + sent to subscribers. + subscriptions: + description: If specified, dashboard snapshots are sent to subscriptions. +github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskFile: + path: + description: Path of the SQL file. Must be relative if the source is a remote + Git repository and absolute for workspace paths. + source: + description: |- + Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved + from the local Databricks workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository + defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + + * `WORKSPACE`: SQL file is located in Databricks workspace. + * `GIT`: SQL file is located in cloud Git provider. +github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskQuery: + query_id: + description: The canonical identifier of the SQL query. +github.com/databricks/databricks-sdk-go/service/jobs.SqlTaskSubscription: + 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. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.TableUpdateTriggerConfiguration: + condition: + description: The table(s) condition based on which to trigger a job run. + min_time_between_triggers_seconds: + description: |- + If set, the trigger starts a run only after the specified amount of time has passed since + the last time the trigger fired. The minimum allowed value is 60 seconds. + table_names: + description: A list of Delta tables to monitor for changes. The table name must + be in the format `catalog_name.schema_name.table_name`. + wait_after_last_change_seconds: + description: |- + If set, the trigger starts a run only after no table updates have occurred for the specified time + and can be used to wait for a series of table updates before triggering a run. The + minimum allowed value is 60 seconds. +github.com/databricks/databricks-sdk-go/service/jobs.Task: + 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. + The condition task does not require a cluster to execute and does not support retries or notifications. + 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. + 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. + The key is `task_key`, and the value is the name assigned to the dependent task. + description: + description: An optional description for this task. + disable_auto_optimization: + description: An option to disable auto optimization in serverless + 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. + 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. + existing_cluster_id: + description: |- + If existing_cluster_id, the ID of an existing cluster that is used for all runs. + When running jobs or tasks on an existing cluster, you may need to manually restart + the cluster if it stops responding. We suggest running jobs and tasks on new clusters for + greater reliability + for_each_task: + description: The task executes a nested task for every input provided when the + `for_each_task` field is present. + health: {} + job_cluster_key: + description: If job_cluster_key, this task is executed reusing the cluster specified + in `job.settings.job_clusters`. + libraries: + description: |- + An optional list of libraries to be installed on the cluster. + The default value is an empty list. + 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. + 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. + new_cluster: + description: If new_cluster, a description of a new cluster that is created for + each run. + notebook_task: + description: The task runs a notebook when the `notebook_task` field is present. + notification_settings: + description: Optional notification settings that are used when sending notifications + to each of the `email_notifications` and `webhook_notifications` for this task. + 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. + python_wheel_task: + description: The task runs a Python wheel when the `python_wheel_task` field is + present. + retry_on_timeout: + description: |- + An optional policy to specify whether to retry a job when it times out. The default behavior + is to not retry on timeout. + run_if: + description: |- + An optional value specifying the condition determining whether the task is run once its dependencies have been completed. + + * `ALL_SUCCESS`: All dependencies have executed and succeeded + * `AT_LEAST_ONE_SUCCESS`: At least one dependency has succeeded + * `NONE_FAILED`: None of the dependencies have failed and at least one was executed + * `ALL_DONE`: All dependencies have been completed + * `AT_LEAST_ONE_FAILED`: At least one dependency failed + * `ALL_FAILED`: ALl dependencies have failed + run_job_task: + description: The task triggers another job when the `run_job_task` field is present. + spark_jar_task: + description: The task runs a JAR when the `spark_jar_task` field is present. + spark_python_task: + description: The task runs a Python file when the `spark_python_task` field is + present. + spark_submit_task: + description: |- + (Legacy) The task runs the spark-submit script when the `spark_submit_task` field is present. This task can run only on new clusters and is not compatible with serverless compute. + + In the `new_cluster` specification, `libraries` and `spark_conf` are not supported. Instead, use `--jars` and `--py-files` to add Java and Python libraries and `--conf` to set the Spark configurations. + + `master`, `deploy-mode`, and `executor-cores` are automatically configured by Databricks; you _cannot_ specify them in parameters. + + By default, the Spark submit job uses all available memory (excluding reserved memory for Databricks services). You can set `--driver-memory`, and `--executor-memory` to a smaller value to leave some room for off-heap usage. + + The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 paths. + 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. + task_key: + description: |- + A unique name for the task. This field is used to refer to this task from other tasks. + This field is required and must be unique within its parent job. + On Update or Reset, this field is used to reference the tasks to be updated or reset. + timeout_seconds: + description: An optional timeout applied to each run of this job task. A value + of `0` means no timeout. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.TaskDependency: + 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. + task_key: + description: The name of the task this task depends on. +github.com/databricks/databricks-sdk-go/service/jobs.TaskEmailNotifications: + no_alert_for_skipped_runs: + description: |- + If true, do not send email to recipients specified in `on_failure` if the run is skipped. + This field is `deprecated`. Please use the `notification_settings.no_alert_for_skipped_runs` field. + 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. + 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. + 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. + on_streaming_backlog_exceeded: + description: |- + A list of email addresses to notify when any streaming backlog thresholds are exceeded for any stream. + Streaming 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`. + Alerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes. + 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. +github.com/databricks/databricks-sdk-go/service/jobs.TaskNotificationSettings: + 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. + no_alert_for_canceled_runs: + description: If true, do not send notifications to recipients specified in `on_failure` + if the run is canceled. + no_alert_for_skipped_runs: + description: If true, do not send notifications to recipients specified in `on_failure` + if the run is skipped. +github.com/databricks/databricks-sdk-go/service/jobs.TriggerSettings: + file_arrival: + description: File arrival trigger settings. + pause_status: + description: Whether this trigger is paused or not. + periodic: + description: Periodic trigger settings. + table: + description: Old table trigger settings name. Deprecated in favor of `table_update`. + table_update: {} +github.com/databricks/databricks-sdk-go/service/jobs.Webhook: + id: {} +github.com/databricks/databricks-sdk-go/service/jobs.WebhookNotifications: + 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. + 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. + 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. + on_streaming_backlog_exceeded: + description: |- + An optional list of system notification IDs to call when any streaming backlog thresholds are exceeded for any stream. + Streaming 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`. + Alerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes. + A maximum of 3 destinations can be specified for the `on_streaming_backlog_exceeded` property. + 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. +github.com/databricks/databricks-sdk-go/service/ml.ExperimentTag: + key: + description: The tag key. + value: + description: The tag value. +github.com/databricks/databricks-sdk-go/service/ml.ModelTag: + key: + description: The tag key. + value: + description: The tag value. +github.com/databricks/databricks-sdk-go/service/ml.ModelVersion: + creation_timestamp: + description: Timestamp recorded when this `model_version` was created. + current_stage: + description: Current stage for this `model_version`. + description: + description: Description of this `model_version`. + last_updated_timestamp: + description: Timestamp recorded when metadata for this `model_version` was last + updated. + name: + description: Unique name of the model + run_id: + description: |- + MLflow run ID used when creating `model_version`, if `source` was generated by an + experiment run stored in MLflow tracking server. + run_link: + description: 'Run Link: Direct link to the run that generated this version' + source: + description: URI indicating the location of the source model artifacts, used when + creating `model_version` + status: + description: Current status of `model_version` + status_message: + description: Details on current `status`, if it is pending or failed. + tags: + description: 'Tags: Additional metadata key-value pairs for this `model_version`.' + user_id: + description: User that created this `model_version`. + version: + description: Model's version number. +github.com/databricks/databricks-sdk-go/service/ml.ModelVersionStatus: + _: + description: Current status of `model_version` + enum: + - PENDING_REGISTRATION + - FAILED_REGISTRATION + - READY +github.com/databricks/databricks-sdk-go/service/ml.ModelVersionTag: + key: + description: The tag key. + value: + description: The tag value. +github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger: + quartz_cron_schedule: {} + timezone_id: {} +github.com/databricks/databricks-sdk-go/service/pipelines.DeploymentKind: + _: + description: | + The deployment method that manages the pipeline: + - BUNDLE: The pipeline is managed by a Databricks Asset Bundle. + enum: + - BUNDLE +github.com/databricks/databricks-sdk-go/service/pipelines.FileLibrary: + path: + description: The absolute path of the file. +github.com/databricks/databricks-sdk-go/service/pipelines.Filters: + exclude: + description: Paths to exclude. + include: + description: Paths to include. +github.com/databricks/databricks-sdk-go/service/pipelines.IngestionConfig: + report: + description: Select a specific source report. + schema: + description: Select all tables from a specific source schema. + table: + description: Select a specific source table. +github.com/databricks/databricks-sdk-go/service/pipelines.IngestionGatewayPipelineDefinition: + connection_id: + description: '[Deprecated, use connection_name instead] Immutable. The Unity Catalog + connection that this gateway pipeline uses to communicate with the source.' + connection_name: + description: Immutable. The Unity Catalog connection that this gateway pipeline + uses to communicate with the source. + gateway_storage_catalog: + description: Required, Immutable. The name of the catalog for the gateway pipeline's + storage location. + gateway_storage_name: + description: | + Optional. The Unity Catalog-compatible name for the gateway storage location. + This is the destination to use for the data that is extracted by the gateway. + Delta Live Tables system will automatically create the storage location under the catalog and schema. + gateway_storage_schema: + description: Required, Immutable. The name of the schema for the gateway pipelines's + storage location. +github.com/databricks/databricks-sdk-go/service/pipelines.IngestionPipelineDefinition: + connection_name: + description: Immutable. The Unity Catalog connection that this ingestion pipeline + uses to communicate with the source. This is used with connectors for applications + like Salesforce, Workday, and so on. + ingestion_gateway_id: + description: Immutable. Identifier for the gateway that is used by this ingestion + pipeline to communicate with the source database. This is used with connectors + to databases like SQL Server. + objects: + description: Required. Settings specifying tables to replicate and the destination + for the replicated tables. + table_configuration: + description: Configuration settings to control the ingestion of tables. These + settings are applied to all tables in the pipeline. +github.com/databricks/databricks-sdk-go/service/pipelines.ManualTrigger: {} +github.com/databricks/databricks-sdk-go/service/pipelines.NotebookLibrary: + path: + description: The absolute path of the notebook. +github.com/databricks/databricks-sdk-go/service/pipelines.Notifications: + alerts: + description: | + A list of alerts that trigger the sending of notifications to the configured + destinations. The supported alerts are: + + * `on-update-success`: A pipeline update completes successfully. + * `on-update-failure`: Each time a pipeline update fails. + * `on-update-fatal-failure`: A pipeline update fails with a non-retryable (fatal) error. + * `on-flow-failure`: A single data flow fails. + email_recipients: + description: | + A list of email addresses notified when a configured alert is triggered. +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineCluster: + apply_policy_default_values: + description: 'Note: This field won''t be persisted. Only API users will check + this field.' + autoscale: + description: |- + 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. + aws_attributes: + description: |- + 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: + description: |- + 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: + description: | + The configuration for delivering spark logs to a long-term storage destination. + Only dbfs destinations 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`. + custom_tags: + description: |- + 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 + driver_instance_pool_id: + description: |- + 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_id: + description: |- + 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. + enable_local_disk_encryption: + description: Whether to enable local disk encryption for the cluster. + gcp_attributes: + description: |- + 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: + 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 `//init_scripts`. + instance_pool_id: + description: The optional ID of the instance pool to which the cluster belongs. + 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`. + node_type_id: + description: | + 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 :method:clusters/listNodeTypes API call. + num_workers: + description: |- + 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. + policy_id: + description: The ID of the cluster policy used to create the cluster if applicable. + spark_conf: + description: | + An object containing a set of optional, user-specified Spark configuration key-value pairs. + See :method:clusters/create for more details. + spark_env_vars: + description: |- + 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"}` + ssh_public_keys: + description: |- + 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. +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscale: + 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`. + min_workers: + description: |- + The minimum number of workers the cluster can scale down to when underutilized. + It is also the initial number of workers the cluster will have after creation. + mode: + description: | + Databricks Enhanced Autoscaling optimizes cluster utilization by automatically + allocating cluster resources based on workload volume, with minimal impact to + the data processing latency of your pipelines. Enhanced Autoscaling is available + for `updates` clusters only. The legacy autoscaling feature is used for `maintenance` + clusters. +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineClusterAutoscaleMode: + _: + description: | + Databricks Enhanced Autoscaling optimizes cluster utilization by automatically + allocating cluster resources based on workload volume, with minimal impact to + the data processing latency of your pipelines. Enhanced Autoscaling is available + for `updates` clusters only. The legacy autoscaling feature is used for `maintenance` + clusters. + enum: + - ENHANCED + - LEGACY +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineDeployment: + kind: + description: The deployment method that manages the pipeline. + metadata_file_path: + description: The path to the file containing metadata about the deployment. +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineLibrary: + file: + description: | + The path to a file that defines a pipeline and is stored in the Databricks Repos. + jar: + description: | + URI of the jar to be installed. Currently only DBFS is supported. + maven: + description: | + Specification of a maven library to be installed. + notebook: + description: | + The path to a notebook that defines a pipeline and is stored in the Databricks workspace. + whl: + description: URI of the whl to be installed. +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineTrigger: + cron: {} + manual: {} +github.com/databricks/databricks-sdk-go/service/pipelines.ReportSpec: + destination_catalog: + description: Required. Destination catalog to store table. + destination_schema: + description: Required. Destination schema to store table. + destination_table: + description: Required. Destination table name. The pipeline fails if a table with + that name already exists. + source_url: + description: Required. Report URL in the source system. + table_configuration: + description: Configuration settings to control the ingestion of tables. These + settings override the table_configuration defined in the IngestionPipelineDefinition + object. +github.com/databricks/databricks-sdk-go/service/pipelines.RestartWindow: + days_of_week: + description: |- + Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). + If not specified all days of the week will be used. + start_hour: + description: |- + An integer between 0 and 23 denoting the start hour for the restart window in the 24-hour day. + Continuous pipeline restart is triggered only within a five-hour window starting at this hour. + time_zone_id: + description: |- + Time zone id of restart window. See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details. + If not specified, UTC will be used. +github.com/databricks/databricks-sdk-go/service/pipelines.RestartWindowDaysOfWeek: + _: + description: |- + Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). + If not specified all days of the week will be used. + enum: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY +github.com/databricks/databricks-sdk-go/service/pipelines.SchemaSpec: + destination_catalog: + description: Required. Destination catalog to store tables. + destination_schema: + description: 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. + source_catalog: + description: The source catalog name. Might be optional depending on the type + of source. + source_schema: + description: Required. Schema name in the source database. + table_configuration: + description: 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. +github.com/databricks/databricks-sdk-go/service/pipelines.TableSpec: + destination_catalog: + description: Required. Destination catalog to store table. + destination_schema: + description: Required. Destination schema to store table. + destination_table: + description: Optional. Destination table name. The pipeline fails if a table with + that name already exists. If not set, the source table name is used. + source_catalog: + description: Source catalog name. Might be optional depending on the type of source. + source_schema: + description: Schema name in the source database. Might be optional depending on + the type of source. + source_table: + description: Required. Table name in the source database. + table_configuration: + description: Configuration settings to control the ingestion of tables. These + settings override the table_configuration defined in the IngestionPipelineDefinition + object and the SchemaSpec. +github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfig: + primary_keys: + description: The primary key of the table used to apply changes. + salesforce_include_formula_fields: + description: If true, formula fields defined in the table are included in the + ingestion. This setting is only valid for the Salesforce connector + scd_type: + description: The SCD type to use to ingest the table. + sequence_by: + description: The column names specifying the logical order of events in the source + data. Delta Live Tables uses this sequencing to handle change events that arrive + out of order. +github.com/databricks/databricks-sdk-go/service/pipelines.TableSpecificConfigScdType: + _: + description: The SCD type to use to ingest the table. + enum: + - SCD_TYPE_1 + - SCD_TYPE_2 +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayConfig: + guardrails: + description: Configuration for AI Guardrails to prevent unwanted data and unsafe + data in requests and responses. + inference_table_config: + description: 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: + description: Configuration for rate limits which can be set to limit endpoint + traffic. + usage_tracking_config: + description: Configuration to enable usage tracking using system tables. These + tables allow you to monitor operational usage on endpoints and their associated + costs. +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailParameters: + invalid_keywords: + description: List of invalid keywords. AI guardrail uses keyword or string matching + to decide if the keyword exists in the request or response content. + pii: + description: Configuration for guardrail PII filter. + safety: + description: Indicates whether the safety filter is enabled. + valid_topics: + description: The list of allowed topics. Given a chat request, this guardrail + flags the request if its topic is not in the allowed topics. +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehavior: + behavior: + description: Behavior for PII filter. Currently only 'BLOCK' is supported. If + 'BLOCK' is set for the input guardrail and the request contains PII, the request + is not sent to the model server and 400 status code is returned; if 'BLOCK' + is set for the output guardrail and the model response contains PII, the PII + info in the response is redacted and 400 status code is returned. +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrailPiiBehaviorBehavior: + _: + description: Behavior for PII filter. Currently only 'BLOCK' is supported. If + 'BLOCK' is set for the input guardrail and the request contains PII, the request + is not sent to the model server and 400 status code is returned; if 'BLOCK' + is set for the output guardrail and the model response contains PII, the PII + info in the response is redacted and 400 status code is returned. + enum: + - NONE + - BLOCK +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayGuardrails: + input: + description: Configuration for input guardrail filters. + output: + description: Configuration for output guardrail filters. +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayInferenceTableConfig: + catalog_name: + description: '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: + description: Indicates whether the inference table is enabled. + schema_name: + description: '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: + description: '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.' +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimit: + calls: + description: Used to specify how many calls are allowed for a key within the renewal_period. + key: + description: Key field for a rate limit. Currently, only 'user' and 'endpoint' + are supported, with 'endpoint' being the default if not specified. + renewal_period: + description: Renewal period field for a rate limit. Currently, only 'minute' is + supported. +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitKey: + _: + description: Key field for a rate limit. Currently, only 'user' and 'endpoint' + are supported, with 'endpoint' being the default if not specified. + enum: + - user + - endpoint +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayRateLimitRenewalPeriod: + _: + description: Renewal period field for a rate limit. Currently, only 'minute' is + supported. + enum: + - minute +github.com/databricks/databricks-sdk-go/service/serving.AiGatewayUsageTrackingConfig: + enabled: + description: Whether to enable usage tracking. +github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfig: + aws_access_key_id: + description: '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`. 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: + description: '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_region: + description: The AWS region to use. Bedrock has to be enabled there. + aws_secret_access_key: + description: '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: + description: '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`.' + bedrock_provider: + description: 'The underlying provider in Amazon Bedrock. Supported values (case + insensitive) include: Anthropic, Cohere, AI21Labs, Amazon.' +github.com/databricks/databricks-sdk-go/service/serving.AmazonBedrockConfigBedrockProvider: + _: + description: 'The underlying provider in Amazon Bedrock. Supported values (case + insensitive) include: Anthropic, Cohere, AI21Labs, Amazon.' + enum: + - anthropic + - cohere + - ai21labs + - amazon +github.com/databricks/databricks-sdk-go/service/serving.AnthropicConfig: + anthropic_api_key: + description: '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: + description: '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`.' +github.com/databricks/databricks-sdk-go/service/serving.AutoCaptureConfigInput: + 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.' + enabled: + description: Indicates whether the inference table is enabled. + 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.' + 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.' +github.com/databricks/databricks-sdk-go/service/serving.CohereConfig: + cohere_api_base: + description: "This is an optional field to provide a customized base URL for the + Cohere API. \nIf left unspecified, the standard Cohere base URL is used.\n" + cohere_api_key: + description: '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: + description: '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`.' +github.com/databricks/databricks-sdk-go/service/serving.DatabricksModelServingConfig: + databricks_api_token: + description: | + 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: + description: | + 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`. + databricks_workspace_url: + description: | + The URL of the Databricks workspace containing the model serving endpoint pointed to by this external model. +github.com/databricks/databricks-sdk-go/service/serving.EndpointCoreConfigInput: + auto_capture_config: + description: Configuration for Inference Tables which automatically logs requests + and responses to Unity Catalog. + served_entities: + description: A list of served entities for the endpoint to serve. A serving endpoint + can have up to 15 served entities. + served_models: + description: (Deprecated, use served_entities instead) A list of served models + for the endpoint to serve. A serving endpoint can have up to 15 served models. + traffic_config: + description: The traffic config defining how invocations to the serving endpoint + should be routed. +github.com/databricks/databricks-sdk-go/service/serving.EndpointTag: + key: + description: Key field for a serving endpoint tag. + value: + description: Optional value field for a serving endpoint tag. +github.com/databricks/databricks-sdk-go/service/serving.ExternalModel: + ai21labs_config: + description: AI21Labs Config. Only required if the provider is 'ai21labs'. + amazon_bedrock_config: + description: Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. + anthropic_config: + description: Anthropic Config. Only required if the provider is 'anthropic'. + cohere_config: + description: Cohere Config. Only required if the provider is 'cohere'. + databricks_model_serving_config: + description: Databricks Model Serving Config. Only required if the provider is + 'databricks-model-serving'. + google_cloud_vertex_ai_config: + description: Google Cloud Vertex AI Config. Only required if the provider is 'google-cloud-vertex-ai'. + name: + description: The name of the external model. + openai_config: + description: OpenAI Config. Only required if the provider is 'openai'. + palm_config: + description: PaLM Config. Only required if the provider is 'palm'. + 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', and 'palm'.", + task: + description: The task type of the external model. +github.com/databricks/databricks-sdk-go/service/serving.ExternalModelProvider: + _: + 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', and 'palm'.", + enum: + - ai21labs + - anthropic + - amazon-bedrock + - cohere + - databricks-model-serving + - google-cloud-vertex-ai + - openai + - palm +github.com/databricks/databricks-sdk-go/service/serving.RateLimit: + calls: + description: Used to specify how many calls are allowed for a key within the renewal_period. + 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. + renewal_period: + description: Renewal period field for a serving endpoint rate limit. Currently, + only 'minute' is supported. +github.com/databricks/databricks-sdk-go/service/serving.RateLimitKey: + _: + description: Key field for a serving endpoint rate limit. Currently, only 'user' + and 'endpoint' are supported, with 'endpoint' being the default if not specified. + enum: + - user + - endpoint +github.com/databricks/databricks-sdk-go/service/serving.RateLimitRenewalPeriod: + _: + description: Renewal period field for a serving endpoint rate limit. Currently, + only 'minute' is supported. + enum: + - minute +github.com/databricks/databricks-sdk-go/service/serving.Route: + served_model_name: + description: The name of the served model this route configures traffic for. + traffic_percentage: + description: The percentage of endpoint traffic to send to this route. It must + be an integer between 0 and 100 inclusive. +github.com/databricks/databricks-sdk-go/service/serving.ServedEntityInput: + 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__. + entity_version: + description: The version of the model in Databricks Model Registry to be served + or empty if the entity is a FEATURE_SPEC. + environment_vars: + description: "An object containing a set of optional, user-specified environment + variable key-value pairs used for serving this entity.\nNote: this is an experimental + feature and subject to change. \nExample 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: + 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. + instance_profile_arn: + description: ARN of the instance profile that the served entity uses to access + AWS resources. + max_provisioned_throughput: + description: The maximum tokens per second that the endpoint can scale up to. + min_provisioned_throughput: + description: The minimum tokens per second that the endpoint can scale down to. + 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 -. + scale_to_zero_enabled: + description: Whether the compute resources for the served entity should scale + down to zero. + 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). + If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. + 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/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). +github.com/databricks/databricks-sdk-go/service/serving.ServedModelInput: + environment_vars: + description: "An object containing a set of optional, user-specified environment + variable key-value pairs used for serving this model.\nNote: this is an experimental + feature and subject to change. \nExample model 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: + description: ARN of the instance profile that the served model will use to access + AWS resources. + max_provisioned_throughput: + description: The maximum tokens per second that the endpoint can scale up to. + min_provisioned_throughput: + description: The minimum tokens per second that the endpoint can scale down to. + model_name: + description: | + The name of the model in Databricks Model Registry to be served or if the model resides in Unity Catalog, the full name of model, + in the form of __catalog_name__.__schema_name__.__model_name__. + model_version: + description: The version of the model in Databricks Model Registry or Unity Catalog + to be served. + name: + description: | + The name of a served model. It must be unique across an endpoint. If not specified, this field will default to -. + A served model name can consist of alphanumeric characters, dashes, and underscores. + scale_to_zero_enabled: + description: Whether the compute resources for the served model should scale down + to zero. + workload_size: + description: | + The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale 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). + If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size will be 0. + workload_type: + description: | + The workload type of the served model. 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/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). +github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadSize: + _: + description: | + The workload size of the served model. The workload size corresponds to a range of provisioned concurrency that the compute will autoscale 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). + If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size will be 0. + enum: + - Small + - Medium + - Large +github.com/databricks/databricks-sdk-go/service/serving.ServedModelInputWorkloadType: + _: + description: | + The workload type of the served model. 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/machine-learning/model-serving/create-manage-serving-endpoints.html#gpu-workload-types). + enum: + - CPU + - GPU_SMALL + - GPU_MEDIUM + - GPU_LARGE + - MULTIGPU_MEDIUM +github.com/databricks/databricks-sdk-go/service/serving.TrafficConfig: + routes: + description: The list of routes that define traffic to each served entity. diff --git a/bundle/internal/schema/annotations_openapi_overrides.yml b/bundle/internal/schema/annotations_openapi_overrides.yml new file mode 100644 index 00000000..e9e659e6 --- /dev/null +++ b/bundle/internal/schema/annotations_openapi_overrides.yml @@ -0,0 +1,155 @@ +github.com/databricks/cli/bundle/config/resources.Cluster: + "data_security_mode": + "description": |- + PLACEHOLDER + "docker_image": + "description": |- + PLACEHOLDER + "permissions": + "description": |- + PLACEHOLDER + "runtime_engine": + "description": |- + PLACEHOLDER + "workload_type": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.Dashboard: + "embed_credentials": + "description": |- + PLACEHOLDER + "file_path": + "description": |- + PLACEHOLDER + "permissions": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.Job: + "health": + "description": |- + PLACEHOLDER + "permissions": + "description": |- + PLACEHOLDER + "run_as": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.MlflowExperiment: + "permissions": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.MlflowModel: + "permissions": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.ModelServingEndpoint: + "permissions": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.Pipeline: + "permissions": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.QualityMonitor: + "table_name": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.RegisteredModel: + "grants": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.Schema: + "grants": + "description": |- + PLACEHOLDER + "properties": + "description": |- + PLACEHOLDER +github.com/databricks/cli/bundle/config/resources.Volume: + "grants": + "description": |- + PLACEHOLDER + "volume_type": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/compute.AwsAttributes: + "availability": + "description": |- + PLACEHOLDER + "ebs_volume_type": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/compute.AzureAttributes: + "availability": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/compute.ClusterSpec: + "data_security_mode": + "description": |- + PLACEHOLDER + "docker_image": + "description": |- + PLACEHOLDER + "runtime_engine": + "description": |- + PLACEHOLDER + "workload_type": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/compute.DockerImage: + "basic_auth": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/compute.GcpAttributes: + "availability": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.GitSource: + "git_snapshot": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.JobEnvironment: + "spec": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRule: + "metric": + "description": |- + PLACEHOLDER + "op": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.JobsHealthRules: + "rules": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.RunJobTask: + "python_named_params": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.Task: + "health": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.TriggerSettings: + "table_update": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/jobs.Webhook: + "id": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger: + "quartz_cron_schedule": + "description": |- + PLACEHOLDER + "timezone_id": + "description": |- + PLACEHOLDER +github.com/databricks/databricks-sdk-go/service/pipelines.PipelineTrigger: + "cron": + "description": |- + PLACEHOLDER + "manual": + "description": |- + PLACEHOLDER diff --git a/bundle/internal/schema/annotations_test.go b/bundle/internal/schema/annotations_test.go new file mode 100644 index 00000000..d7e2fea7 --- /dev/null +++ b/bundle/internal/schema/annotations_test.go @@ -0,0 +1,44 @@ +package main + +import ( + "testing" +) + +func TestConvertLinksToAbsoluteUrl(t *testing.T) { + tests := []struct { + input string + expected string + }{ + { + input: "", + expected: "", + }, + { + input: "Some text (not a link)", + expected: "Some text (not a link)", + }, + { + input: "This is a link to [_](#section)", + expected: "This is a link to [section](https://docs.databricks.com/dev-tools/bundles/reference.html#section)", + }, + { + input: "This is a link to [_](/dev-tools/bundles/resources.html#dashboard)", + expected: "This is a link to [dashboard](https://docs.databricks.com/dev-tools/bundles/resources.html#dashboard)", + }, + { + input: "This is a link to [_](/dev-tools/bundles/resources.html)", + expected: "This is a link to [link](https://docs.databricks.com/dev-tools/bundles/resources.html)", + }, + { + input: "This is a link to [external](https://external.com)", + expected: "This is a link to [external](https://external.com)", + }, + } + + for _, test := range tests { + result := convertLinksToAbsoluteUrl(test.input) + if result != test.expected { + t.Errorf("For input '%s', expected '%s', but got '%s'", test.input, test.expected, result) + } + } +} diff --git a/bundle/internal/schema/main.go b/bundle/internal/schema/main.go index cc06f0bb..77927a96 100644 --- a/bundle/internal/schema/main.go +++ b/bundle/internal/schema/main.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "os" + "path/filepath" "reflect" "github.com/databricks/cli/bundle/config" @@ -43,7 +44,8 @@ func addInterpolationPatterns(typ reflect.Type, s jsonschema.Schema) jsonschema. case jsonschema.ArrayType, jsonschema.ObjectType: // arrays and objects can have complex variable values specified. return jsonschema.Schema{ - AnyOf: []jsonschema.Schema{ + // OneOf is used because we don't expect more than 1 match and schema-based auto-complete works better with OneOf + OneOf: []jsonschema.Schema{ s, { Type: jsonschema.StringType, @@ -55,7 +57,7 @@ func addInterpolationPatterns(typ reflect.Type, s jsonschema.Schema) jsonschema. // primitives can have variable values, or references like ${bundle.xyz} // or ${workspace.xyz} return jsonschema.Schema{ - AnyOf: []jsonschema.Schema{ + OneOf: []jsonschema.Schema{ s, {Type: jsonschema.StringType, Pattern: interpolationPattern("resources")}, {Type: jsonschema.StringType, Pattern: interpolationPattern("bundle")}, @@ -113,37 +115,60 @@ func makeVolumeTypeOptional(typ reflect.Type, s jsonschema.Schema) jsonschema.Sc } func main() { - if len(os.Args) != 2 { - fmt.Println("Usage: go run main.go ") + if len(os.Args) != 3 { + fmt.Println("Usage: go run main.go ") os.Exit(1) } + // Directory with annotation files + workdir := os.Args[1] // Output file, where the generated JSON schema will be written to. - outputFile := os.Args[1] + outputFile := os.Args[2] + + generateSchema(workdir, outputFile) +} + +func generateSchema(workdir, outputFile string) { + annotationsPath := filepath.Join(workdir, "annotations.yml") + annotationsOpenApiPath := filepath.Join(workdir, "annotations_openapi.yml") + annotationsOpenApiOverridesPath := filepath.Join(workdir, "annotations_openapi_overrides.yml") // Input file, the databricks openapi spec. inputFile := os.Getenv("DATABRICKS_OPENAPI_SPEC") - if inputFile == "" { - log.Fatal("DATABRICKS_OPENAPI_SPEC environment variable not set") + if inputFile != "" { + p, err := newParser(inputFile) + if err != nil { + log.Fatal(err) + } + fmt.Printf("Writing OpenAPI annotations to %s\n", annotationsOpenApiPath) + err = p.extractAnnotations(reflect.TypeOf(config.Root{}), annotationsOpenApiPath, annotationsOpenApiOverridesPath) + if err != nil { + log.Fatal(err) + } } - p, err := newParser(inputFile) + a, err := newAnnotationHandler([]string{annotationsOpenApiPath, annotationsOpenApiOverridesPath, annotationsPath}) if err != nil { log.Fatal(err) } // Generate the JSON schema from the bundle Go struct. s, err := jsonschema.FromType(reflect.TypeOf(config.Root{}), []func(reflect.Type, jsonschema.Schema) jsonschema.Schema{ - p.addDescriptions, - p.addEnums, removeJobsFields, makeVolumeTypeOptional, + a.addAnnotations, addInterpolationPatterns, }) if err != nil { log.Fatal(err) } + // Overwrite the input annotation file, adding missing annotations + err = a.syncWithMissingAnnotations(annotationsPath) + if err != nil { + log.Fatal(err) + } + b, err := json.MarshalIndent(s, "", " ") if err != nil { log.Fatal(err) diff --git a/bundle/internal/schema/main_test.go b/bundle/internal/schema/main_test.go new file mode 100644 index 00000000..f1389e61 --- /dev/null +++ b/bundle/internal/schema/main_test.go @@ -0,0 +1,125 @@ +package main + +import ( + "bytes" + "fmt" + "io" + "os" + "path" + "reflect" + "strings" + "testing" + + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/libs/dyn" + "github.com/databricks/cli/libs/dyn/merge" + "github.com/databricks/cli/libs/dyn/yamlloader" + "github.com/databricks/cli/libs/jsonschema" + "github.com/ghodss/yaml" + "github.com/stretchr/testify/assert" +) + +func copyFile(src, dst string) error { + in, err := os.Open(src) + if err != nil { + return err + } + defer in.Close() + + out, err := os.Create(dst) + if err != nil { + return err + } + defer out.Close() + + _, err = io.Copy(out, in) + if err != nil { + return err + } + + return out.Close() +} + +// Checks whether descriptions are added for new config fields in the annotations.yml file +// If this test fails either manually add descriptions to the `annotations.yml` or do the following: +// 1. run `make schema` from the repository root to add placeholder descriptions +// 2. replace all "PLACEHOLDER" values with the actual descriptions if possible +// 3. run `make schema` again to regenerate the schema with acutal descriptions +func TestRequiredAnnotationsForNewFields(t *testing.T) { + workdir := t.TempDir() + annotationsPath := path.Join(workdir, "annotations.yml") + annotationsOpenApiPath := path.Join(workdir, "annotations_openapi.yml") + annotationsOpenApiOverridesPath := path.Join(workdir, "annotations_openapi_overrides.yml") + + // Copy existing annotation files from the same folder as this test + err := copyFile("annotations.yml", annotationsPath) + assert.NoError(t, err) + err = copyFile("annotations_openapi.yml", annotationsOpenApiPath) + assert.NoError(t, err) + err = copyFile("annotations_openapi_overrides.yml", annotationsOpenApiOverridesPath) + assert.NoError(t, err) + + generateSchema(workdir, path.Join(t.TempDir(), "schema.json")) + + originalFile, err := os.ReadFile("annotations.yml") + assert.NoError(t, err) + currentFile, err := os.ReadFile(annotationsPath) + assert.NoError(t, err) + original, err := yamlloader.LoadYAML("", bytes.NewBuffer(originalFile)) + assert.NoError(t, err) + current, err := yamlloader.LoadYAML("", bytes.NewBuffer(currentFile)) + assert.NoError(t, err) + + // Collect added paths. + var updatedFieldPaths []string + _, err = merge.Override(original, current, merge.OverrideVisitor{ + VisitInsert: func(basePath dyn.Path, right dyn.Value) (dyn.Value, error) { + updatedFieldPaths = append(updatedFieldPaths, basePath.String()) + return right, nil + }, + }) + assert.NoError(t, err) + assert.Empty(t, updatedFieldPaths, fmt.Sprintf("Missing JSON-schema descriptions for new config fields in bundle/internal/schema/annotations.yml:\n%s", strings.Join(updatedFieldPaths, "\n"))) +} + +// Checks whether types in annotation files are still present in Config type +func TestNoDetachedAnnotations(t *testing.T) { + files := []string{ + "annotations.yml", + "annotations_openapi.yml", + "annotations_openapi_overrides.yml", + } + + types := map[string]bool{} + for _, file := range files { + annotations, err := getAnnotations(file) + assert.NoError(t, err) + for k := range annotations { + types[k] = false + } + } + + _, err := jsonschema.FromType(reflect.TypeOf(config.Root{}), []func(reflect.Type, jsonschema.Schema) jsonschema.Schema{ + func(typ reflect.Type, s jsonschema.Schema) jsonschema.Schema { + delete(types, getPath(typ)) + return s + }, + }) + assert.NoError(t, err) + + for typ := range types { + t.Errorf("Type `%s` in annotations file is not found in `root.Config` type", typ) + } + assert.Empty(t, types, "Detached annotations found, regenerate schema and check for package path changes") +} + +func getAnnotations(path string) (annotationFile, error) { + b, err := os.ReadFile(path) + if err != nil { + return nil, err + } + + var data annotationFile + err = yaml.Unmarshal(b, &data) + return data, err +} diff --git a/bundle/internal/schema/parser.go b/bundle/internal/schema/parser.go index ef3d6e71..6fb6e004 100644 --- a/bundle/internal/schema/parser.go +++ b/bundle/internal/schema/parser.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "encoding/json" "fmt" "os" @@ -8,6 +9,9 @@ import ( "reflect" "strings" + "github.com/ghodss/yaml" + + "github.com/databricks/cli/libs/dyn/yamlloader" "github.com/databricks/cli/libs/jsonschema" ) @@ -23,6 +27,8 @@ type openapiParser struct { ref map[string]jsonschema.Schema } +const RootTypeKey = "_" + func newParser(path string) (*openapiParser, error) { b, err := os.ReadFile(path) if err != nil { @@ -89,35 +95,95 @@ func (p *openapiParser) findRef(typ reflect.Type) (jsonschema.Schema, bool) { } // Use the OpenAPI spec to load descriptions for the given type. -func (p *openapiParser) addDescriptions(typ reflect.Type, s jsonschema.Schema) jsonschema.Schema { - ref, ok := p.findRef(typ) - if !ok { - return s +func (p *openapiParser) extractAnnotations(typ reflect.Type, outputPath, overridesPath string) error { + annotations := annotationFile{} + overrides := annotationFile{} + + b, err := os.ReadFile(overridesPath) + if err != nil { + return err + } + err = yaml.Unmarshal(b, &overrides) + if err != nil { + return err + } + if overrides == nil { + overrides = annotationFile{} } - s.Description = ref.Description - for k, v := range s.Properties { - if refProp, ok := ref.Properties[k]; ok { - v.Description = refProp.Description - } + _, err = jsonschema.FromType(typ, []func(reflect.Type, jsonschema.Schema) jsonschema.Schema{ + func(typ reflect.Type, s jsonschema.Schema) jsonschema.Schema { + ref, ok := p.findRef(typ) + if !ok { + return s + } + + basePath := getPath(typ) + pkg := map[string]annotation{} + annotations[basePath] = pkg + + if ref.Description != "" || ref.Enum != nil { + pkg[RootTypeKey] = annotation{Description: ref.Description, Enum: ref.Enum} + } + + for k := range s.Properties { + if refProp, ok := ref.Properties[k]; ok { + pkg[k] = annotation{Description: refProp.Description, Enum: refProp.Enum} + if refProp.Description == "" { + addEmptyOverride(k, basePath, overrides) + } + } else { + addEmptyOverride(k, basePath, overrides) + } + } + return s + }, + }) + if err != nil { + return err } - return s + b, err = yaml.Marshal(overrides) + if err != nil { + return err + } + o, err := yamlloader.LoadYAML("", bytes.NewBuffer(b)) + if err != nil { + return err + } + err = saveYamlWithStyle(overridesPath, o) + if err != nil { + return err + } + b, err = yaml.Marshal(annotations) + if err != nil { + return err + } + b = bytes.Join([][]byte{[]byte("# This file is auto-generated. DO NOT EDIT."), b}, []byte("\n")) + err = os.WriteFile(outputPath, b, 0o644) + if err != nil { + return err + } + + return nil } -// Use the OpenAPI spec add enum values for the given type. -func (p *openapiParser) addEnums(typ reflect.Type, s jsonschema.Schema) jsonschema.Schema { - ref, ok := p.findRef(typ) +func addEmptyOverride(key, pkg string, overridesFile annotationFile) { + if overridesFile[pkg] == nil { + overridesFile[pkg] = map[string]annotation{} + } + + overrides := overridesFile[pkg] + if overrides[key].Description == "" { + overrides[key] = annotation{Description: Placeholder} + } + + a, ok := overrides[key] if !ok { - return s + a = annotation{} } - - s.Enum = append(s.Enum, ref.Enum...) - for k, v := range s.Properties { - if refProp, ok := ref.Properties[k]; ok { - v.Enum = append(v.Enum, refProp.Enum...) - } + if a.Description == "" { + a.Description = Placeholder } - - return s + overrides[key] = a } diff --git a/bundle/internal/schema/testdata/pass/target_variable.yml b/bundle/internal/schema/testdata/pass/target_variable.yml new file mode 100644 index 00000000..34af9465 --- /dev/null +++ b/bundle/internal/schema/testdata/pass/target_variable.yml @@ -0,0 +1,5 @@ +targets: + production: + variables: + myvar: + default: true diff --git a/bundle/schema/embed_test.go b/bundle/schema/embed_test.go index ff2e7651..59f1458c 100644 --- a/bundle/schema/embed_test.go +++ b/bundle/schema/embed_test.go @@ -41,21 +41,21 @@ func TestJsonSchema(t *testing.T) { resourceJob := walk(s.Definitions, "github.com", "databricks", "cli", "bundle", "config", "resources.Job") fields := []string{"name", "continuous", "tasks", "trigger"} for _, field := range fields { - assert.NotEmpty(t, resourceJob.AnyOf[0].Properties[field].Description) + assert.NotEmpty(t, resourceJob.OneOf[0].Properties[field].Description) } // Assert descriptions were also loaded for a job task definition. jobTask := walk(s.Definitions, "github.com", "databricks", "databricks-sdk-go", "service", "jobs.Task") fields = []string{"notebook_task", "spark_jar_task", "spark_python_task", "spark_submit_task", "description", "depends_on", "environment_key", "for_each_task", "existing_cluster_id"} for _, field := range fields { - assert.NotEmpty(t, jobTask.AnyOf[0].Properties[field].Description) + assert.NotEmpty(t, jobTask.OneOf[0].Properties[field].Description) } // Assert descriptions are loaded for pipelines pipeline := walk(s.Definitions, "github.com", "databricks", "cli", "bundle", "config", "resources.Pipeline") fields = []string{"name", "catalog", "clusters", "channel", "continuous", "development"} for _, field := range fields { - assert.NotEmpty(t, pipeline.AnyOf[0].Properties[field].Description) + assert.NotEmpty(t, pipeline.OneOf[0].Properties[field].Description) } providers := walk(s.Definitions, "github.com", "databricks", "databricks-sdk-go", "service", "jobs.GitProvider") diff --git a/bundle/schema/jsonschema.json b/bundle/schema/jsonschema.json index e813e440..8ff7ff4d 100644 --- a/bundle/schema/jsonschema.json +++ b/bundle/schema/jsonschema.json @@ -1,7 +1,7 @@ { "$defs": { "bool": { - "anyOf": [ + "oneOf": [ { "type": "boolean" }, @@ -28,7 +28,7 @@ ] }, "float64": { - "anyOf": [ + "oneOf": [ { "type": "number" }, @@ -60,7 +60,7 @@ "bundle": { "config": { "resources.Cluster": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -181,7 +181,7 @@ ] }, "resources.Dashboard": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -244,14 +244,16 @@ ] }, "resources.Grant": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "principal": { + "description": "The name of the principal that will be granted privileges", "$ref": "#/$defs/string" }, "privileges": { + "description": "The privileges to grant to the specified entity", "$ref": "#/$defs/slice/string" } }, @@ -268,7 +270,7 @@ ] }, "resources.Job": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -363,7 +365,7 @@ ] }, "resources.MlflowExperiment": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -408,7 +410,7 @@ ] }, "resources.MlflowModel": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -453,7 +455,7 @@ ] }, "resources.ModelServingEndpoint": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -498,20 +500,24 @@ ] }, "resources.Permission": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "group_name": { + "description": "The name of the group that has the permission set in level.", "$ref": "#/$defs/string" }, "level": { + "description": "The allowed permission for user, group, service principal defined for this permission.", "$ref": "#/$defs/string" }, "service_principal_name": { + "description": "The name of the service principal that has the permission set in level.", "$ref": "#/$defs/string" }, "user_name": { + "description": "The name of the user that has the permission set in level.", "$ref": "#/$defs/string" } }, @@ -527,7 +533,7 @@ ] }, "resources.Pipeline": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -636,7 +642,7 @@ ] }, "resources.QualityMonitor": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -710,7 +716,7 @@ ] }, "resources.RegisteredModel": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -752,7 +758,7 @@ ] }, "resources.Schema": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -792,7 +798,7 @@ ] }, "resources.Volume": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -837,7 +843,7 @@ ] }, "variable.Lookup": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -895,12 +901,15 @@ "$ref": "#/$defs/interface" }, "description": { + "description": "The description of the variable.", "$ref": "#/$defs/string" }, "lookup": { + "description": "The name of the alert, cluster_policy, cluster, dashboard, instance_pool, job, metastore, pipeline, query, service_principal, or warehouse object for which to retrieve an ID.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/variable.Lookup" }, "type": { + "description": "The type of the variable.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/variable.VariableType" } }, @@ -916,12 +925,16 @@ "$ref": "#/$defs/interface" }, "description": { + "description": "The description of the variable", "$ref": "#/$defs/string" }, "lookup": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config/variable.Lookup" + "description": "The name of the alert, cluster_policy, cluster, dashboard, instance_pool, job, metastore, pipeline, query, service_principal, or warehouse object for which to retrieve an ID.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config/variable.Lookup", + "markdownDescription": "The name of the `alert`, `cluster_policy`, `cluster`, `dashboard`, `instance_pool`, `job`, `metastore`, `pipeline`, `query`, `service_principal`, or `warehouse` object for which to retrieve an ID.\"" }, "type": { + "description": "The type of the variable.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/variable.VariableType" } }, @@ -932,24 +945,31 @@ } }, "config.Artifact": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "build": { + "description": "An optional set of non-default build commands that you want to run locally before deployment.\n\nFor Python wheel builds, the Databricks CLI assumes that it can find a local install of the Python wheel package to run builds, and it runs the command python setup.py bdist_wheel by default during each bundle deployment.\n\nTo specify multiple build commands, separate each command with double-ampersand (\u0026\u0026) characters.", "$ref": "#/$defs/string" }, "executable": { + "description": "The executable type.", "$ref": "#/$defs/github.com/databricks/cli/libs/exec.ExecutableType" }, "files": { - "$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config.ArtifactFile" + "description": "The source files for the artifact.", + "$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config.ArtifactFile", + "markdownDescription": "The source files for the artifact, defined as an [artifact_file](https://docs.databricks.com/dev-tools/bundles/reference.html#artifact_file)." }, "path": { + "description": "The location where the built artifact will be saved.", "$ref": "#/$defs/string" }, "type": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.ArtifactType" + "description": "The type of the artifact.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.ArtifactType", + "markdownDescription": "The type of the artifact. Valid values are `wheel` or `jar`" } }, "additionalProperties": false, @@ -964,11 +984,12 @@ ] }, "config.ArtifactFile": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "source": { + "description": "The path of the files used to build the artifact.", "$ref": "#/$defs/string" } }, @@ -987,26 +1008,35 @@ "type": "string" }, "config.Bundle": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "cluster_id": { - "$ref": "#/$defs/string" + "description": "The ID of a cluster to use to run the bundle.", + "$ref": "#/$defs/string", + "markdownDescription": "The ID of a cluster to use to run the bundle. See [cluster_id](https://docs.databricks.com/dev-tools/bundles/settings.html#cluster_id)." }, "compute_id": { "$ref": "#/$defs/string" }, "databricks_cli_version": { - "$ref": "#/$defs/string" + "description": "The Databricks CLI version to use for the bundle.", + "$ref": "#/$defs/string", + "markdownDescription": "The Databricks CLI version to use for the bundle. See [databricks_cli_version](https://docs.databricks.com/dev-tools/bundles/settings.html#databricks_cli_version)." }, "deployment": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Deployment" + "description": "The definition of the bundle deployment", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Deployment", + "markdownDescription": "The definition of the bundle deployment. For supported attributes, see [deployment](https://docs.databricks.com/dev-tools/bundles/reference.html#deployment) and [link](https://docs.databricks.com/dev-tools/bundles/deployment-modes.html)." }, "git": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Git" + "description": "The Git version control details that are associated with your bundle.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Git", + "markdownDescription": "The Git version control details that are associated with your bundle. For supported attributes, see [git](https://docs.databricks.com/dev-tools/bundles/reference.html#git) and [git](https://docs.databricks.com/dev-tools/bundles/settings.html#git)." }, "name": { + "description": "The name of the bundle.", "$ref": "#/$defs/string" }, "uuid": { @@ -1028,15 +1058,18 @@ "type": "string" }, "config.Deployment": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "fail_on_active_runs": { + "description": "Whether to fail on active runs. If this is set to true a deployment that is running can be interrupted.", "$ref": "#/$defs/bool" }, "lock": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Lock" + "description": "The deployment lock attributes.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Lock", + "markdownDescription": "The deployment lock attributes. See [lock](https://docs.databricks.com/dev-tools/bundles/reference.html#lock)." } }, "additionalProperties": false @@ -1048,20 +1081,24 @@ ] }, "config.Experimental": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "pydabs": { + "description": "The PyDABs configuration.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config.PyDABs" }, "python_wheel_wrapper": { + "description": "Whether to use a Python wheel wrapper", "$ref": "#/$defs/bool" }, "scripts": { + "description": "The commands to run", "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config.Command" }, "use_legacy_run_as": { + "description": "Whether to use the legacy run_as behavior", "$ref": "#/$defs/bool" } }, @@ -1074,15 +1111,19 @@ ] }, "config.Git": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "branch": { - "$ref": "#/$defs/string" + "description": "The Git branch name.", + "$ref": "#/$defs/string", + "markdownDescription": "The Git branch name. See [git](https://docs.databricks.com/dev-tools/bundles/settings.html#git)." }, "origin_url": { - "$ref": "#/$defs/string" + "description": "The origin URL of the repository.", + "$ref": "#/$defs/string", + "markdownDescription": "The origin URL of the repository. See [git](https://docs.databricks.com/dev-tools/bundles/settings.html#git)." } }, "additionalProperties": false @@ -1094,14 +1135,16 @@ ] }, "config.Lock": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "enabled": { + "description": "Whether this lock is enabled.", "$ref": "#/$defs/bool" }, "force": { + "description": "Whether to force this lock if it is enabled.", "$ref": "#/$defs/bool" } }, @@ -1117,26 +1160,32 @@ "type": "string" }, "config.Presets": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "jobs_max_concurrent_runs": { + "description": "The maximum concurrent runs for a job.", "$ref": "#/$defs/int" }, "name_prefix": { + "description": "The prefix for job runs of the bundle.", "$ref": "#/$defs/string" }, "pipelines_development": { + "description": "Whether pipeline deployments should be locked in development mode.", "$ref": "#/$defs/bool" }, "source_linked_deployment": { + "description": "Whether to link the deployment to the bundle source.", "$ref": "#/$defs/bool" }, "tags": { + "description": "The tags for the bundle deployment.", "$ref": "#/$defs/map/string" }, "trigger_pause_status": { + "description": "A pause status to apply to all job triggers and schedules. Valid values are PAUSED or UNPAUSED.", "$ref": "#/$defs/string" } }, @@ -1149,17 +1198,20 @@ ] }, "config.PyDABs": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "enabled": { + "description": "Whether or not PyDABs (Private Preview) is enabled", "$ref": "#/$defs/bool" }, "import": { + "description": "The PyDABs project to import to discover resources, resource generator and mutators", "$ref": "#/$defs/slice/string" }, "venv_path": { + "description": "The Python virtual environment path", "$ref": "#/$defs/string" } }, @@ -1172,39 +1224,59 @@ ] }, "config.Resources": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "clusters": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Cluster" + "description": "The cluster definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Cluster", + "markdownDescription": "The cluster definitions for the bundle. See [cluster](https://docs.databricks.com/dev-tools/bundles/resources.html#cluster)" }, "dashboards": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Dashboard" + "description": "The dashboard definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Dashboard", + "markdownDescription": "The dashboard definitions for the bundle. See [dashboard](https://docs.databricks.com/dev-tools/bundles/resources.html#dashboard)" }, "experiments": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.MlflowExperiment" + "description": "The experiment definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.MlflowExperiment", + "markdownDescription": "The experiment definitions for the bundle. See [experiment](https://docs.databricks.com/dev-tools/bundles/resources.html#experiment)" }, "jobs": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Job" + "description": "The job definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Job", + "markdownDescription": "The job definitions for the bundle. See [job](https://docs.databricks.com/dev-tools/bundles/resources.html#job)" }, "model_serving_endpoints": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.ModelServingEndpoint" + "description": "The model serving endpoint definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.ModelServingEndpoint", + "markdownDescription": "The model serving endpoint definitions for the bundle. See [model_serving_endpoint](https://docs.databricks.com/dev-tools/bundles/resources.html#model_serving_endpoint)" }, "models": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.MlflowModel" + "description": "The model definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.MlflowModel", + "markdownDescription": "The model definitions for the bundle. See [model](https://docs.databricks.com/dev-tools/bundles/resources.html#model)" }, "pipelines": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Pipeline" + "description": "The pipeline definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Pipeline", + "markdownDescription": "The pipeline definitions for the bundle. See [pipeline](https://docs.databricks.com/dev-tools/bundles/resources.html#pipeline)" }, "quality_monitors": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.QualityMonitor" + "description": "The quality monitor definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.QualityMonitor", + "markdownDescription": "The quality monitor definitions for the bundle. See [quality_monitor](https://docs.databricks.com/dev-tools/bundles/resources.html#quality_monitor)" }, "registered_models": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.RegisteredModel" + "description": "The registered model definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.RegisteredModel", + "markdownDescription": "The registered model definitions for the bundle. See [registered_model](https://docs.databricks.com/dev-tools/bundles/resources.html#registered_model)" }, "schemas": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Schema" + "description": "The schema definitions for the bundle.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Schema", + "markdownDescription": "The schema definitions for the bundle. See [schema](https://docs.databricks.com/dev-tools/bundles/resources.html#schema)" }, "volumes": { "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/resources.Volume" @@ -1219,17 +1291,20 @@ ] }, "config.Sync": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "exclude": { + "description": "A list of files or folders to exclude from the bundle.", "$ref": "#/$defs/slice/string" }, "include": { + "description": "A list of files or folders to include in the bundle.", "$ref": "#/$defs/slice/string" }, "paths": { + "description": "The local folder paths, which can be outside the bundle root, to synchronize to the workspace when the bundle is deployed.", "$ref": "#/$defs/slice/string" } }, @@ -1242,51 +1317,75 @@ ] }, "config.Target": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "artifacts": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config.Artifact" + "description": "The artifacts to include in the target deployment.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config.Artifact", + "markdownDescription": "The artifacts to include in the target deployment. See [artifact](https://docs.databricks.com/dev-tools/bundles/reference.html#artifact)" }, "bundle": { + "description": "The name of the bundle when deploying to this target.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Bundle" }, "cluster_id": { + "description": "The ID of the cluster to use for this target.", "$ref": "#/$defs/string" }, "compute_id": { + "description": "Deprecated. The ID of the compute to use for this target.", "$ref": "#/$defs/string" }, "default": { + "description": "Whether this target is the default target.", "$ref": "#/$defs/bool" }, "git": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Git" + "description": "The Git version control settings for the target.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Git", + "markdownDescription": "The Git version control settings for the target. See [git](https://docs.databricks.com/dev-tools/bundles/reference.html#git)." }, "mode": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Mode" + "description": "The deployment mode for the target.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Mode", + "markdownDescription": "The deployment mode for the target. Valid values are `development` or `production`. See [link](https://docs.databricks.com/dev-tools/bundles/deployment-modes.html)." }, "permissions": { - "$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config/resources.Permission" + "description": "The permissions for deploying and running the bundle in the target.", + "$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config/resources.Permission", + "markdownDescription": "The permissions for deploying and running the bundle in the target. See [permission](https://docs.databricks.com/dev-tools/bundles/reference.html#permission)." }, "presets": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Presets" + "description": "The deployment presets for the target.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Presets", + "markdownDescription": "The deployment presets for the target. See [preset](https://docs.databricks.com/dev-tools/bundles/reference.html#preset)." }, "resources": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Resources" + "description": "The resource definitions for the target.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Resources", + "markdownDescription": "The resource definitions for the target. See [resources](https://docs.databricks.com/dev-tools/bundles/reference.html#resources)." }, "run_as": { - "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobRunAs" + "description": "The identity to use to run the bundle.", + "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobRunAs", + "markdownDescription": "The identity to use to run the bundle. See [job_run_as](https://docs.databricks.com/dev-tools/bundles/reference.html#job_run_as) and [link](https://docs.databricks.com/dev-tools/bundles/run_as.html)." }, "sync": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Sync" + "description": "The local paths to sync to the target workspace when a bundle is run or deployed.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Sync", + "markdownDescription": "The local paths to sync to the target workspace when a bundle is run or deployed. See [sync](https://docs.databricks.com/dev-tools/bundles/reference.html#sync)." }, "variables": { - "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/variable.TargetVariable" + "description": "The custom variable definitions for the target.", + "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/variable.TargetVariable", + "markdownDescription": "The custom variable definitions for the target. See [variables](https://docs.databricks.com/dev-tools/bundles/settings.html#variables) and [link](https://docs.databricks.com/dev-tools/bundles/variables.html)." }, "workspace": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Workspace" + "description": "The Databricks workspace for the target.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Workspace", + "markdownDescription": "The Databricks workspace for the target. [workspace](https://docs.databricks.com/dev-tools/bundles/reference.html#workspace)" } }, "additionalProperties": false @@ -1298,56 +1397,72 @@ ] }, "config.Workspace": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "artifact_path": { + "description": "The artifact path to use within the workspace for both deployments and workflow runs", "$ref": "#/$defs/string" }, "auth_type": { + "description": "The authentication type.", "$ref": "#/$defs/string" }, "azure_client_id": { + "description": "The Azure client ID", "$ref": "#/$defs/string" }, "azure_environment": { + "description": "The Azure environment", "$ref": "#/$defs/string" }, "azure_login_app_id": { + "description": "The Azure login app ID", "$ref": "#/$defs/string" }, "azure_tenant_id": { + "description": "The Azure tenant ID", "$ref": "#/$defs/string" }, "azure_use_msi": { + "description": "Whether to use MSI for Azure", "$ref": "#/$defs/bool" }, "azure_workspace_resource_id": { + "description": "The Azure workspace resource ID", "$ref": "#/$defs/string" }, "client_id": { + "description": "The client ID for the workspace", "$ref": "#/$defs/string" }, "file_path": { + "description": "The file path to use within the workspace for both deployments and workflow runs", "$ref": "#/$defs/string" }, "google_service_account": { + "description": "The Google service account name", "$ref": "#/$defs/string" }, "host": { + "description": "The Databricks workspace host URL", "$ref": "#/$defs/string" }, "profile": { + "description": "The Databricks workspace profile name", "$ref": "#/$defs/string" }, "resource_path": { + "description": "The workspace resource path", "$ref": "#/$defs/string" }, "root_path": { + "description": "The Databricks workspace root path", "$ref": "#/$defs/string" }, "state_path": { + "description": "The workspace state path", "$ref": "#/$defs/string" } }, @@ -1369,7 +1484,7 @@ "databricks-sdk-go": { "service": { "catalog.MonitorCronSchedule": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1407,7 +1522,7 @@ ] }, "catalog.MonitorDataClassificationConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1425,7 +1540,7 @@ ] }, "catalog.MonitorDestination": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1443,7 +1558,7 @@ ] }, "catalog.MonitorInferenceLog": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1500,7 +1615,7 @@ ] }, "catalog.MonitorMetric": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1550,7 +1665,7 @@ ] }, "catalog.MonitorNotifications": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1572,7 +1687,7 @@ ] }, "catalog.MonitorSnapshot": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": false @@ -1584,7 +1699,7 @@ ] }, "catalog.MonitorTimeSeries": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1617,7 +1732,7 @@ ] }, "compute.Adlsgen2Info": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1638,7 +1753,7 @@ ] }, "compute.AutoScale": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1660,7 +1775,7 @@ ] }, "compute.AwsAttributes": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1721,7 +1836,7 @@ ] }, "compute.AzureAttributes": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1759,7 +1874,7 @@ ] }, "compute.ClientsTypes": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1781,7 +1896,7 @@ ] }, "compute.ClusterLogConf": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1803,7 +1918,7 @@ ] }, "compute.ClusterSpec": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1934,7 +2049,7 @@ ] }, "compute.DbfsStorageInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1955,7 +2070,7 @@ ] }, "compute.DockerBasicAuth": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -1977,7 +2092,7 @@ ] }, "compute.DockerImage": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2006,7 +2121,7 @@ ] }, "compute.Environment": { - "anyOf": [ + "oneOf": [ { "type": "object", "description": "The environment entity used to preserve serverless environment side panel and jobs' environment for non-notebook task.\nIn this minimal environment spec, only pip dependencies are supported.", @@ -2032,7 +2147,7 @@ ] }, "compute.GcpAttributes": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2078,7 +2193,7 @@ ] }, "compute.GcsStorageInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2099,7 +2214,7 @@ ] }, "compute.InitScriptInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2141,7 +2256,7 @@ ] }, "compute.Library": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2183,7 +2298,7 @@ ] }, "compute.LocalFileInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2204,7 +2319,7 @@ ] }, "compute.LogAnalyticsInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2226,7 +2341,7 @@ ] }, "compute.MavenLibrary": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2255,7 +2370,7 @@ ] }, "compute.PythonPyPiLibrary": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2280,7 +2395,7 @@ ] }, "compute.RCranLibrary": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2314,7 +2429,7 @@ ] }, "compute.S3StorageInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2359,7 +2474,7 @@ ] }, "compute.VolumesStorageInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2380,7 +2495,7 @@ ] }, "compute.WorkloadType": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2401,7 +2516,7 @@ ] }, "compute.WorkspaceStorageInfo": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2436,7 +2551,7 @@ ] }, "jobs.ConditionTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2479,7 +2594,7 @@ ] }, "jobs.Continuous": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2497,7 +2612,7 @@ ] }, "jobs.CronSchedule": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2527,7 +2642,7 @@ ] }, "jobs.DbtTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2572,7 +2687,7 @@ ] }, "jobs.FileArrivalTriggerConfiguration": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2601,7 +2716,7 @@ ] }, "jobs.ForEachTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2651,7 +2766,7 @@ ] }, "jobs.GitSnapshot": { - "anyOf": [ + "oneOf": [ { "type": "object", "description": "Read-only state of the remote repository at the time the job was run. This field is only included on job runs.", @@ -2670,7 +2785,7 @@ ] }, "jobs.GitSource": { - "anyOf": [ + "oneOf": [ { "type": "object", "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.", @@ -2709,7 +2824,7 @@ ] }, "jobs.JobCluster": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2735,7 +2850,7 @@ ] }, "jobs.JobDeployment": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2775,7 +2890,7 @@ ] }, "jobs.JobEmailNotifications": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2813,7 +2928,7 @@ ] }, "jobs.JobEnvironment": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2837,7 +2952,7 @@ ] }, "jobs.JobNotificationSettings": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2859,7 +2974,7 @@ ] }, "jobs.JobParameterDefinition": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2885,7 +3000,7 @@ ] }, "jobs.JobRunAs": { - "anyOf": [ + "oneOf": [ { "type": "object", "description": "Write-only setting. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job.\n\nEither `user_name` or `service_principal_name` should be specified. If not, an error is thrown.", @@ -2908,7 +3023,7 @@ ] }, "jobs.JobSource": { - "anyOf": [ + "oneOf": [ { "type": "object", "description": "The source of the job specification in the remote repository when the job is source controlled.", @@ -2965,7 +3080,7 @@ ] }, "jobs.JobsHealthRule": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -2994,7 +3109,7 @@ ] }, "jobs.JobsHealthRules": { - "anyOf": [ + "oneOf": [ { "type": "object", "description": "An optional set of health rules that can be defined for this job.", @@ -3012,7 +3127,7 @@ ] }, "jobs.NotebookTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3052,7 +3167,7 @@ ] }, "jobs.PeriodicTriggerConfiguration": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3086,7 +3201,7 @@ ] }, "jobs.PipelineParams": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3104,7 +3219,7 @@ ] }, "jobs.PipelineTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3129,7 +3244,7 @@ ] }, "jobs.PythonWheelTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3163,7 +3278,7 @@ ] }, "jobs.QueueSettings": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3196,7 +3311,7 @@ ] }, "jobs.RunJobTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3260,7 +3375,7 @@ ] }, "jobs.SparkJarTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3286,7 +3401,7 @@ ] }, "jobs.SparkPythonTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3315,7 +3430,7 @@ ] }, "jobs.SparkSubmitTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3333,7 +3448,7 @@ ] }, "jobs.SqlTask": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3374,7 +3489,7 @@ ] }, "jobs.SqlTaskAlert": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3403,7 +3518,7 @@ ] }, "jobs.SqlTaskDashboard": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3436,7 +3551,7 @@ ] }, "jobs.SqlTaskFile": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3461,7 +3576,7 @@ ] }, "jobs.SqlTaskQuery": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3482,7 +3597,7 @@ ] }, "jobs.SqlTaskSubscription": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3504,7 +3619,7 @@ ] }, "jobs.TableUpdateTriggerConfiguration": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3534,7 +3649,7 @@ ] }, "jobs.Task": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3666,7 +3781,7 @@ ] }, "jobs.TaskDependency": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3691,7 +3806,7 @@ ] }, "jobs.TaskEmailNotifications": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3729,7 +3844,7 @@ ] }, "jobs.TaskNotificationSettings": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3755,7 +3870,7 @@ ] }, "jobs.TriggerSettings": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3788,7 +3903,7 @@ ] }, "jobs.Webhook": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3808,7 +3923,7 @@ ] }, "jobs.WebhookNotifications": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3842,7 +3957,7 @@ ] }, "ml.ExperimentTag": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3864,7 +3979,7 @@ ] }, "ml.ModelTag": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3886,7 +4001,7 @@ ] }, "ml.ModelVersion": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3961,7 +4076,7 @@ ] }, "ml.ModelVersionTag": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -3983,7 +4098,7 @@ ] }, "pipelines.CronTrigger": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4010,7 +4125,7 @@ ] }, "pipelines.FileLibrary": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4028,7 +4143,7 @@ ] }, "pipelines.Filters": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4050,7 +4165,7 @@ ] }, "pipelines.IngestionConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4076,7 +4191,7 @@ ] }, "pipelines.IngestionGatewayPipelineDefinition": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4110,7 +4225,7 @@ ] }, "pipelines.IngestionPipelineDefinition": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4140,7 +4255,7 @@ ] }, "pipelines.ManualTrigger": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": false @@ -4152,7 +4267,7 @@ ] }, "pipelines.NotebookLibrary": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4170,7 +4285,7 @@ ] }, "pipelines.Notifications": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4192,7 +4307,7 @@ ] }, "pipelines.PipelineCluster": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4282,7 +4397,7 @@ ] }, "pipelines.PipelineClusterAutoscale": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4320,7 +4435,7 @@ ] }, "pipelines.PipelineDeployment": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4342,7 +4457,7 @@ ] }, "pipelines.PipelineLibrary": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4376,7 +4491,7 @@ ] }, "pipelines.PipelineTrigger": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4396,7 +4511,7 @@ ] }, "pipelines.ReportSpec": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4430,7 +4545,7 @@ ] }, "pipelines.RestartWindow": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4472,7 +4587,7 @@ ] }, "pipelines.SchemaSpec": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4506,7 +4621,7 @@ ] }, "pipelines.TableSpec": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4548,7 +4663,7 @@ ] }, "pipelines.TableSpecificConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4586,7 +4701,7 @@ ] }, "serving.Ai21LabsConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4606,7 +4721,7 @@ ] }, "serving.AiGatewayConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4636,7 +4751,7 @@ ] }, "serving.AiGatewayGuardrailParameters": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4666,7 +4781,7 @@ ] }, "serving.AiGatewayGuardrailPiiBehavior": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4695,7 +4810,7 @@ ] }, "serving.AiGatewayGuardrails": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4717,7 +4832,7 @@ ] }, "serving.AiGatewayInferenceTableConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4747,7 +4862,7 @@ ] }, "serving.AiGatewayRateLimit": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4792,7 +4907,7 @@ ] }, "serving.AiGatewayUsageTrackingConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4810,7 +4925,7 @@ ] }, "serving.AmazonBedrockConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4862,7 +4977,7 @@ ] }, "serving.AnthropicConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4884,7 +4999,7 @@ ] }, "serving.AutoCaptureConfigInput": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4914,7 +5029,7 @@ ] }, "serving.CohereConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4940,7 +5055,7 @@ ] }, "serving.DatabricksModelServingConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4969,7 +5084,7 @@ ] }, "serving.EndpointCoreConfigInput": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -4999,7 +5114,7 @@ ] }, "serving.EndpointTag": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5024,7 +5139,7 @@ ] }, "serving.ExternalModel": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5101,7 +5216,7 @@ ] }, "serving.GoogleCloudVertexAiConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5127,7 +5242,7 @@ ] }, "serving.OpenAiConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5174,7 +5289,7 @@ ] }, "serving.PaLmConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5194,7 +5309,7 @@ ] }, "serving.RateLimit": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5239,7 +5354,7 @@ ] }, "serving.Route": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5265,7 +5380,7 @@ ] }, "serving.ServedEntityInput": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5323,7 +5438,7 @@ ] }, "serving.ServedModelInput": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5402,7 +5517,7 @@ ] }, "serving.TrafficConfig": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -5424,7 +5539,7 @@ } }, "int": { - "anyOf": [ + "oneOf": [ { "type": "integer" }, @@ -5451,7 +5566,7 @@ ] }, "int64": { - "anyOf": [ + "oneOf": [ { "type": "integer" }, @@ -5485,7 +5600,7 @@ "bundle": { "config": { "resources.Cluster": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5499,7 +5614,7 @@ ] }, "resources.Dashboard": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5513,7 +5628,7 @@ ] }, "resources.Job": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5527,7 +5642,7 @@ ] }, "resources.MlflowExperiment": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5541,7 +5656,7 @@ ] }, "resources.MlflowModel": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5555,7 +5670,7 @@ ] }, "resources.ModelServingEndpoint": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5569,7 +5684,7 @@ ] }, "resources.Pipeline": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5583,7 +5698,7 @@ ] }, "resources.QualityMonitor": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5597,7 +5712,7 @@ ] }, "resources.RegisteredModel": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5611,7 +5726,7 @@ ] }, "resources.Schema": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5625,7 +5740,7 @@ ] }, "resources.Volume": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5639,7 +5754,7 @@ ] }, "variable.TargetVariable": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5653,7 +5768,7 @@ ] }, "variable.Variable": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5668,7 +5783,7 @@ } }, "config.Artifact": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5682,7 +5797,7 @@ ] }, "config.Command": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5696,7 +5811,7 @@ ] }, "config.Target": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5714,7 +5829,7 @@ } }, "string": { - "anyOf": [ + "oneOf": [ { "type": "object", "additionalProperties": { @@ -5735,7 +5850,7 @@ "bundle": { "config": { "resources.Grant": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5749,7 +5864,7 @@ ] }, "resources.Permission": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5764,7 +5879,7 @@ } }, "config.ArtifactFile": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5782,7 +5897,7 @@ "databricks-sdk-go": { "service": { "catalog.MonitorMetric": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5796,7 +5911,7 @@ ] }, "compute.InitScriptInfo": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5810,7 +5925,7 @@ ] }, "compute.Library": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5824,7 +5939,7 @@ ] }, "jobs.JobCluster": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5838,7 +5953,7 @@ ] }, "jobs.JobEnvironment": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5852,7 +5967,7 @@ ] }, "jobs.JobParameterDefinition": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5866,7 +5981,7 @@ ] }, "jobs.JobsHealthRule": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5880,7 +5995,7 @@ ] }, "jobs.SqlTaskSubscription": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5894,7 +6009,7 @@ ] }, "jobs.Task": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5908,7 +6023,7 @@ ] }, "jobs.TaskDependency": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5922,7 +6037,7 @@ ] }, "jobs.Webhook": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5936,7 +6051,7 @@ ] }, "ml.ExperimentTag": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5950,7 +6065,7 @@ ] }, "ml.ModelTag": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5964,7 +6079,7 @@ ] }, "ml.ModelVersion": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5978,7 +6093,7 @@ ] }, "ml.ModelVersionTag": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -5992,7 +6107,7 @@ ] }, "pipelines.IngestionConfig": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6006,7 +6121,7 @@ ] }, "pipelines.Notifications": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6020,7 +6135,7 @@ ] }, "pipelines.PipelineCluster": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6034,7 +6149,7 @@ ] }, "pipelines.PipelineLibrary": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6048,7 +6163,7 @@ ] }, "serving.AiGatewayRateLimit": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6062,7 +6177,7 @@ ] }, "serving.EndpointTag": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6076,7 +6191,7 @@ ] }, "serving.RateLimit": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6090,7 +6205,7 @@ ] }, "serving.Route": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6104,7 +6219,7 @@ ] }, "serving.ServedEntityInput": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6118,7 +6233,7 @@ ] }, "serving.ServedModelInput": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6136,7 +6251,7 @@ } }, "string": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -6157,39 +6272,57 @@ "type": "object", "properties": { "artifacts": { + "description": "Defines the attributes to build an artifact", "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config.Artifact" }, "bundle": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Bundle" + "description": "The attributes of the bundle.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Bundle", + "markdownDescription": "The attributes of the bundle. See [bundle](https://docs.databricks.com/dev-tools/bundles/settings.html#bundle)" }, "experimental": { + "description": "Defines attributes for experimental features.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Experimental" }, "include": { - "$ref": "#/$defs/slice/string" + "description": "Specifies a list of path globs that contain configuration files to include within the bundle.", + "$ref": "#/$defs/slice/string", + "markdownDescription": "Specifies a list of path globs that contain configuration files to include within the bundle. See [include](https://docs.databricks.com/dev-tools/bundles/settings.html#include)" }, "permissions": { - "$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config/resources.Permission" + "description": "Defines the permissions to apply to experiments, jobs, pipelines, and models defined in the bundle", + "$ref": "#/$defs/slice/github.com/databricks/cli/bundle/config/resources.Permission", + "markdownDescription": "Defines the permissions to apply to experiments, jobs, pipelines, and models defined in the bundle. See [permissions](https://docs.databricks.com/dev-tools/bundles/settings.html#permissions) and [link](https://docs.databricks.com/dev-tools/bundles/permissions.html)." }, "presets": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Presets" + "description": "Defines bundle deployment presets.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Presets", + "markdownDescription": "Defines bundle deployment presets. See [presets](https://docs.databricks.com/dev-tools/bundles/deployment-modes.html#presets)." }, "resources": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Resources" + "description": "Specifies information about the Databricks resources used by the bundle", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Resources", + "markdownDescription": "Specifies information about the Databricks resources used by the bundle. See [link](https://docs.databricks.com/dev-tools/bundles/resources.html)." }, "run_as": { + "description": "The identity to use to run the bundle.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/jobs.JobRunAs" }, "sync": { - "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Sync" + "description": "The files and file paths to include or exclude in the bundle.", + "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Sync", + "markdownDescription": "The files and file paths to include or exclude in the bundle. See [link](https://docs.databricks.com/dev-tools/bundles/)" }, "targets": { + "description": "Defines deployment targets for the bundle.", "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config.Target" }, "variables": { + "description": "A Map that defines the custom variables for the bundle, where each key is the name of the variable, and the value is a Map that defines the variable.", "$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/variable.Variable" }, "workspace": { + "description": "Defines the Databricks workspace for the bundle.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config.Workspace" } }, diff --git a/libs/jsonschema/extension.go b/libs/jsonschema/extension.go index 3e32caf1..9badf86a 100644 --- a/libs/jsonschema/extension.go +++ b/libs/jsonschema/extension.go @@ -34,4 +34,10 @@ type Extension struct { // Version of the schema. This is used to determine if the schema is // compatible with the current CLI version. Version *int `json:"version,omitempty"` + + // This field is not in JSON schema spec, but it is supported in VSCode and in the Databricks Workspace + // It is used to provide a rich description of the field in the hover tooltip. + // https://code.visualstudio.com/docs/languages/json#_use-rich-formatting-in-hovers + // Also it can be used in documentation generation. + MarkdownDescription string `json:"markdownDescription,omitempty"` } diff --git a/libs/jsonschema/schema.go b/libs/jsonschema/schema.go index b9c3fb08..e63dde35 100644 --- a/libs/jsonschema/schema.go +++ b/libs/jsonschema/schema.go @@ -69,6 +69,13 @@ type Schema struct { // Schema that must match any of the schemas in the array AnyOf []Schema `json:"anyOf,omitempty"` + + // Schema that must match one of the schemas in the array + OneOf []Schema `json:"oneOf,omitempty"` + + // Title of the object, rendered as inline documentation in the IDE. + // https://json-schema.org/understanding-json-schema/reference/annotations + Title string `json:"title,omitempty"` } // Default value defined in a JSON Schema, represented as a string.