diff --git a/.nextchanges/bundles/postgres-launch-stage.md b/.nextchanges/bundles/postgres-launch-stage.md new file mode 100644 index 00000000000..10f968cfb4d --- /dev/null +++ b/.nextchanges/bundles/postgres-launch-stage.md @@ -0,0 +1 @@ +* `postgres_*` bundle resources are no longer labelled `[Beta]` in the JSON schema and are now available in PyDABs. ([#7705](https://github.com/databricks/cli/pull/7705)) diff --git a/bundle/internal/annotation/preview.go b/bundle/internal/annotation/preview.go index 33392256e48..60fda2cf120 100644 --- a/bundle/internal/annotation/preview.go +++ b/bundle/internal/annotation/preview.go @@ -26,17 +26,7 @@ func PreviewTag(stage clijson.LaunchStage) string { // change cannot silently alter the resource's label. Keys are the // fully-qualified Go type paths (PkgPath + "." + Name), matching getPath in // bundle/internal/schema. -var launchStageOverrides = map[string]clijson.LaunchStage{ - "github.com/databricks/cli/bundle/config/resources.PostgresBranch": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresCatalog": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresDataApi": clijson.LaunchStagePrivatePreview, // The Data API is at Private Preview, below its siblings' Beta. - "github.com/databricks/cli/bundle/config/resources.PostgresDatabase": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresEndpoint": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresProject": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresRole": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresSnapshotSchedule": clijson.LaunchStagePublicBeta, - "github.com/databricks/cli/bundle/config/resources.PostgresSyncedTable": clijson.LaunchStagePublicBeta, -} +var launchStageOverrides = map[string]clijson.LaunchStage{} // OverrideLaunchStage raises a field's launch stage to the type's configured // override, unless the field's own stage is already more restrictive (see diff --git a/bundle/internal/annotation/preview_internal_test.go b/bundle/internal/annotation/preview_internal_test.go new file mode 100644 index 00000000000..f137d32bcd6 --- /dev/null +++ b/bundle/internal/annotation/preview_internal_test.go @@ -0,0 +1,35 @@ +package annotation + +import ( + "testing" + + "github.com/databricks/cli/internal/clijson" + "github.com/stretchr/testify/assert" +) + +// No resource is overridden at the moment, so the test installs its own +// override to keep the raising and more-restrictive paths covered. +func TestOverrideLaunchStage(t *testing.T) { + const overridden = "github.com/databricks/cli/bundle/config/resources.Job" + saved := launchStageOverrides + launchStageOverrides = map[string]clijson.LaunchStage{overridden: clijson.LaunchStagePublicBeta} + t.Cleanup(func() { launchStageOverrides = saved }) + + tests := []struct { + name string + typePath string + stage clijson.LaunchStage + want clijson.LaunchStage + }{ + {"GA field is raised to the override", overridden, "", clijson.LaunchStagePublicBeta}, + {"less-restrictive public-preview field is raised", overridden, clijson.LaunchStagePublicPreview, clijson.LaunchStagePublicBeta}, + {"Beta field is unchanged", overridden, clijson.LaunchStagePublicBeta, clijson.LaunchStagePublicBeta}, + {"more-restrictive private-preview field is kept", overridden, clijson.LaunchStagePrivatePreview, clijson.LaunchStagePrivatePreview}, + {"field of a type with no override is unchanged", "github.com/databricks/cli/bundle/config/resources.Pipeline", "", ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + assert.Equal(t, tc.want, OverrideLaunchStage(tc.typePath, tc.stage)) + }) + } +} diff --git a/bundle/internal/annotation/preview_test.go b/bundle/internal/annotation/preview_test.go index d4169af3c26..0f5f7b70387 100644 --- a/bundle/internal/annotation/preview_test.go +++ b/bundle/internal/annotation/preview_test.go @@ -37,24 +37,3 @@ func TestPreviewTagCoversAllStages(t *testing.T) { assert.NotEmpty(t, annotation.PreviewTag(stage), "stage %q has no preview tag", stage) } } - -func TestOverrideLaunchStage(t *testing.T) { - const overridden = "github.com/databricks/cli/bundle/config/resources.PostgresProject" - tests := []struct { - name string - typePath string - stage clijson.LaunchStage - want clijson.LaunchStage - }{ - {"GA field is raised to the override", overridden, "", clijson.LaunchStagePublicBeta}, - {"less-restrictive public-preview field is raised", overridden, clijson.LaunchStagePublicPreview, clijson.LaunchStagePublicBeta}, - {"Beta field is unchanged", overridden, clijson.LaunchStagePublicBeta, clijson.LaunchStagePublicBeta}, - {"more-restrictive private-preview field is kept", overridden, clijson.LaunchStagePrivatePreview, clijson.LaunchStagePrivatePreview}, - {"field of a type with no override is unchanged", "github.com/databricks/cli/bundle/config/resources.Job", "", ""}, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - assert.Equal(t, tc.want, annotation.OverrideLaunchStage(tc.typePath, tc.stage)) - }) - } -} diff --git a/bundle/internal/schema/parser_test.go b/bundle/internal/schema/parser_test.go index 9369e777177..691dd3721bb 100644 --- a/bundle/internal/schema/parser_test.go +++ b/bundle/internal/schema/parser_test.go @@ -2,12 +2,8 @@ package main import ( "reflect" - "strings" "testing" - "github.com/databricks/cli/bundle/config" - "github.com/databricks/cli/bundle/config/resources" - "github.com/databricks/cli/bundle/internal/annotation" "github.com/databricks/cli/internal/clijson" "github.com/databricks/databricks-sdk-go/service/postgres" "github.com/stretchr/testify/assert" @@ -71,100 +67,6 @@ func TestExtractAnnotationsNestedEmbeddedSDKType(t *testing.T) { assert.Equal(t, clijson.LaunchStagePublicBeta, got.LaunchStage) } -// TestPostgresResourcesHaveLaunchStageOverride asserts every Postgres resource -// type is pinned to its expected stage (Beta, or Private Preview for the Data -// API) via a launch-stage override, so an upstream stage change cannot silently -// alter its label (see annotation.OverrideLaunchStage). -// -// postgresResources is spelled out explicitly so the expected set is visible on -// the page, but it is also cross-checked against the Postgres resources actually -// declared on config.Resources: a new resource missing from this list fails the -// completeness check, which is the reminder to add it here AND to -// launchStageOverrides in bundle/internal/annotation/preview.go. -func TestPostgresResourcesHaveLaunchStageOverride(t *testing.T) { - postgresResources := map[reflect.Type]clijson.LaunchStage{ - reflect.TypeFor[resources.PostgresBranch](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresCatalog](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresDataApi](): clijson.LaunchStagePrivatePreview, - reflect.TypeFor[resources.PostgresDatabase](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresEndpoint](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresProject](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresRole](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresSnapshotSchedule](): clijson.LaunchStagePublicBeta, - reflect.TypeFor[resources.PostgresSyncedTable](): clijson.LaunchStagePublicBeta, - } - - // The list must cover every Postgres resource on config.Resources, so a - // newly added one can't slip through unpinned. - listed := make(map[reflect.Type]bool, len(postgresResources)) - for typ := range postgresResources { - listed[typ] = true - } - for _, f := range reflect.VisibleFields(reflect.TypeFor[config.Resources]()) { - if !strings.HasPrefix(f.Name, "Postgres") { - continue - } - // Each resource is a map[string]*resources.PostgresX; unwrap to the - // element struct the schema generator keys annotations by. - elem := f.Type.Elem() - for elem.Kind() == reflect.Pointer { - elem = elem.Elem() - } - assert.Truef(t, listed[elem], - "resource %s (%s) is not covered by this test; add it to postgresResources", f.Name, getPath(elem)) - } - - for typ, want := range postgresResources { - typePath := getPath(typ) - // A configured type returns its override for any input; an unconfigured - // one returns the input unchanged, so a GA input that survives as GA - // (rather than becoming Beta) means the override is missing. - stage := annotation.OverrideLaunchStage(typePath, clijson.LaunchStageGA) - assert.Equalf(t, want, stage, - "resource %s has no launch-stage override; add it to launchStageOverrides in bundle/internal/annotation/preview.go", typePath) - } -} - -// TestExtractAnnotationsOverridesLaunchStage feeds a GA launch stage for a real -// field of an overridden resource and asserts extractAnnotations rewrites it to -// the override, so an upstream stage change does not alter the label. -// auth_method is a field of postgres.RoleRoleSpec, embedded by -// resources.PostgresRole. -func TestExtractAnnotationsOverridesLaunchStage(t *testing.T) { - p := newParser(map[string]*clijson.SchemaJSON{ - "postgres.RoleRoleSpec": { - Fields: map[string]*clijson.SchemaFieldJSON{ - "auth_method": { - Description: "How the role authenticates.", - LaunchStage: "GA", - }, - }, - }, - }) - - annotations, err := p.extractAnnotations(reflect.TypeFor[resources.PostgresRole]()) - require.NoError(t, err) - - got := annotations[getPath(reflect.TypeFor[resources.PostgresRole]())].Fields["auth_method"] - assert.Equal(t, clijson.LaunchStagePublicBeta, got.LaunchStage) -} - -// TestExtractAnnotationsStampsTypeLaunchStage asserts a resource type in the -// override map carries the override stage on its own (self) descriptor, so the -// type-level x-databricks-launch-stage is emitted, not just its fields'. The -// contract carries no type-level stage, so the override map is the only source. -func TestExtractAnnotationsStampsTypeLaunchStage(t *testing.T) { - p := newParser(map[string]*clijson.SchemaJSON{ - "postgres.RoleRoleSpec": {Fields: map[string]*clijson.SchemaFieldJSON{}}, - }) - - annotations, err := p.extractAnnotations(reflect.TypeFor[resources.PostgresRole]()) - require.NoError(t, err) - - self := annotations[getPath(reflect.TypeFor[resources.PostgresRole]())].Self - assert.Equal(t, clijson.LaunchStagePublicBeta, self.LaunchStage) -} - func TestNormalizeLaunchStage(t *testing.T) { tests := []struct { input string diff --git a/bundle/schema/jsonschema.json b/bundle/schema/jsonschema.json index 2d5a35b5a5e..5fdd1b8aeb1 100644 --- a/bundle/schema/jsonschema.json +++ b/bundle/schema/jsonschema.json @@ -2519,30 +2519,29 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "branch_id": { "description": "The ID to use for the branch; becomes the final component of the branch's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `development` becomes `projects/my-app/branches/development`.", "$ref": "#/$defs/string" }, "expire_time": { - "description": "[Beta] Absolute expiration timestamp. When set, the branch will expire at this time.\nMutually exclusive with `ttl` and `no_expiry`.", + "description": "Absolute expiration timestamp. When set, the branch will expire at this time.\nMutually exclusive with `ttl` and `no_expiry`.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "is_protected": { - "description": "[Beta] When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected.", + "description": "When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.Lifecycle" }, "no_expiry": { - "description": "[Beta] Explicitly disable expiration. When set to true, the branch will not expire.\nIf set to false, the request is invalid; provide either ttl or expire_time instead.\nMutually exclusive with `expire_time` and `ttl`.", + "description": "Explicitly disable expiration. When set to true, the branch will not expire.\nIf set to false, the request is invalid; provide either ttl or expire_time instead.\nMutually exclusive with `expire_time` and `ttl`.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "parent": { "description": "The project containing this branch (API resource hierarchy). Format: projects/{project_id}\n\nThis field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see `source_branch`.", @@ -2557,37 +2556,36 @@ "$ref": "#/$defs/bool" }, "source_branch": { - "description": "[Beta] The name of the source branch from which this branch was created (data lineage for point-in-time recovery).\nIf not specified, defaults to the project's default branch.\nFormat: projects/{project_id}/branches/{branch_id}", + "description": "The name of the source branch from which this branch was created (data lineage for point-in-time recovery).\nIf not specified, defaults to the project's default branch.\nFormat: projects/{project_id}/branches/{branch_id}", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "source_branch_lsn": { - "description": "[Beta] The Log Sequence Number (LSN) on the source branch from which this branch was created.", + "description": "The Log Sequence Number (LSN) on the source branch from which this branch was created.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "source_branch_time": { - "description": "[Beta] The point in time on the source branch from which this branch was created.", + "description": "The point in time on the source branch from which this branch was created.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/time.Time", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "source_snapshot": { - "description": "[Beta] The snapshot this branch was created from. When set, the branch's data\ncomes from the snapshot rather than a source branch, so source_branch,\nsource_branch_lsn, and source_branch_time must be empty. The snapshot must\nbe AVAILABLE and belong to this branch's project.\nFormat: projects/{project_id}/snapshots/{snapshot_id}", + "description": "The snapshot this branch was created from. When set, the branch's data\ncomes from the snapshot rather than a source branch, so source_branch,\nsource_branch_lsn, and source_branch_time must be empty. The snapshot must\nbe AVAILABLE and belong to this branch's project.\nFormat: projects/{project_id}/snapshots/{snapshot_id}", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "ttl": { - "description": "[Beta] Relative time-to-live duration. When set, the branch will expire at creation_time + ttl.\nMutually exclusive with `expire_time` and `no_expiry`.", + "description": "Relative time-to-live duration. When set, the branch will expire at creation_time + ttl.\nMutually exclusive with `expire_time` and `no_expiry`.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, "required": [ "branch_id", "parent" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -2599,38 +2597,37 @@ "oneOf": [ { "type": "object", - "description": "[Beta] The desired state of the Catalog.", + "description": "The desired state of the Catalog.", "properties": { "branch": { - "description": "[Beta] The resource path of the branch that holds the Postgres database. The branch must have a\nread-write compute endpoint.\n\nFormat: projects/{project_id}/branches/{branch_id}.", + "description": "The resource path of the branch that holds the Postgres database. The branch must have a\nread-write compute endpoint.\n\nFormat: projects/{project_id}/branches/{branch_id}.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "catalog_id": { "description": "The ID of the catalog in Unity Catalog; becomes the full resource name. For example, `my_catalog` becomes `catalogs/my_catalog`.", "$ref": "#/$defs/string" }, "create_database_if_missing": { - "description": "[Beta] If set to true, the specified postgres_database is created on behalf of the calling user\nif it does not already exist. In this case, the calling user has a role created for\nthem in Postgres if they do not already have one.\n\nDefaults to false, meaning that the request fails if the specified postgres_database does not already exist.", + "description": "If set to true, the specified postgres_database is created on behalf of the calling user\nif it does not already exist. In this case, the calling user has a role created for\nthem in Postgres if they do not already have one.\n\nDefaults to false, meaning that the request fails if the specified postgres_database does not already exist.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.Lifecycle" }, "postgres_database": { - "description": "[Beta] The name of the Postgres database inside the specified Lakebase project and branch to be associated with the UC catalog.\nThis database must already exist, unless create_database_if_missing is set to true on creation.\nThe system databases postgres, databricks_system, template0 and template1 cannot be registered.\n\nA database can only be registered with one UC catalog at a time.\nTo re-register a database with a different catalog, the existing catalog must be deleted first.\n\nA child branch inherits the fact of parent's registration. This means the same-named database\nin a child branch cannot be registered with a second catalog\nwhile the parent's registration exists. To allow registering the database of a child branch,\ndrop and recreate the database on the child branch.\nThis removes the fact of parent's registration from this branch only.\n\nDoing Point In Time Restore (PITR) prior to the moment before the Postgres DB was registered\nin the Catalog drops the fact of registration of the database. So the user should avoid doing so.", + "description": "The name of the Postgres database inside the specified Lakebase project and branch to be associated with the UC catalog.\nThis database must already exist, unless create_database_if_missing is set to true on creation.\nThe system databases postgres, databricks_system, template0 and template1 cannot be registered.\n\nA database can only be registered with one UC catalog at a time.\nTo re-register a database with a different catalog, the existing catalog must be deleted first.\n\nA child branch inherits the fact of parent's registration. This means the same-named database\nin a child branch cannot be registered with a second catalog\nwhile the parent's registration exists. To allow registering the database of a child branch,\ndrop and recreate the database on the child branch.\nThis removes the fact of parent's registration from this branch only.\n\nDoing Point In Time Restore (PITR) prior to the moment before the Postgres DB was registered\nin the Catalog drops the fact of registration of the database. So the user should avoid doing so.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, "required": [ "catalog_id", "postgres_database" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -2642,7 +2639,7 @@ "oneOf": [ { "type": "object", - "description": "[Private Preview] The Data API (a PostgREST-compatible REST interface) of a Postgres database on a Lakebase Autoscaling branch. A database has at most one Data API. At least one setting besides `parent` is required, such as `db_schemas`. Its serving URL is available as `status.url`; reference it as `${resources.postgres_data_apis.\u003ckey\u003e.status.url}`. Durations use the protobuf seconds format, such as `300s`.", + "description": "The Data API (a PostgREST-compatible REST interface) of a Postgres database on a Lakebase Autoscaling branch. A database has at most one Data API. At least one setting besides `parent` is required, such as `db_schemas`. Its serving URL is available as `status.url`; reference it as `${resources.postgres_data_apis.\u003ckey\u003e.status.url}`. Durations use the protobuf seconds format, such as `300s`.", "properties": { "db_aggregates_enabled": { "description": "[Private Preview] Enable aggregate functions (count, sum, avg, etc.) in Data API responses.\nDefault: true.", @@ -2710,9 +2707,7 @@ "additionalProperties": false, "required": [ "parent" - ], - "x-databricks-launch-stage": "PRIVATE_PREVIEW", - "doNotSuggest": true + ] }, { "type": "string", @@ -2724,7 +2719,6 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "database_id": { "description": "The ID to use for the database; becomes the final component of the database's resource name and the database name in Postgres. Must be 4-63 characters and use only characters available in DNS names, as defined by RFC 1123. If not specified, it is generated automatically.", @@ -2739,18 +2733,18 @@ "$ref": "#/$defs/string" }, "postgres_database": { - "description": "[Beta] The name of the Postgres database.\n\nThis expects a valid Postgres identifier as specified in the link below.\nhttps://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS\nRequired when creating the Database.\n\nTo rename, pass a valid postgres identifier when updating the Database.", + "description": "The name of the Postgres database.\n\nThis expects a valid Postgres identifier as specified in the link below.\nhttps://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS\nRequired when creating the Database.\n\nTo rename, pass a valid postgres identifier when updating the Database.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "replace_existing": { "description": "When true, take over an existing database with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a database that already exists on the branch under bundle management. Only takes effect when the database is created.", "$ref": "#/$defs/bool" }, "role": { - "description": "[Beta] The name of the role that owns the database.\nFormat: projects/{project_id}/branches/{branch_id}/roles/{role_id}\n\nTo change the owner, pass valid existing Role name when updating the Database\n\nRequired when creating the Database.", + "description": "The name of the role that owns the database.\nFormat: projects/{project_id}/branches/{branch_id}/roles/{role_id}\n\nTo change the owner, pass valid existing Role name when updating the Database\n\nRequired when creating the Database.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2758,8 +2752,7 @@ "database_id", "parent", "role" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -2771,45 +2764,44 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "autoscaling_limit_max_cu": { - "description": "[Beta] The maximum number of Compute Units. The maximum value is 64.\nThe difference between the minimum and maximum Compute Units (max - min) must not exceed 16.\nSet it equal to `autoscaling_limit_min_cu` for a fixed-size compute. When omitted at creation, the\nproject's default endpoint settings apply.", + "description": "The maximum number of Compute Units. The maximum value is 64.\nThe difference between the minimum and maximum Compute Units (max - min) must not exceed 16.\nSet it equal to `autoscaling_limit_min_cu` for a fixed-size compute. When omitted at creation, the\nproject's default endpoint settings apply.", "$ref": "#/$defs/float64", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "autoscaling_limit_min_cu": { - "description": "[Beta] The minimum number of Compute Units. Minimum value is 0.5, and it must not exceed\n`autoscaling_limit_max_cu`. When omitted at creation, the project's default endpoint settings apply.", + "description": "The minimum number of Compute Units. Minimum value is 0.5, and it must not exceed\n`autoscaling_limit_max_cu`. When omitted at creation, the project's default endpoint settings apply.", "$ref": "#/$defs/float64", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "disabled": { - "description": "[Beta] Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. To accept connections again, set this field back to false.", + "description": "Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. To accept connections again, set this field back to false.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "endpoint_id": { "description": "The ID to use for the endpoint; becomes the final component of the endpoint's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `primary` becomes `projects/my-app/branches/development/endpoints/primary`.", "$ref": "#/$defs/string" }, "endpoint_type": { - "description": "[Beta] The endpoint type. A branch can only have one READ_WRITE endpoint.", + "description": "The endpoint type. A branch can only have one READ_WRITE endpoint.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointType", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "group": { - "description": "[Beta] Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults\nto non HA settings, with a single compute backing the endpoint (and no readable secondaries\nfor Read/Write endpoints). Automatic suspension is not available for an endpoint with more than one\ncompute, so set `no_suspension` to true when configuring one.", + "description": "Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults\nto non HA settings, with a single compute backing the endpoint (and no readable secondaries\nfor Read/Write endpoints). Automatic suspension is not available for an endpoint with more than one\ncompute, so set `no_suspension` to true when configuring one.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointGroupSpec", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.Lifecycle" }, "no_suspension": { - "description": "[Beta] When set to true, explicitly disables automatic suspension (never suspend).\nThe value must be true when provided.\nMutually exclusive with `suspend_timeout_duration`.", + "description": "When set to true, explicitly disables automatic suspension (never suspend).\nThe value must be true when provided.\nMutually exclusive with `suspend_timeout_duration`.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "parent": { "description": "The branch containing this endpoint (API resource hierarchy). Format: projects/{project_id}/branches/{branch_id}", @@ -2820,14 +2812,14 @@ "$ref": "#/$defs/bool" }, "settings": { - "description": "[Beta] Postgres server parameters for the compute endpoint. On update, an empty `pg_settings` map leaves\nthe current parameters unchanged.", + "description": "Postgres server parameters for the compute endpoint. On update, an empty `pg_settings` map leaves\nthe current parameters unchanged.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.EndpointSettings", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "suspend_timeout_duration": { - "description": "[Beta] Duration of inactivity after which the compute endpoint is automatically suspended.\nIf specified, the value must be between 60s and 604800s (1 minute to 1 week). A suspended endpoint\nkeeps its hostnames and configuration, and the next connection attempt restarts it. When neither\nthis field nor `no_suspension` is set at creation, the project's default endpoint settings apply.\nMutually exclusive with `no_suspension`.", + "description": "Duration of inactivity after which the compute endpoint is automatically suspended.\nIf specified, the value must be between 60s and 604800s (1 minute to 1 week). A suspended endpoint\nkeeps its hostnames and configuration, and the next connection attempt restarts it. When neither\nthis field nor `no_suspension` is set at creation, the project's default endpoint settings apply.\nMutually exclusive with `no_suspension`.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, @@ -2835,8 +2827,7 @@ "endpoint_id", "parent", "endpoint_type" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -2848,42 +2839,41 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "budget_policy_id": { - "description": "[Beta] The desired budget policy to associate with the project.\nSee status.budget_policy_id for the policy that is actually applied to the project.", + "description": "The desired budget policy to associate with the project.\nSee status.budget_policy_id for the policy that is actually applied to the project.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "custom_tags": { - "description": "[Beta] Custom tags to associate with the project, used for billing and cost tracking.\nTo update tags, provide the new tag list and include \"spec.custom_tags\" in the update_mask.\nTo clear all tags, provide an empty list and include \"spec.custom_tags\" in the update_mask.\nTo preserve existing tags, omit this field from the update_mask (or use wildcard \"*\" which auto-excludes empty tags).", + "description": "Custom tags to associate with the project, used for billing and cost tracking.\nTo update tags, provide the new tag list and include \"spec.custom_tags\" in the update_mask.\nTo clear all tags, provide an empty list and include \"spec.custom_tags\" in the update_mask.\nTo preserve existing tags, omit this field from the update_mask (or use wildcard \"*\" which auto-excludes empty tags).", "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.ProjectCustomTag", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "default_branch": { - "description": "[Beta] The full resource path of the default branch of the project.\nFormat: projects/{project_id}/branches/{branch_id}\nAt creation time, the branch ID in this path names the initial branch, which is called\n`production` when the field is omitted. On update, the path must name an existing branch of this\nproject, which then becomes the default branch.", + "description": "The full resource path of the default branch of the project.\nFormat: projects/{project_id}/branches/{branch_id}\nAt creation time, the branch ID in this path names the initial branch, which is called\n`production` when the field is omitted. On update, the path must name an existing branch of this\nproject, which then becomes the default branch.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "default_endpoint_settings": { - "description": "[Beta] Settings applied by default to compute endpoints created in this project. The initial endpoint\nalso takes these values for any setting that initial_endpoint_spec does not provide.", + "description": "Settings applied by default to compute endpoints created in this project. The initial endpoint\nalso takes these values for any setting that initial_endpoint_spec does not provide.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.ProjectDefaultEndpointSettings", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "display_name": { - "description": "[Beta] Human-readable project name. Length should be between 1 and 256 characters.", + "description": "Human-readable project name. Length should be between 1 and 256 characters.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "enable_pg_native_login": { - "description": "[Beta] Whether to enable PG native password login on all endpoints in this project. Defaults to false.", + "description": "Whether to enable PG native password login on all endpoints in this project. Defaults to false.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "history_retention_duration": { - "description": "[Beta] The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days).\nDefaults to 604800s (7 days) when omitted.", + "description": "The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days).\nDefaults to 604800s (7 days) when omitted.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/common/types/duration.Duration", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", @@ -2895,9 +2885,9 @@ "markdownDescription": "A Sequence of permissions to apply to this resource, where each item grants a permission `level` to a single `user_name`, `group_name`, or `service_principal_name`. For the same principal, resource permissions take precedence over top-level or target permissions.\n\nSee [permissions](https://docs.databricks.com/dev-tools/bundles/settings.html#permissions) and [link](https://docs.databricks.com/dev-tools/bundles/permissions.html)." }, "pg_version": { - "description": "[Beta] The major Postgres version number. Defaults to 17 when omitted. The set of versions that new\nprojects can use may change over time.", + "description": "The major Postgres version number. Defaults to 17 when omitted. The set of versions that new\nprojects can use may change over time.", "$ref": "#/$defs/int", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "project_id": { "description": "The ID to use for the project; becomes the final component of the project's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `my-app` becomes `projects/my-app`.", @@ -2911,8 +2901,7 @@ "additionalProperties": false, "required": [ "project_id" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -2924,40 +2913,39 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "attributes": { - "description": "[Beta] The desired API-exposed Postgres role attributes to associate with the role.", + "description": "The desired API-exposed Postgres role attributes to associate with the role.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleAttributes", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "auth_method": { - "description": "[Beta] How the role is authenticated when connecting to Postgres. If left unspecified, a meaningful authentication method is derived from the identity_type.", + "description": "How the role is authenticated when connecting to Postgres. If left unspecified, a meaningful authentication method is derived from the identity_type.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleAuthMethod", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "identity_type": { - "description": "[Beta] The type of the Databricks managed identity that this Role represents. Leave empty to create a regular Postgres role not associated with a Databricks identity.", + "description": "The type of the Databricks managed identity that this Role represents. Leave empty to create a regular Postgres role not associated with a Databricks identity.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.RoleIdentityType", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "lifecycle": { "description": "Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.", "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.Lifecycle" }, "membership_roles": { - "description": "[Beta] Standard roles that this role is a member of.", + "description": "Standard roles that this role is a member of.", "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.RoleMembershipRole", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "parent": { "description": "The branch where this role is created. Format projects/{project_id}/branches/{branch_id}.", "$ref": "#/$defs/string" }, "postgres_role": { - "description": "[Beta] The name of the Postgres role. Required when creating the role.", + "description": "The name of the Postgres role. Required when creating the role.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "replace_existing": { "description": "When true, take over an existing role with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a role that already exists on the branch (for example, one inherited from the parent branch) under bundle management. Only takes effect when the role is created.", @@ -2972,8 +2960,7 @@ "required": [ "role_id", "parent" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -2985,7 +2972,6 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "branch": { "description": "The branch whose automatic-snapshot schedule this manages. Format: projects/{project_id}/branches/{branch_id}", @@ -3003,8 +2989,7 @@ "additionalProperties": false, "required": [ "branch" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", @@ -3016,7 +3001,6 @@ "oneOf": [ { "type": "object", - "description": "[Beta]", "properties": { "accelerated_sync": { "description": "[Private Preview] When true, enables accelerated sync mode for the initial data load.\nThis significantly improves performance for large tables.\nRequires workspace-level enablement through Lakebase Accelerated Sync preview.", @@ -3025,19 +3009,19 @@ "doNotSuggest": true }, "branch": { - "description": "[Beta] The full resource name the branch associated with the table.\n\nFormat: \"projects/{project_id}/branches/{branch_id}\".", + "description": "The full resource name the branch associated with the table.\n\nFormat: \"projects/{project_id}/branches/{branch_id}\".", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "create_database_objects_if_missing": { - "description": "[Beta] If true, the synced table's logical database and schema resources in PG\nwill be created if they do not already exist.\nThe request will fail if this is false and the database/schema do not exist.\n\nDefaults to true if omitted.", + "description": "If true, the synced table's logical database and schema resources in PG\nwill be created if they do not already exist.\nThe request will fail if this is false and the database/schema do not exist.\n\nDefaults to true if omitted.", "$ref": "#/$defs/bool", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "existing_pipeline_id": { - "description": "[Beta] ID of an existing pipeline to bin-pack this synced table into.\nAt most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nThe pipeline used for the synced table is returned via the top level pipeline_id attribute.", + "description": "ID of an existing pipeline to bin-pack this synced table into.\nAt most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nThe pipeline used for the synced table is returned via the top level pipeline_id attribute.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "extra_columns": { "description": "[Private Preview] Extra PostgreSQL-only columns to add to the synced table.", @@ -3050,50 +3034,49 @@ "$ref": "#/$defs/github.com/databricks/cli/bundle/config/resources.Lifecycle" }, "new_pipeline_spec": { - "description": "[Beta] Specification for creating a new pipeline.\nAt most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nThe pipeline used for the synced table is returned via the top level pipeline_id attribute.", + "description": "Specification for creating a new pipeline.\nAt most one of existing_pipeline_id and new_pipeline_spec should be defined.\n\nThe pipeline used for the synced table is returned via the top level pipeline_id attribute.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.NewPipelineSpec", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "postgres_database": { - "description": "[Beta] The Postgres database name where the synced table will be created in.\n\nIf this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred\nfrom the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match.\n\nA value must be specified when creating a synced table inside a Standard Catalog.", + "description": "The Postgres database name where the synced table will be created in.\n\nIf this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred\nfrom the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match.\n\nA value must be specified when creating a synced table inside a Standard Catalog.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "primary_key_columns": { - "description": "[Beta] Primary Key columns to be used for data insert/update in the destination.", + "description": "Primary Key columns to be used for data insert/update in the destination.", "$ref": "#/$defs/slice/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "scheduling_policy": { - "description": "[Beta] Scheduling policy of the underlying pipeline.", + "description": "Scheduling policy of the underlying pipeline.", "$ref": "#/$defs/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "source_table_full_name": { - "description": "[Beta] Three-part (catalog, schema, table) name of the source Delta table.\n\nFor the corresponding destination table, use any of the two:\n\n* synced_table_id used at the creation of the SyncedTable\n* \"name\" consisting of \"synced_tables/\" prefix and the full name of the destination table.", + "description": "Three-part (catalog, schema, table) name of the source Delta table.\n\nFor the corresponding destination table, use any of the two:\n\n* synced_table_id used at the creation of the SyncedTable\n* \"name\" consisting of \"synced_tables/\" prefix and the full name of the destination table.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "synced_table_id": { "description": "The ID to use for the synced table; becomes the final component of the synced table's resource name. It is the synced table name, a `{catalog}.{schema}.{table}` tuple of Unity Catalog entity names.\n\nIt names both an online view in Unity Catalog, accessible through Lakehouse Federation, and a Postgres table named `{table}` in schema `{schema}` in the connected Postgres database.", "$ref": "#/$defs/string" }, "timeseries_key": { - "description": "[Beta] Time series key to deduplicate (tie-break) rows with the same primary key.", + "description": "Time series key to deduplicate (tie-break) rows with the same primary key.", "$ref": "#/$defs/string", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" }, "type_overrides": { - "description": "[Beta] Override the default Delta-\u003ePG type mapping for specific columns.\nA TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set.", + "description": "Override the default Delta-\u003ePG type mapping for specific columns.\nA TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set.", "$ref": "#/$defs/slice/github.com/databricks/databricks-sdk-go/service/postgres.SyncedTableSyncedTableSpecTypeOverride", - "x-databricks-launch-stage": "PUBLIC_BETA" + "x-databricks-launch-stage": "GA" } }, "additionalProperties": false, "required": [ "synced_table_id" - ], - "x-databricks-launch-stage": "PUBLIC_BETA" + ] }, { "type": "string", diff --git a/python/databricks/bundles/core/__init__.py b/python/databricks/bundles/core/__init__.py index cee232d1704..7e3cddda010 100644 --- a/python/databricks/bundles/core/__init__.py +++ b/python/databricks/bundles/core/__init__.py @@ -42,6 +42,15 @@ "model_service_mutator", "model_serving_endpoint_mutator", "pipeline_mutator", + "postgres_branch_mutator", + "postgres_catalog_mutator", + "postgres_data_api_mutator", + "postgres_database_mutator", + "postgres_endpoint_mutator", + "postgres_project_mutator", + "postgres_role_mutator", + "postgres_snapshot_schedule_mutator", + "postgres_synced_table_mutator", "quality_monitor_mutator", "registered_model_mutator", "schema_mutator", @@ -86,6 +95,15 @@ model_service_mutator, model_serving_endpoint_mutator, pipeline_mutator, + postgres_branch_mutator, + postgres_catalog_mutator, + postgres_data_api_mutator, + postgres_database_mutator, + postgres_endpoint_mutator, + postgres_project_mutator, + postgres_role_mutator, + postgres_snapshot_schedule_mutator, + postgres_synced_table_mutator, quality_monitor_mutator, registered_model_mutator, schema_mutator, diff --git a/python/databricks/bundles/core/_generated/__init__.py b/python/databricks/bundles/core/_generated/__init__.py index 7533a36dda3..727345148d0 100644 --- a/python/databricks/bundles/core/_generated/__init__.py +++ b/python/databricks/bundles/core/_generated/__init__.py @@ -89,6 +89,42 @@ _PipelineResources, pipeline_mutator, ) +from databricks.bundles.core._generated.postgres_branches import ( + _PostgresBranchResources, + postgres_branch_mutator, +) +from databricks.bundles.core._generated.postgres_catalogs import ( + _PostgresCatalogResources, + postgres_catalog_mutator, +) +from databricks.bundles.core._generated.postgres_data_apis import ( + _PostgresDataApiResources, + postgres_data_api_mutator, +) +from databricks.bundles.core._generated.postgres_databases import ( + _PostgresDatabaseResources, + postgres_database_mutator, +) +from databricks.bundles.core._generated.postgres_endpoints import ( + _PostgresEndpointResources, + postgres_endpoint_mutator, +) +from databricks.bundles.core._generated.postgres_projects import ( + _PostgresProjectResources, + postgres_project_mutator, +) +from databricks.bundles.core._generated.postgres_roles import ( + _PostgresRoleResources, + postgres_role_mutator, +) +from databricks.bundles.core._generated.postgres_snapshot_schedules import ( + _PostgresSnapshotScheduleResources, + postgres_snapshot_schedule_mutator, +) +from databricks.bundles.core._generated.postgres_synced_tables import ( + _PostgresSyncedTableResources, + postgres_synced_table_mutator, +) from databricks.bundles.core._generated.quality_monitors import ( _QualityMonitorResources, quality_monitor_mutator, @@ -151,6 +187,15 @@ "model_service_mutator", "model_serving_endpoint_mutator", "pipeline_mutator", + "postgres_branch_mutator", + "postgres_catalog_mutator", + "postgres_data_api_mutator", + "postgres_database_mutator", + "postgres_endpoint_mutator", + "postgres_project_mutator", + "postgres_role_mutator", + "postgres_snapshot_schedule_mutator", + "postgres_synced_table_mutator", "quality_monitor_mutator", "registered_model_mutator", "schema_mutator", @@ -189,6 +234,15 @@ class _GeneratedResources( _ModelServingEndpointResources, _MlflowModelResources, _PipelineResources, + _PostgresBranchResources, + _PostgresCatalogResources, + _PostgresDataApiResources, + _PostgresDatabaseResources, + _PostgresEndpointResources, + _PostgresProjectResources, + _PostgresRoleResources, + _PostgresSnapshotScheduleResources, + _PostgresSyncedTableResources, _QualityMonitorResources, _RegisteredModelResources, _SchemaResources, @@ -229,6 +283,15 @@ def _all_resource_types() -> "tuple[_ResourceType, ...]": model_serving_endpoints, models, pipelines, + postgres_branches, + postgres_catalogs, + postgres_data_apis, + postgres_databases, + postgres_endpoints, + postgres_projects, + postgres_roles, + postgres_snapshot_schedules, + postgres_synced_tables, quality_monitors, registered_models, schemas, @@ -266,6 +329,15 @@ def _all_resource_types() -> "tuple[_ResourceType, ...]": model_serving_endpoints._resource_type(), models._resource_type(), pipelines._resource_type(), + postgres_branches._resource_type(), + postgres_catalogs._resource_type(), + postgres_data_apis._resource_type(), + postgres_databases._resource_type(), + postgres_endpoints._resource_type(), + postgres_projects._resource_type(), + postgres_roles._resource_type(), + postgres_snapshot_schedules._resource_type(), + postgres_synced_tables._resource_type(), quality_monitors._resource_type(), registered_models._resource_type(), schemas._resource_type(), diff --git a/python/databricks/bundles/core/_generated/postgres_branches.py b/python/databricks/bundles/core/_generated/postgres_branches.py new file mode 100644 index 00000000000..c82e6fe0a0a --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_branches.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_branches._models.postgres_branch import ( + PostgresBranch, + PostgresBranchParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_branches._models.postgres_branch import ( + PostgresBranch, + ) + + return _ResourceType( + resource_type=PostgresBranch, + singular_name="postgres_branch", + plural_name="postgres_branches", + ) + + +class _PostgresBranchResources: + """ + Generated postgres_branch accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_branches(self) -> dict[str, "PostgresBranch"]: + return self._resources["postgres_branches"] + + def add_postgres_branch( + self, + resource_name: str, + postgres_branch: "PostgresBranchParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_branch to the collection of resources. Resource name must be unique across all postgres_branches. + + :param resource_name: unique identifier for the postgres_branch + :param postgres_branch: the postgres_branch to add, can be PostgresBranch or dict + :param location: optional location of the postgres_branch in the source code + """ + from databricks.bundles.postgres_branches._models.postgres_branch import ( + PostgresBranch, + ) + + postgres_branch = _transform(PostgresBranch, postgres_branch) + path = ("resources", "postgres_branches", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_branches"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_branch'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_branches"][resource_name] = postgres_branch + + +@overload +def postgres_branch_mutator( + function: Callable[[Bundle, "PostgresBranch"], "PostgresBranch"], +) -> ResourceMutator["PostgresBranch"]: ... + + +@overload +def postgres_branch_mutator( + function: Callable[["PostgresBranch"], "PostgresBranch"], +) -> ResourceMutator["PostgresBranch"]: ... + + +def postgres_branch_mutator(function: Callable) -> ResourceMutator["PostgresBranch"]: + """ + Decorator for defining mutator for postgres_branches. Function should return a new instance of the postgres_branch + with the desired changes, instead of mutating the input postgres_branch. + + Example: + + .. code-block:: python + + @postgres_branch_mutator + def my_postgres_branch_mutator(bundle: Bundle, postgres_branch: PostgresBranch) -> PostgresBranch: + return replace(postgres_branch, ...) + + :param function: Function that mutates postgres_branches. + """ + from databricks.bundles.postgres_branches._models.postgres_branch import ( + PostgresBranch, + ) + + return ResourceMutator(resource_type=PostgresBranch, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_catalogs.py b/python/databricks/bundles/core/_generated/postgres_catalogs.py new file mode 100644 index 00000000000..1a7d7d8f60e --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_catalogs.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_catalogs._models.postgres_catalog import ( + PostgresCatalog, + PostgresCatalogParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_catalogs._models.postgres_catalog import ( + PostgresCatalog, + ) + + return _ResourceType( + resource_type=PostgresCatalog, + singular_name="postgres_catalog", + plural_name="postgres_catalogs", + ) + + +class _PostgresCatalogResources: + """ + Generated postgres_catalog accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_catalogs(self) -> dict[str, "PostgresCatalog"]: + return self._resources["postgres_catalogs"] + + def add_postgres_catalog( + self, + resource_name: str, + postgres_catalog: "PostgresCatalogParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_catalog to the collection of resources. Resource name must be unique across all postgres_catalogs. + + :param resource_name: unique identifier for the postgres_catalog + :param postgres_catalog: the postgres_catalog to add, can be PostgresCatalog or dict + :param location: optional location of the postgres_catalog in the source code + """ + from databricks.bundles.postgres_catalogs._models.postgres_catalog import ( + PostgresCatalog, + ) + + postgres_catalog = _transform(PostgresCatalog, postgres_catalog) + path = ("resources", "postgres_catalogs", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_catalogs"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_catalog'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_catalogs"][resource_name] = postgres_catalog + + +@overload +def postgres_catalog_mutator( + function: Callable[[Bundle, "PostgresCatalog"], "PostgresCatalog"], +) -> ResourceMutator["PostgresCatalog"]: ... + + +@overload +def postgres_catalog_mutator( + function: Callable[["PostgresCatalog"], "PostgresCatalog"], +) -> ResourceMutator["PostgresCatalog"]: ... + + +def postgres_catalog_mutator(function: Callable) -> ResourceMutator["PostgresCatalog"]: + """ + Decorator for defining mutator for postgres_catalogs. Function should return a new instance of the postgres_catalog + with the desired changes, instead of mutating the input postgres_catalog. + + Example: + + .. code-block:: python + + @postgres_catalog_mutator + def my_postgres_catalog_mutator(bundle: Bundle, postgres_catalog: PostgresCatalog) -> PostgresCatalog: + return replace(postgres_catalog, ...) + + :param function: Function that mutates postgres_catalogs. + """ + from databricks.bundles.postgres_catalogs._models.postgres_catalog import ( + PostgresCatalog, + ) + + return ResourceMutator(resource_type=PostgresCatalog, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_data_apis.py b/python/databricks/bundles/core/_generated/postgres_data_apis.py new file mode 100644 index 00000000000..ef5e22a2f37 --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_data_apis.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_data_apis._models.postgres_data_api import ( + PostgresDataApi, + PostgresDataApiParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_data_apis._models.postgres_data_api import ( + PostgresDataApi, + ) + + return _ResourceType( + resource_type=PostgresDataApi, + singular_name="postgres_data_api", + plural_name="postgres_data_apis", + ) + + +class _PostgresDataApiResources: + """ + Generated postgres_data_api accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_data_apis(self) -> dict[str, "PostgresDataApi"]: + return self._resources["postgres_data_apis"] + + def add_postgres_data_api( + self, + resource_name: str, + postgres_data_api: "PostgresDataApiParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_data_api to the collection of resources. Resource name must be unique across all postgres_data_apis. + + :param resource_name: unique identifier for the postgres_data_api + :param postgres_data_api: the postgres_data_api to add, can be PostgresDataApi or dict + :param location: optional location of the postgres_data_api in the source code + """ + from databricks.bundles.postgres_data_apis._models.postgres_data_api import ( + PostgresDataApi, + ) + + postgres_data_api = _transform(PostgresDataApi, postgres_data_api) + path = ("resources", "postgres_data_apis", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_data_apis"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_data_api'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_data_apis"][resource_name] = postgres_data_api + + +@overload +def postgres_data_api_mutator( + function: Callable[[Bundle, "PostgresDataApi"], "PostgresDataApi"], +) -> ResourceMutator["PostgresDataApi"]: ... + + +@overload +def postgres_data_api_mutator( + function: Callable[["PostgresDataApi"], "PostgresDataApi"], +) -> ResourceMutator["PostgresDataApi"]: ... + + +def postgres_data_api_mutator(function: Callable) -> ResourceMutator["PostgresDataApi"]: + """ + Decorator for defining mutator for postgres_data_apis. Function should return a new instance of the postgres_data_api + with the desired changes, instead of mutating the input postgres_data_api. + + Example: + + .. code-block:: python + + @postgres_data_api_mutator + def my_postgres_data_api_mutator(bundle: Bundle, postgres_data_api: PostgresDataApi) -> PostgresDataApi: + return replace(postgres_data_api, ...) + + :param function: Function that mutates postgres_data_apis. + """ + from databricks.bundles.postgres_data_apis._models.postgres_data_api import ( + PostgresDataApi, + ) + + return ResourceMutator(resource_type=PostgresDataApi, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_databases.py b/python/databricks/bundles/core/_generated/postgres_databases.py new file mode 100644 index 00000000000..e0ace684fc0 --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_databases.py @@ -0,0 +1,126 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_databases._models.postgres_database import ( + PostgresDatabase, + PostgresDatabaseParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_databases._models.postgres_database import ( + PostgresDatabase, + ) + + return _ResourceType( + resource_type=PostgresDatabase, + singular_name="postgres_database", + plural_name="postgres_databases", + ) + + +class _PostgresDatabaseResources: + """ + Generated postgres_database accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_databases(self) -> dict[str, "PostgresDatabase"]: + return self._resources["postgres_databases"] + + def add_postgres_database( + self, + resource_name: str, + postgres_database: "PostgresDatabaseParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_database to the collection of resources. Resource name must be unique across all postgres_databases. + + :param resource_name: unique identifier for the postgres_database + :param postgres_database: the postgres_database to add, can be PostgresDatabase or dict + :param location: optional location of the postgres_database in the source code + """ + from databricks.bundles.postgres_databases._models.postgres_database import ( + PostgresDatabase, + ) + + postgres_database = _transform(PostgresDatabase, postgres_database) + path = ("resources", "postgres_databases", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_databases"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_database'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_databases"][resource_name] = postgres_database + + +@overload +def postgres_database_mutator( + function: Callable[[Bundle, "PostgresDatabase"], "PostgresDatabase"], +) -> ResourceMutator["PostgresDatabase"]: ... + + +@overload +def postgres_database_mutator( + function: Callable[["PostgresDatabase"], "PostgresDatabase"], +) -> ResourceMutator["PostgresDatabase"]: ... + + +def postgres_database_mutator( + function: Callable, +) -> ResourceMutator["PostgresDatabase"]: + """ + Decorator for defining mutator for postgres_databases. Function should return a new instance of the postgres_database + with the desired changes, instead of mutating the input postgres_database. + + Example: + + .. code-block:: python + + @postgres_database_mutator + def my_postgres_database_mutator(bundle: Bundle, postgres_database: PostgresDatabase) -> PostgresDatabase: + return replace(postgres_database, ...) + + :param function: Function that mutates postgres_databases. + """ + from databricks.bundles.postgres_databases._models.postgres_database import ( + PostgresDatabase, + ) + + return ResourceMutator(resource_type=PostgresDatabase, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_endpoints.py b/python/databricks/bundles/core/_generated/postgres_endpoints.py new file mode 100644 index 00000000000..09d2d291c87 --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_endpoints.py @@ -0,0 +1,126 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_endpoints._models.postgres_endpoint import ( + PostgresEndpoint, + PostgresEndpointParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_endpoints._models.postgres_endpoint import ( + PostgresEndpoint, + ) + + return _ResourceType( + resource_type=PostgresEndpoint, + singular_name="postgres_endpoint", + plural_name="postgres_endpoints", + ) + + +class _PostgresEndpointResources: + """ + Generated postgres_endpoint accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_endpoints(self) -> dict[str, "PostgresEndpoint"]: + return self._resources["postgres_endpoints"] + + def add_postgres_endpoint( + self, + resource_name: str, + postgres_endpoint: "PostgresEndpointParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_endpoint to the collection of resources. Resource name must be unique across all postgres_endpoints. + + :param resource_name: unique identifier for the postgres_endpoint + :param postgres_endpoint: the postgres_endpoint to add, can be PostgresEndpoint or dict + :param location: optional location of the postgres_endpoint in the source code + """ + from databricks.bundles.postgres_endpoints._models.postgres_endpoint import ( + PostgresEndpoint, + ) + + postgres_endpoint = _transform(PostgresEndpoint, postgres_endpoint) + path = ("resources", "postgres_endpoints", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_endpoints"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_endpoint'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_endpoints"][resource_name] = postgres_endpoint + + +@overload +def postgres_endpoint_mutator( + function: Callable[[Bundle, "PostgresEndpoint"], "PostgresEndpoint"], +) -> ResourceMutator["PostgresEndpoint"]: ... + + +@overload +def postgres_endpoint_mutator( + function: Callable[["PostgresEndpoint"], "PostgresEndpoint"], +) -> ResourceMutator["PostgresEndpoint"]: ... + + +def postgres_endpoint_mutator( + function: Callable, +) -> ResourceMutator["PostgresEndpoint"]: + """ + Decorator for defining mutator for postgres_endpoints. Function should return a new instance of the postgres_endpoint + with the desired changes, instead of mutating the input postgres_endpoint. + + Example: + + .. code-block:: python + + @postgres_endpoint_mutator + def my_postgres_endpoint_mutator(bundle: Bundle, postgres_endpoint: PostgresEndpoint) -> PostgresEndpoint: + return replace(postgres_endpoint, ...) + + :param function: Function that mutates postgres_endpoints. + """ + from databricks.bundles.postgres_endpoints._models.postgres_endpoint import ( + PostgresEndpoint, + ) + + return ResourceMutator(resource_type=PostgresEndpoint, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_projects.py b/python/databricks/bundles/core/_generated/postgres_projects.py new file mode 100644 index 00000000000..675ef580dc0 --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_projects.py @@ -0,0 +1,124 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_projects._models.postgres_project import ( + PostgresProject, + PostgresProjectParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_projects._models.postgres_project import ( + PostgresProject, + ) + + return _ResourceType( + resource_type=PostgresProject, + singular_name="postgres_project", + plural_name="postgres_projects", + ) + + +class _PostgresProjectResources: + """ + Generated postgres_project accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_projects(self) -> dict[str, "PostgresProject"]: + return self._resources["postgres_projects"] + + def add_postgres_project( + self, + resource_name: str, + postgres_project: "PostgresProjectParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_project to the collection of resources. Resource name must be unique across all postgres_projects. + + :param resource_name: unique identifier for the postgres_project + :param postgres_project: the postgres_project to add, can be PostgresProject or dict + :param location: optional location of the postgres_project in the source code + """ + from databricks.bundles.postgres_projects._models.postgres_project import ( + PostgresProject, + ) + + postgres_project = _transform(PostgresProject, postgres_project) + path = ("resources", "postgres_projects", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_projects"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_project'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_projects"][resource_name] = postgres_project + + +@overload +def postgres_project_mutator( + function: Callable[[Bundle, "PostgresProject"], "PostgresProject"], +) -> ResourceMutator["PostgresProject"]: ... + + +@overload +def postgres_project_mutator( + function: Callable[["PostgresProject"], "PostgresProject"], +) -> ResourceMutator["PostgresProject"]: ... + + +def postgres_project_mutator(function: Callable) -> ResourceMutator["PostgresProject"]: + """ + Decorator for defining mutator for postgres_projects. Function should return a new instance of the postgres_project + with the desired changes, instead of mutating the input postgres_project. + + Example: + + .. code-block:: python + + @postgres_project_mutator + def my_postgres_project_mutator(bundle: Bundle, postgres_project: PostgresProject) -> PostgresProject: + return replace(postgres_project, ...) + + :param function: Function that mutates postgres_projects. + """ + from databricks.bundles.postgres_projects._models.postgres_project import ( + PostgresProject, + ) + + return ResourceMutator(resource_type=PostgresProject, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_roles.py b/python/databricks/bundles/core/_generated/postgres_roles.py new file mode 100644 index 00000000000..0150ad2a8ac --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_roles.py @@ -0,0 +1,118 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_roles._models.postgres_role import ( + PostgresRole, + PostgresRoleParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_roles._models.postgres_role import PostgresRole + + return _ResourceType( + resource_type=PostgresRole, + singular_name="postgres_role", + plural_name="postgres_roles", + ) + + +class _PostgresRoleResources: + """ + Generated postgres_role accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_roles(self) -> dict[str, "PostgresRole"]: + return self._resources["postgres_roles"] + + def add_postgres_role( + self, + resource_name: str, + postgres_role: "PostgresRoleParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_role to the collection of resources. Resource name must be unique across all postgres_roles. + + :param resource_name: unique identifier for the postgres_role + :param postgres_role: the postgres_role to add, can be PostgresRole or dict + :param location: optional location of the postgres_role in the source code + """ + from databricks.bundles.postgres_roles._models.postgres_role import PostgresRole + + postgres_role = _transform(PostgresRole, postgres_role) + path = ("resources", "postgres_roles", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_roles"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_role'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_roles"][resource_name] = postgres_role + + +@overload +def postgres_role_mutator( + function: Callable[[Bundle, "PostgresRole"], "PostgresRole"], +) -> ResourceMutator["PostgresRole"]: ... + + +@overload +def postgres_role_mutator( + function: Callable[["PostgresRole"], "PostgresRole"], +) -> ResourceMutator["PostgresRole"]: ... + + +def postgres_role_mutator(function: Callable) -> ResourceMutator["PostgresRole"]: + """ + Decorator for defining mutator for postgres_roles. Function should return a new instance of the postgres_role + with the desired changes, instead of mutating the input postgres_role. + + Example: + + .. code-block:: python + + @postgres_role_mutator + def my_postgres_role_mutator(bundle: Bundle, postgres_role: PostgresRole) -> PostgresRole: + return replace(postgres_role, ...) + + :param function: Function that mutates postgres_roles. + """ + from databricks.bundles.postgres_roles._models.postgres_role import PostgresRole + + return ResourceMutator(resource_type=PostgresRole, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_snapshot_schedules.py b/python/databricks/bundles/core/_generated/postgres_snapshot_schedules.py new file mode 100644 index 00000000000..ff2a3cd2959 --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_snapshot_schedules.py @@ -0,0 +1,132 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_snapshot_schedules._models.postgres_snapshot_schedule import ( + PostgresSnapshotSchedule, + PostgresSnapshotScheduleParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_snapshot_schedules._models.postgres_snapshot_schedule import ( + PostgresSnapshotSchedule, + ) + + return _ResourceType( + resource_type=PostgresSnapshotSchedule, + singular_name="postgres_snapshot_schedule", + plural_name="postgres_snapshot_schedules", + ) + + +class _PostgresSnapshotScheduleResources: + """ + Generated postgres_snapshot_schedule accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_snapshot_schedules(self) -> dict[str, "PostgresSnapshotSchedule"]: + return self._resources["postgres_snapshot_schedules"] + + def add_postgres_snapshot_schedule( + self, + resource_name: str, + postgres_snapshot_schedule: "PostgresSnapshotScheduleParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_snapshot_schedule to the collection of resources. Resource name must be unique across all postgres_snapshot_schedules. + + :param resource_name: unique identifier for the postgres_snapshot_schedule + :param postgres_snapshot_schedule: the postgres_snapshot_schedule to add, can be PostgresSnapshotSchedule or dict + :param location: optional location of the postgres_snapshot_schedule in the source code + """ + from databricks.bundles.postgres_snapshot_schedules._models.postgres_snapshot_schedule import ( + PostgresSnapshotSchedule, + ) + + postgres_snapshot_schedule = _transform( + PostgresSnapshotSchedule, postgres_snapshot_schedule + ) + path = ("resources", "postgres_snapshot_schedules", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_snapshot_schedules"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_snapshot_schedule'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_snapshot_schedules"][resource_name] = ( + postgres_snapshot_schedule + ) + + +@overload +def postgres_snapshot_schedule_mutator( + function: Callable[ + [Bundle, "PostgresSnapshotSchedule"], "PostgresSnapshotSchedule" + ], +) -> ResourceMutator["PostgresSnapshotSchedule"]: ... + + +@overload +def postgres_snapshot_schedule_mutator( + function: Callable[["PostgresSnapshotSchedule"], "PostgresSnapshotSchedule"], +) -> ResourceMutator["PostgresSnapshotSchedule"]: ... + + +def postgres_snapshot_schedule_mutator( + function: Callable, +) -> ResourceMutator["PostgresSnapshotSchedule"]: + """ + Decorator for defining mutator for postgres_snapshot_schedules. Function should return a new instance of the postgres_snapshot_schedule + with the desired changes, instead of mutating the input postgres_snapshot_schedule. + + Example: + + .. code-block:: python + + @postgres_snapshot_schedule_mutator + def my_postgres_snapshot_schedule_mutator(bundle: Bundle, postgres_snapshot_schedule: PostgresSnapshotSchedule) -> PostgresSnapshotSchedule: + return replace(postgres_snapshot_schedule, ...) + + :param function: Function that mutates postgres_snapshot_schedules. + """ + from databricks.bundles.postgres_snapshot_schedules._models.postgres_snapshot_schedule import ( + PostgresSnapshotSchedule, + ) + + return ResourceMutator(resource_type=PostgresSnapshotSchedule, function=function) diff --git a/python/databricks/bundles/core/_generated/postgres_synced_tables.py b/python/databricks/bundles/core/_generated/postgres_synced_tables.py new file mode 100644 index 00000000000..660b3a8971e --- /dev/null +++ b/python/databricks/bundles/core/_generated/postgres_synced_tables.py @@ -0,0 +1,128 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from collections.abc import Callable +from typing import TYPE_CHECKING, Optional, overload + +from databricks.bundles.core._bundle import Bundle +from databricks.bundles.core._location import Location +from databricks.bundles.core._resource_mutator import ResourceMutator +from databricks.bundles.core._transform import _transform + +if TYPE_CHECKING: + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_synced_tables._models.postgres_synced_table import ( + PostgresSyncedTable, + PostgresSyncedTableParam, + ) + + +def _resource_type() -> "_ResourceType": + from databricks.bundles.core._resource_type import _ResourceType + from databricks.bundles.postgres_synced_tables._models.postgres_synced_table import ( + PostgresSyncedTable, + ) + + return _ResourceType( + resource_type=PostgresSyncedTable, + singular_name="postgres_synced_table", + plural_name="postgres_synced_tables", + ) + + +class _PostgresSyncedTableResources: + """ + Generated postgres_synced_table accessors, mixed into Resources. + """ + + # Provided by the Resources subclass; declared here so the generated methods + # below type-check. + _resources: dict[str, dict] + + if TYPE_CHECKING: + + def add_location(self, path: tuple[str, ...], location: Location) -> None: ... + + def add_diagnostic_error( + self, + msg: str, + *, + detail: Optional[str] = None, + path: Optional[tuple[str, ...]] = None, + location: Optional[Location] = None, + ) -> None: ... + + @property + def postgres_synced_tables(self) -> dict[str, "PostgresSyncedTable"]: + return self._resources["postgres_synced_tables"] + + def add_postgres_synced_table( + self, + resource_name: str, + postgres_synced_table: "PostgresSyncedTableParam", + *, + location: Optional[Location] = None, + ) -> None: + """ + Adds the resource postgres_synced_table to the collection of resources. Resource name must be unique across all postgres_synced_tables. + + :param resource_name: unique identifier for the postgres_synced_table + :param postgres_synced_table: the postgres_synced_table to add, can be PostgresSyncedTable or dict + :param location: optional location of the postgres_synced_table in the source code + """ + from databricks.bundles.postgres_synced_tables._models.postgres_synced_table import ( + PostgresSyncedTable, + ) + + postgres_synced_table = _transform(PostgresSyncedTable, postgres_synced_table) + path = ("resources", "postgres_synced_tables", resource_name) + location = location or Location.from_stack_frame(depth=1) + + if self._resources["postgres_synced_tables"].get(resource_name): + self.add_diagnostic_error( + msg=f"Duplicate resource name '{resource_name}' for resource 'postgres_synced_table'. Resource names must be unique.", + location=location, + path=path, + ) + else: + if location: + self.add_location(path, location) + + self._resources["postgres_synced_tables"][resource_name] = ( + postgres_synced_table + ) + + +@overload +def postgres_synced_table_mutator( + function: Callable[[Bundle, "PostgresSyncedTable"], "PostgresSyncedTable"], +) -> ResourceMutator["PostgresSyncedTable"]: ... + + +@overload +def postgres_synced_table_mutator( + function: Callable[["PostgresSyncedTable"], "PostgresSyncedTable"], +) -> ResourceMutator["PostgresSyncedTable"]: ... + + +def postgres_synced_table_mutator( + function: Callable, +) -> ResourceMutator["PostgresSyncedTable"]: + """ + Decorator for defining mutator for postgres_synced_tables. Function should return a new instance of the postgres_synced_table + with the desired changes, instead of mutating the input postgres_synced_table. + + Example: + + .. code-block:: python + + @postgres_synced_table_mutator + def my_postgres_synced_table_mutator(bundle: Bundle, postgres_synced_table: PostgresSyncedTable) -> PostgresSyncedTable: + return replace(postgres_synced_table, ...) + + :param function: Function that mutates postgres_synced_tables. + """ + from databricks.bundles.postgres_synced_tables._models.postgres_synced_table import ( + PostgresSyncedTable, + ) + + return ResourceMutator(resource_type=PostgresSyncedTable, function=function) diff --git a/python/databricks/bundles/postgres_branches/__init__.py b/python/databricks/bundles/postgres_branches/__init__.py new file mode 100644 index 00000000000..91470b039b6 --- /dev/null +++ b/python/databricks/bundles/postgres_branches/__init__.py @@ -0,0 +1,30 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "PostgresBranch", + "PostgresBranchDict", + "PostgresBranchParam", +] + + +from databricks.bundles.postgres_branches._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_branches._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_branches._models.postgres_branch import ( + PostgresBranch, + PostgresBranchDict, + PostgresBranchParam, +) diff --git a/python/databricks/bundles/postgres_branches/_models/depends_on.py b/python/databricks/bundles/postgres_branches/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_branches/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_branches/_models/lifecycle.py b/python/databricks/bundles/postgres_branches/_models/lifecycle.py new file mode 100644 index 00000000000..29e7b113ab0 --- /dev/null +++ b/python/databricks/bundles/postgres_branches/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_branches._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_branches/_models/postgres_branch.py b/python/databricks/bundles/postgres_branches/_models/postgres_branch.py new file mode 100644 index 00000000000..7a0199d1829 --- /dev/null +++ b/python/databricks/bundles/postgres_branches/_models/postgres_branch.py @@ -0,0 +1,189 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_branches._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresBranch(Resource): + """""" + + branch_id: VariableOr[str] + """ + The ID to use for the branch; becomes the final component of the branch's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `development` becomes `projects/my-app/branches/development`. + """ + + parent: VariableOr[str] + """ + The project containing this branch (API resource hierarchy). Format: projects/{project_id} + + This field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see `source_branch`. + """ + + expire_time: VariableOrOptional[str] = None + """ + Absolute expiration timestamp. When set, the branch will expire at this time. + Mutually exclusive with `ttl` and `no_expiry`. + """ + + is_protected: VariableOrOptional[bool] = None + """ + When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + no_expiry: VariableOrOptional[bool] = None + """ + Explicitly disable expiration. When set to true, the branch will not expire. + If set to false, the request is invalid; provide either ttl or expire_time instead. + Mutually exclusive with `expire_time` and `ttl`. + """ + + purge_on_delete: VariableOrOptional[bool] = None + """ + When true, permanently delete the branch when the bundle is destroyed. When false or unset, the branch is soft deleted and can be restored within its retention window. + """ + + replace_existing: VariableOrOptional[bool] = None + """ + When true, take over an existing branch with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a branch that already exists on the project (for example, the production branch created with the project) under bundle management. Only takes effect when the branch is created. + """ + + source_branch: VariableOrOptional[str] = None + """ + The name of the source branch from which this branch was created (data lineage for point-in-time recovery). + If not specified, defaults to the project's default branch. + Format: projects/{project_id}/branches/{branch_id} + """ + + source_branch_lsn: VariableOrOptional[str] = None + """ + The Log Sequence Number (LSN) on the source branch from which this branch was created. + """ + + source_branch_time: VariableOrOptional[str] = None + """ + The point in time on the source branch from which this branch was created. + """ + + source_snapshot: VariableOrOptional[str] = None + """ + The snapshot this branch was created from. When set, the branch's data + comes from the snapshot rather than a source branch, so source_branch, + source_branch_lsn, and source_branch_time must be empty. The snapshot must + be AVAILABLE and belong to this branch's project. + Format: projects/{project_id}/snapshots/{snapshot_id} + """ + + ttl: VariableOrOptional[str] = None + """ + Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. + Mutually exclusive with `expire_time` and `no_expiry`. + """ + + @classmethod + def from_dict(cls, value: "PostgresBranchDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresBranchDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresBranchDict(TypedDict, total=False): + """""" + + branch_id: VariableOr[str] + """ + The ID to use for the branch; becomes the final component of the branch's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `development` becomes `projects/my-app/branches/development`. + """ + + parent: VariableOr[str] + """ + The project containing this branch (API resource hierarchy). Format: projects/{project_id} + + This field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see `source_branch`. + """ + + expire_time: VariableOrOptional[str] + """ + Absolute expiration timestamp. When set, the branch will expire at this time. + Mutually exclusive with `ttl` and `no_expiry`. + """ + + is_protected: VariableOrOptional[bool] + """ + When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + no_expiry: VariableOrOptional[bool] + """ + Explicitly disable expiration. When set to true, the branch will not expire. + If set to false, the request is invalid; provide either ttl or expire_time instead. + Mutually exclusive with `expire_time` and `ttl`. + """ + + purge_on_delete: VariableOrOptional[bool] + """ + When true, permanently delete the branch when the bundle is destroyed. When false or unset, the branch is soft deleted and can be restored within its retention window. + """ + + replace_existing: VariableOrOptional[bool] + """ + When true, take over an existing branch with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a branch that already exists on the project (for example, the production branch created with the project) under bundle management. Only takes effect when the branch is created. + """ + + source_branch: VariableOrOptional[str] + """ + The name of the source branch from which this branch was created (data lineage for point-in-time recovery). + If not specified, defaults to the project's default branch. + Format: projects/{project_id}/branches/{branch_id} + """ + + source_branch_lsn: VariableOrOptional[str] + """ + The Log Sequence Number (LSN) on the source branch from which this branch was created. + """ + + source_branch_time: VariableOrOptional[str] + """ + The point in time on the source branch from which this branch was created. + """ + + source_snapshot: VariableOrOptional[str] + """ + The snapshot this branch was created from. When set, the branch's data + comes from the snapshot rather than a source branch, so source_branch, + source_branch_lsn, and source_branch_time must be empty. The snapshot must + be AVAILABLE and belong to this branch's project. + Format: projects/{project_id}/snapshots/{snapshot_id} + """ + + ttl: VariableOrOptional[str] + """ + Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. + Mutually exclusive with `expire_time` and `no_expiry`. + """ + + +PostgresBranchParam = PostgresBranchDict | PostgresBranch diff --git a/python/databricks/bundles/postgres_catalogs/__init__.py b/python/databricks/bundles/postgres_catalogs/__init__.py new file mode 100644 index 00000000000..f7da9c92d20 --- /dev/null +++ b/python/databricks/bundles/postgres_catalogs/__init__.py @@ -0,0 +1,30 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "PostgresCatalog", + "PostgresCatalogDict", + "PostgresCatalogParam", +] + + +from databricks.bundles.postgres_catalogs._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_catalogs._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_catalogs._models.postgres_catalog import ( + PostgresCatalog, + PostgresCatalogDict, + PostgresCatalogParam, +) diff --git a/python/databricks/bundles/postgres_catalogs/_models/depends_on.py b/python/databricks/bundles/postgres_catalogs/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_catalogs/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_catalogs/_models/lifecycle.py b/python/databricks/bundles/postgres_catalogs/_models/lifecycle.py new file mode 100644 index 00000000000..3023f57f963 --- /dev/null +++ b/python/databricks/bundles/postgres_catalogs/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_catalogs._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_catalogs/_models/postgres_catalog.py b/python/databricks/bundles/postgres_catalogs/_models/postgres_catalog.py new file mode 100644 index 00000000000..0a430cbc0b0 --- /dev/null +++ b/python/databricks/bundles/postgres_catalogs/_models/postgres_catalog.py @@ -0,0 +1,129 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_catalogs._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresCatalog(Resource): + """ + The desired state of the Catalog. + """ + + catalog_id: VariableOr[str] + """ + The ID of the catalog in Unity Catalog; becomes the full resource name. For example, `my_catalog` becomes `catalogs/my_catalog`. + """ + + postgres_database: VariableOr[str] + """ + The name of the Postgres database inside the specified Lakebase project and branch to be associated with the UC catalog. + This database must already exist, unless create_database_if_missing is set to true on creation. + The system databases postgres, databricks_system, template0 and template1 cannot be registered. + + A database can only be registered with one UC catalog at a time. + To re-register a database with a different catalog, the existing catalog must be deleted first. + + A child branch inherits the fact of parent's registration. This means the same-named database + in a child branch cannot be registered with a second catalog + while the parent's registration exists. To allow registering the database of a child branch, + drop and recreate the database on the child branch. + This removes the fact of parent's registration from this branch only. + + Doing Point In Time Restore (PITR) prior to the moment before the Postgres DB was registered + in the Catalog drops the fact of registration of the database. So the user should avoid doing so. + """ + + branch: VariableOrOptional[str] = None + """ + The resource path of the branch that holds the Postgres database. The branch must have a + read-write compute endpoint. + + Format: projects/{project_id}/branches/{branch_id}. + """ + + create_database_if_missing: VariableOrOptional[bool] = None + """ + If set to true, the specified postgres_database is created on behalf of the calling user + if it does not already exist. In this case, the calling user has a role created for + them in Postgres if they do not already have one. + + Defaults to false, meaning that the request fails if the specified postgres_database does not already exist. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "PostgresCatalogDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresCatalogDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresCatalogDict(TypedDict, total=False): + """""" + + catalog_id: VariableOr[str] + """ + The ID of the catalog in Unity Catalog; becomes the full resource name. For example, `my_catalog` becomes `catalogs/my_catalog`. + """ + + postgres_database: VariableOr[str] + """ + The name of the Postgres database inside the specified Lakebase project and branch to be associated with the UC catalog. + This database must already exist, unless create_database_if_missing is set to true on creation. + The system databases postgres, databricks_system, template0 and template1 cannot be registered. + + A database can only be registered with one UC catalog at a time. + To re-register a database with a different catalog, the existing catalog must be deleted first. + + A child branch inherits the fact of parent's registration. This means the same-named database + in a child branch cannot be registered with a second catalog + while the parent's registration exists. To allow registering the database of a child branch, + drop and recreate the database on the child branch. + This removes the fact of parent's registration from this branch only. + + Doing Point In Time Restore (PITR) prior to the moment before the Postgres DB was registered + in the Catalog drops the fact of registration of the database. So the user should avoid doing so. + """ + + branch: VariableOrOptional[str] + """ + The resource path of the branch that holds the Postgres database. The branch must have a + read-write compute endpoint. + + Format: projects/{project_id}/branches/{branch_id}. + """ + + create_database_if_missing: VariableOrOptional[bool] + """ + If set to true, the specified postgres_database is created on behalf of the calling user + if it does not already exist. In this case, the calling user has a role created for + them in Postgres if they do not already have one. + + Defaults to false, meaning that the request fails if the specified postgres_database does not already exist. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + +PostgresCatalogParam = PostgresCatalogDict | PostgresCatalog diff --git a/python/databricks/bundles/postgres_data_apis/__init__.py b/python/databricks/bundles/postgres_data_apis/__init__.py new file mode 100644 index 00000000000..696ce04d3ac --- /dev/null +++ b/python/databricks/bundles/postgres_data_apis/__init__.py @@ -0,0 +1,36 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "OpenApiMode", + "OpenApiModeParam", + "PostgresDataApi", + "PostgresDataApiDict", + "PostgresDataApiParam", +] + + +from databricks.bundles.postgres_data_apis._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_data_apis._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_data_apis._models.open_api_mode import ( + OpenApiMode, + OpenApiModeParam, +) +from databricks.bundles.postgres_data_apis._models.postgres_data_api import ( + PostgresDataApi, + PostgresDataApiDict, + PostgresDataApiParam, +) diff --git a/python/databricks/bundles/postgres_data_apis/_models/depends_on.py b/python/databricks/bundles/postgres_data_apis/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_data_apis/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_data_apis/_models/lifecycle.py b/python/databricks/bundles/postgres_data_apis/_models/lifecycle.py new file mode 100644 index 00000000000..7694ff70b43 --- /dev/null +++ b/python/databricks/bundles/postgres_data_apis/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_data_apis._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_data_apis/_models/open_api_mode.py b/python/databricks/bundles/postgres_data_apis/_models/open_api_mode.py new file mode 100644 index 00000000000..07f1c4a5614 --- /dev/null +++ b/python/databricks/bundles/postgres_data_apis/_models/open_api_mode.py @@ -0,0 +1,20 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class OpenApiMode(Enum): + """ + :meta private: [EXPERIMENTAL] + + Controls how the Data API exposes the OpenAPI documentation endpoint. `OPEN_API_MODE_IGNORE_PRIVILEGES` serves the OpenAPI document without filtering it by the caller's privileges; `OPEN_API_MODE_DISABLED` turns the endpoint off. + """ + + OPEN_API_MODE_IGNORE_PRIVILEGES = "OPEN_API_MODE_IGNORE_PRIVILEGES" + OPEN_API_MODE_DISABLED = "OPEN_API_MODE_DISABLED" + + +OpenApiModeParam = ( + Literal["OPEN_API_MODE_IGNORE_PRIVILEGES", "OPEN_API_MODE_DISABLED"] | OpenApiMode +) diff --git a/python/databricks/bundles/postgres_data_apis/_models/postgres_data_api.py b/python/databricks/bundles/postgres_data_apis/_models/postgres_data_api.py new file mode 100644 index 00000000000..553f60e02b7 --- /dev/null +++ b/python/databricks/bundles/postgres_data_apis/_models/postgres_data_api.py @@ -0,0 +1,205 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.postgres_data_apis._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.postgres_data_apis._models.open_api_mode import ( + OpenApiMode, + OpenApiModeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresDataApi(Resource): + """ + The Data API (a PostgREST-compatible REST interface) of a Postgres database on a Lakebase Autoscaling branch. A database has at most one Data API. At least one setting besides `parent` is required, such as `db_schemas`. Its serving URL is available as `status.url`; reference it as `${resources.postgres_data_apis..status.url}`. Durations use the protobuf seconds format, such as `300s`. + """ + + parent: VariableOr[str] + """ + The database whose Data API this manages. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + """ + + db_aggregates_enabled: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Enable aggregate functions (count, sum, avg, etc.) in Data API responses. + Default: true. + """ + + db_extra_search_path: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Additional schemas to include in the PostgreSQL search path. + Each entry must be a valid PostgreSQL schema name. + """ + + db_max_rows: VariableOrOptional[int] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Maximum number of rows returned in a single Data API response. + Must be a positive integer. + """ + + db_schemas: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Database schemas exposed through the Data API. + Each entry must be a valid PostgreSQL schema name (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). + Maximum 100 entries. Default: ["public"]. + """ + + jwt_cache_max_lifetime: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Maximum lifetime for cached JWT tokens. Zero duration disables caching. + """ + + jwt_role_claim_key: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] JSON path to the role claim in JWT tokens (e.g., ".sub"). + Default: ".sub". + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + openapi_mode: VariableOrOptional[OpenApiMode] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] OpenAPI documentation mode for the Data API endpoint. + """ + + server_cors_allowed_origins: VariableOrList[str] = field(default_factory=list) + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Allowed origins for CORS requests. + Each entry should be a valid origin URL, or use "*" to allow all origins. + """ + + server_timing_enabled: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Enable the Server-Timing header in Data API responses. + """ + + @classmethod + def from_dict(cls, value: "PostgresDataApiDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresDataApiDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresDataApiDict(TypedDict, total=False): + """""" + + parent: VariableOr[str] + """ + The database whose Data API this manages. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + """ + + db_aggregates_enabled: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Enable aggregate functions (count, sum, avg, etc.) in Data API responses. + Default: true. + """ + + db_extra_search_path: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Additional schemas to include in the PostgreSQL search path. + Each entry must be a valid PostgreSQL schema name. + """ + + db_max_rows: VariableOrOptional[int] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Maximum number of rows returned in a single Data API response. + Must be a positive integer. + """ + + db_schemas: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Database schemas exposed through the Data API. + Each entry must be a valid PostgreSQL schema name (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). + Maximum 100 entries. Default: ["public"]. + """ + + jwt_cache_max_lifetime: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Maximum lifetime for cached JWT tokens. Zero duration disables caching. + """ + + jwt_role_claim_key: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] JSON path to the role claim in JWT tokens (e.g., ".sub"). + Default: ".sub". + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + openapi_mode: VariableOrOptional[OpenApiModeParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] OpenAPI documentation mode for the Data API endpoint. + """ + + server_cors_allowed_origins: VariableOrList[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Allowed origins for CORS requests. + Each entry should be a valid origin URL, or use "*" to allow all origins. + """ + + server_timing_enabled: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Enable the Server-Timing header in Data API responses. + """ + + +PostgresDataApiParam = PostgresDataApiDict | PostgresDataApi diff --git a/python/databricks/bundles/postgres_databases/__init__.py b/python/databricks/bundles/postgres_databases/__init__.py new file mode 100644 index 00000000000..4abc0339985 --- /dev/null +++ b/python/databricks/bundles/postgres_databases/__init__.py @@ -0,0 +1,30 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "PostgresDatabase", + "PostgresDatabaseDict", + "PostgresDatabaseParam", +] + + +from databricks.bundles.postgres_databases._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_databases._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_databases._models.postgres_database import ( + PostgresDatabase, + PostgresDatabaseDict, + PostgresDatabaseParam, +) diff --git a/python/databricks/bundles/postgres_databases/_models/depends_on.py b/python/databricks/bundles/postgres_databases/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_databases/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_databases/_models/lifecycle.py b/python/databricks/bundles/postgres_databases/_models/lifecycle.py new file mode 100644 index 00000000000..1f108bb8191 --- /dev/null +++ b/python/databricks/bundles/postgres_databases/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_databases._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_databases/_models/postgres_database.py b/python/databricks/bundles/postgres_databases/_models/postgres_database.py new file mode 100644 index 00000000000..95d82e2ac0c --- /dev/null +++ b/python/databricks/bundles/postgres_databases/_models/postgres_database.py @@ -0,0 +1,117 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_databases._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresDatabase(Resource): + """""" + + database_id: VariableOr[str] + """ + The ID to use for the database; becomes the final component of the database's resource name and the database name in Postgres. Must be 4-63 characters and use only characters available in DNS names, as defined by RFC 1123. If not specified, it is generated automatically. + """ + + parent: VariableOr[str] + """ + The branch containing this database. Format: projects/{project_id}/branches/{branch_id} + """ + + role: VariableOr[str] + """ + The name of the role that owns the database. + Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + + To change the owner, pass valid existing Role name when updating the Database + + Required when creating the Database. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + postgres_database: VariableOrOptional[str] = None + """ + The name of the Postgres database. + + This expects a valid Postgres identifier as specified in the link below. + https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + Required when creating the Database. + + To rename, pass a valid postgres identifier when updating the Database. + """ + + replace_existing: VariableOrOptional[bool] = None + """ + When true, take over an existing database with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a database that already exists on the branch under bundle management. Only takes effect when the database is created. + """ + + @classmethod + def from_dict(cls, value: "PostgresDatabaseDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresDatabaseDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresDatabaseDict(TypedDict, total=False): + """""" + + database_id: VariableOr[str] + """ + The ID to use for the database; becomes the final component of the database's resource name and the database name in Postgres. Must be 4-63 characters and use only characters available in DNS names, as defined by RFC 1123. If not specified, it is generated automatically. + """ + + parent: VariableOr[str] + """ + The branch containing this database. Format: projects/{project_id}/branches/{branch_id} + """ + + role: VariableOr[str] + """ + The name of the role that owns the database. + Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + + To change the owner, pass valid existing Role name when updating the Database + + Required when creating the Database. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + postgres_database: VariableOrOptional[str] + """ + The name of the Postgres database. + + This expects a valid Postgres identifier as specified in the link below. + https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + Required when creating the Database. + + To rename, pass a valid postgres identifier when updating the Database. + """ + + replace_existing: VariableOrOptional[bool] + """ + When true, take over an existing database with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a database that already exists on the branch under bundle management. Only takes effect when the database is created. + """ + + +PostgresDatabaseParam = PostgresDatabaseDict | PostgresDatabase diff --git a/python/databricks/bundles/postgres_endpoints/__init__.py b/python/databricks/bundles/postgres_endpoints/__init__.py new file mode 100644 index 00000000000..7a537084705 --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/__init__.py @@ -0,0 +1,52 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "EndpointGroupSpec", + "EndpointGroupSpecDict", + "EndpointGroupSpecParam", + "EndpointSettings", + "EndpointSettingsDict", + "EndpointSettingsParam", + "EndpointType", + "EndpointTypeParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "PostgresEndpoint", + "PostgresEndpointDict", + "PostgresEndpointParam", +] + + +from databricks.bundles.postgres_endpoints._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_endpoints._models.endpoint_group_spec import ( + EndpointGroupSpec, + EndpointGroupSpecDict, + EndpointGroupSpecParam, +) +from databricks.bundles.postgres_endpoints._models.endpoint_settings import ( + EndpointSettings, + EndpointSettingsDict, + EndpointSettingsParam, +) +from databricks.bundles.postgres_endpoints._models.endpoint_type import ( + EndpointType, + EndpointTypeParam, +) +from databricks.bundles.postgres_endpoints._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_endpoints._models.postgres_endpoint import ( + PostgresEndpoint, + PostgresEndpointDict, + PostgresEndpointParam, +) diff --git a/python/databricks/bundles/postgres_endpoints/_models/depends_on.py b/python/databricks/bundles/postgres_endpoints/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_endpoints/_models/endpoint_group_spec.py b/python/databricks/bundles/postgres_endpoints/_models/endpoint_group_spec.py new file mode 100644 index 00000000000..78147671a18 --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/_models/endpoint_group_spec.py @@ -0,0 +1,68 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EndpointGroupSpec: + """""" + + max: VariableOr[int] + """ + The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single + compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to + true on the EndpointSpec. + """ + + min: VariableOr[int] + """ + The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater + than or equal to 1. + """ + + enable_readable_secondaries: VariableOrOptional[bool] = None + """ + Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where + `max` is greater than 1. When enabled, the endpoint also reports a read-only host in `status.hosts`. + """ + + @classmethod + def from_dict(cls, value: "EndpointGroupSpecDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EndpointGroupSpecDict": + return _transform_to_json_value(self) # type:ignore + + +class EndpointGroupSpecDict(TypedDict, total=False): + """""" + + max: VariableOr[int] + """ + The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single + compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to + true on the EndpointSpec. + """ + + min: VariableOr[int] + """ + The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater + than or equal to 1. + """ + + enable_readable_secondaries: VariableOrOptional[bool] + """ + Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where + `max` is greater than 1. When enabled, the endpoint also reports a read-only host in `status.hosts`. + """ + + +EndpointGroupSpecParam = EndpointGroupSpecDict | EndpointGroupSpec diff --git a/python/databricks/bundles/postgres_endpoints/_models/endpoint_settings.py b/python/databricks/bundles/postgres_endpoints/_models/endpoint_settings.py new file mode 100644 index 00000000000..de7d6ccb20c --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/_models/endpoint_settings.py @@ -0,0 +1,44 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrDict + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class EndpointSettings: + """ + A collection of settings for a compute endpoint. + """ + + pg_settings: VariableOrDict[str] = field(default_factory=dict) + """ + Postgres server parameters to set on the compute endpoint, keyed by parameter name. Each value is + given as a string. + """ + + @classmethod + def from_dict(cls, value: "EndpointSettingsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "EndpointSettingsDict": + return _transform_to_json_value(self) # type:ignore + + +class EndpointSettingsDict(TypedDict, total=False): + """""" + + pg_settings: VariableOrDict[str] + """ + Postgres server parameters to set on the compute endpoint, keyed by parameter name. Each value is + given as a string. + """ + + +EndpointSettingsParam = EndpointSettingsDict | EndpointSettings diff --git a/python/databricks/bundles/postgres_endpoints/_models/endpoint_type.py b/python/databricks/bundles/postgres_endpoints/_models/endpoint_type.py new file mode 100644 index 00000000000..d7ad211a999 --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/_models/endpoint_type.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class EndpointType(Enum): + """ + The compute endpoint type. Either `read_write` or `read_only`. + """ + + ENDPOINT_TYPE_READ_WRITE = "ENDPOINT_TYPE_READ_WRITE" + ENDPOINT_TYPE_READ_ONLY = "ENDPOINT_TYPE_READ_ONLY" + + +EndpointTypeParam = ( + Literal["ENDPOINT_TYPE_READ_WRITE", "ENDPOINT_TYPE_READ_ONLY"] | EndpointType +) diff --git a/python/databricks/bundles/postgres_endpoints/_models/lifecycle.py b/python/databricks/bundles/postgres_endpoints/_models/lifecycle.py new file mode 100644 index 00000000000..84c5349f37d --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_endpoints._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_endpoints/_models/postgres_endpoint.py b/python/databricks/bundles/postgres_endpoints/_models/postgres_endpoint.py new file mode 100644 index 00000000000..240c30b541e --- /dev/null +++ b/python/databricks/bundles/postgres_endpoints/_models/postgres_endpoint.py @@ -0,0 +1,201 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_endpoints._models.endpoint_group_spec import ( + EndpointGroupSpec, + EndpointGroupSpecParam, +) +from databricks.bundles.postgres_endpoints._models.endpoint_settings import ( + EndpointSettings, + EndpointSettingsParam, +) +from databricks.bundles.postgres_endpoints._models.endpoint_type import ( + EndpointType, + EndpointTypeParam, +) +from databricks.bundles.postgres_endpoints._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresEndpoint(Resource): + """""" + + endpoint_id: VariableOr[str] + """ + The ID to use for the endpoint; becomes the final component of the endpoint's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `primary` becomes `projects/my-app/branches/development/endpoints/primary`. + """ + + endpoint_type: VariableOr[EndpointType] + """ + The endpoint type. A branch can only have one READ_WRITE endpoint. + """ + + parent: VariableOr[str] + """ + The branch containing this endpoint (API resource hierarchy). Format: projects/{project_id}/branches/{branch_id} + """ + + autoscaling_limit_max_cu: VariableOrOptional[float] = None + """ + The maximum number of Compute Units. The maximum value is 64. + The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. + Set it equal to `autoscaling_limit_min_cu` for a fixed-size compute. When omitted at creation, the + project's default endpoint settings apply. + """ + + autoscaling_limit_min_cu: VariableOrOptional[float] = None + """ + The minimum number of Compute Units. Minimum value is 0.5, and it must not exceed + `autoscaling_limit_max_cu`. When omitted at creation, the project's default endpoint settings apply. + """ + + disabled: VariableOrOptional[bool] = None + """ + Whether to restrict connections to the compute endpoint. + Enabling this option schedules a suspend compute operation. + A disabled compute endpoint cannot be enabled by a connection or + console action. To accept connections again, set this field back to false. + """ + + group: VariableOrOptional[EndpointGroupSpec] = None + """ + Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults + to non HA settings, with a single compute backing the endpoint (and no readable secondaries + for Read/Write endpoints). Automatic suspension is not available for an endpoint with more than one + compute, so set `no_suspension` to true when configuring one. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + no_suspension: VariableOrOptional[bool] = None + """ + When set to true, explicitly disables automatic suspension (never suspend). + The value must be true when provided. + Mutually exclusive with `suspend_timeout_duration`. + """ + + replace_existing: VariableOrOptional[bool] = None + """ + When true, take over an existing endpoint with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring an endpoint that already exists on the branch (for example, the primary read-write endpoint created with the branch) under bundle management. Only takes effect when the endpoint is created. + """ + + settings: VariableOrOptional[EndpointSettings] = None + """ + Postgres server parameters for the compute endpoint. On update, an empty `pg_settings` map leaves + the current parameters unchanged. + """ + + suspend_timeout_duration: VariableOrOptional[str] = None + """ + Duration of inactivity after which the compute endpoint is automatically suspended. + If specified, the value must be between 60s and 604800s (1 minute to 1 week). A suspended endpoint + keeps its hostnames and configuration, and the next connection attempt restarts it. When neither + this field nor `no_suspension` is set at creation, the project's default endpoint settings apply. + Mutually exclusive with `no_suspension`. + """ + + @classmethod + def from_dict(cls, value: "PostgresEndpointDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresEndpointDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresEndpointDict(TypedDict, total=False): + """""" + + endpoint_id: VariableOr[str] + """ + The ID to use for the endpoint; becomes the final component of the endpoint's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `primary` becomes `projects/my-app/branches/development/endpoints/primary`. + """ + + endpoint_type: VariableOr[EndpointTypeParam] + """ + The endpoint type. A branch can only have one READ_WRITE endpoint. + """ + + parent: VariableOr[str] + """ + The branch containing this endpoint (API resource hierarchy). Format: projects/{project_id}/branches/{branch_id} + """ + + autoscaling_limit_max_cu: VariableOrOptional[float] + """ + The maximum number of Compute Units. The maximum value is 64. + The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. + Set it equal to `autoscaling_limit_min_cu` for a fixed-size compute. When omitted at creation, the + project's default endpoint settings apply. + """ + + autoscaling_limit_min_cu: VariableOrOptional[float] + """ + The minimum number of Compute Units. Minimum value is 0.5, and it must not exceed + `autoscaling_limit_max_cu`. When omitted at creation, the project's default endpoint settings apply. + """ + + disabled: VariableOrOptional[bool] + """ + Whether to restrict connections to the compute endpoint. + Enabling this option schedules a suspend compute operation. + A disabled compute endpoint cannot be enabled by a connection or + console action. To accept connections again, set this field back to false. + """ + + group: VariableOrOptional[EndpointGroupSpecParam] + """ + Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults + to non HA settings, with a single compute backing the endpoint (and no readable secondaries + for Read/Write endpoints). Automatic suspension is not available for an endpoint with more than one + compute, so set `no_suspension` to true when configuring one. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + no_suspension: VariableOrOptional[bool] + """ + When set to true, explicitly disables automatic suspension (never suspend). + The value must be true when provided. + Mutually exclusive with `suspend_timeout_duration`. + """ + + replace_existing: VariableOrOptional[bool] + """ + When true, take over an existing endpoint with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring an endpoint that already exists on the branch (for example, the primary read-write endpoint created with the branch) under bundle management. Only takes effect when the endpoint is created. + """ + + settings: VariableOrOptional[EndpointSettingsParam] + """ + Postgres server parameters for the compute endpoint. On update, an empty `pg_settings` map leaves + the current parameters unchanged. + """ + + suspend_timeout_duration: VariableOrOptional[str] + """ + Duration of inactivity after which the compute endpoint is automatically suspended. + If specified, the value must be between 60s and 604800s (1 minute to 1 week). A suspended endpoint + keeps its hostnames and configuration, and the next connection attempt restarts it. When neither + this field nor `no_suspension` is set at creation, the project's default endpoint settings apply. + Mutually exclusive with `no_suspension`. + """ + + +PostgresEndpointParam = PostgresEndpointDict | PostgresEndpoint diff --git a/python/databricks/bundles/postgres_projects/__init__.py b/python/databricks/bundles/postgres_projects/__init__.py new file mode 100644 index 00000000000..3b2e63f9608 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/__init__.py @@ -0,0 +1,60 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "Permission", + "PermissionDict", + "PermissionLevel", + "PermissionLevelParam", + "PermissionParam", + "PostgresProject", + "PostgresProjectDict", + "PostgresProjectParam", + "ProjectCustomTag", + "ProjectCustomTagDict", + "ProjectCustomTagParam", + "ProjectDefaultEndpointSettings", + "ProjectDefaultEndpointSettingsDict", + "ProjectDefaultEndpointSettingsParam", +] + + +from databricks.bundles.postgres_projects._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_projects._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_projects._models.permission import ( + Permission, + PermissionDict, + PermissionParam, +) +from databricks.bundles.postgres_projects._models.permission_level import ( + PermissionLevel, + PermissionLevelParam, +) +from databricks.bundles.postgres_projects._models.postgres_project import ( + PostgresProject, + PostgresProjectDict, + PostgresProjectParam, +) +from databricks.bundles.postgres_projects._models.project_custom_tag import ( + ProjectCustomTag, + ProjectCustomTagDict, + ProjectCustomTagParam, +) +from databricks.bundles.postgres_projects._models.project_default_endpoint_settings import ( + ProjectDefaultEndpointSettings, + ProjectDefaultEndpointSettingsDict, + ProjectDefaultEndpointSettingsParam, +) diff --git a/python/databricks/bundles/postgres_projects/_models/depends_on.py b/python/databricks/bundles/postgres_projects/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_projects/_models/lifecycle.py b/python/databricks/bundles/postgres_projects/_models/lifecycle.py new file mode 100644 index 00000000000..60dcda72c93 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_projects._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_projects/_models/permission.py b/python/databricks/bundles/postgres_projects/_models/permission.py new file mode 100644 index 00000000000..29d13188df3 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/permission.py @@ -0,0 +1,74 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_projects._models.permission_level import ( + PermissionLevel, + PermissionLevelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Permission: + """""" + + level: VariableOr[PermissionLevel] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] = None + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] = None + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] = None + """ + The name of the user granted the permission level. + """ + + @classmethod + def from_dict(cls, value: "PermissionDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PermissionDict": + return _transform_to_json_value(self) # type:ignore + + +class PermissionDict(TypedDict, total=False): + """""" + + level: VariableOr[PermissionLevelParam] + """ + The permission level to apply. The allowed levels depend on the resource type. + """ + + group_name: VariableOrOptional[str] + """ + The name of the group granted the permission level. + """ + + service_principal_name: VariableOrOptional[str] + """ + The name of the service principal granted the permission level. + """ + + user_name: VariableOrOptional[str] + """ + The name of the user granted the permission level. + """ + + +PermissionParam = PermissionDict | Permission diff --git a/python/databricks/bundles/postgres_projects/_models/permission_level.py b/python/databricks/bundles/postgres_projects/_models/permission_level.py new file mode 100644 index 00000000000..c6111911b29 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/permission_level.py @@ -0,0 +1,58 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class PermissionLevel(Enum): + """ + Permission level + """ + + CAN_MANAGE = "CAN_MANAGE" + CAN_RESTART = "CAN_RESTART" + CAN_ATTACH_TO = "CAN_ATTACH_TO" + IS_OWNER = "IS_OWNER" + CAN_MANAGE_RUN = "CAN_MANAGE_RUN" + CAN_VIEW = "CAN_VIEW" + CAN_READ = "CAN_READ" + CAN_RUN = "CAN_RUN" + CAN_EDIT = "CAN_EDIT" + CAN_USE = "CAN_USE" + CAN_MANAGE_STAGING_VERSIONS = "CAN_MANAGE_STAGING_VERSIONS" + CAN_MANAGE_PRODUCTION_VERSIONS = "CAN_MANAGE_PRODUCTION_VERSIONS" + CAN_EDIT_METADATA = "CAN_EDIT_METADATA" + CAN_VIEW_METADATA = "CAN_VIEW_METADATA" + CAN_BIND = "CAN_BIND" + CAN_QUERY = "CAN_QUERY" + CAN_MONITOR = "CAN_MONITOR" + CAN_CREATE = "CAN_CREATE" + CAN_MONITOR_ONLY = "CAN_MONITOR_ONLY" + CAN_CREATE_APP = "CAN_CREATE_APP" + + +PermissionLevelParam = ( + Literal[ + "CAN_MANAGE", + "CAN_RESTART", + "CAN_ATTACH_TO", + "IS_OWNER", + "CAN_MANAGE_RUN", + "CAN_VIEW", + "CAN_READ", + "CAN_RUN", + "CAN_EDIT", + "CAN_USE", + "CAN_MANAGE_STAGING_VERSIONS", + "CAN_MANAGE_PRODUCTION_VERSIONS", + "CAN_EDIT_METADATA", + "CAN_VIEW_METADATA", + "CAN_BIND", + "CAN_QUERY", + "CAN_MONITOR", + "CAN_CREATE", + "CAN_MONITOR_ONLY", + "CAN_CREATE_APP", + ] + | PermissionLevel +) diff --git a/python/databricks/bundles/postgres_projects/_models/postgres_project.py b/python/databricks/bundles/postgres_projects/_models/postgres_project.py new file mode 100644 index 00000000000..5e9ebc5947d --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/postgres_project.py @@ -0,0 +1,193 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.postgres_projects._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.postgres_projects._models.permission import ( + Permission, + PermissionParam, +) +from databricks.bundles.postgres_projects._models.project_custom_tag import ( + ProjectCustomTag, + ProjectCustomTagParam, +) +from databricks.bundles.postgres_projects._models.project_default_endpoint_settings import ( + ProjectDefaultEndpointSettings, + ProjectDefaultEndpointSettingsParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresProject(Resource): + """""" + + project_id: VariableOr[str] + """ + The ID to use for the project; becomes the final component of the project's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `my-app` becomes `projects/my-app`. + """ + + budget_policy_id: VariableOrOptional[str] = None + """ + The desired budget policy to associate with the project. + See status.budget_policy_id for the policy that is actually applied to the project. + """ + + custom_tags: VariableOrList[ProjectCustomTag] = field(default_factory=list) + """ + Custom tags to associate with the project, used for billing and cost tracking. + To update tags, provide the new tag list and include "spec.custom_tags" in the update_mask. + To clear all tags, provide an empty list and include "spec.custom_tags" in the update_mask. + To preserve existing tags, omit this field from the update_mask (or use wildcard "*" which auto-excludes empty tags). + """ + + default_branch: VariableOrOptional[str] = None + """ + The full resource path of the default branch of the project. + Format: projects/{project_id}/branches/{branch_id} + At creation time, the branch ID in this path names the initial branch, which is called + `production` when the field is omitted. On update, the path must name an existing branch of this + project, which then becomes the default branch. + """ + + default_endpoint_settings: VariableOrOptional[ProjectDefaultEndpointSettings] = None + """ + Settings applied by default to compute endpoints created in this project. The initial endpoint + also takes these values for any setting that initial_endpoint_spec does not provide. + """ + + display_name: VariableOrOptional[str] = None + """ + Human-readable project name. Length should be between 1 and 256 characters. + """ + + enable_pg_native_login: VariableOrOptional[bool] = None + """ + Whether to enable PG native password login on all endpoints in this project. Defaults to false. + """ + + history_retention_duration: VariableOrOptional[str] = None + """ + The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days). + Defaults to 604800s (7 days) when omitted. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[Permission] = field(default_factory=list) + """ + The permissions to apply to this resource. + """ + + pg_version: VariableOrOptional[int] = None + """ + The major Postgres version number. Defaults to 17 when omitted. The set of versions that new + projects can use may change over time. + """ + + purge_on_delete: VariableOrOptional[bool] = None + """ + When true, permanently delete the project when the bundle is destroyed. When false or unset, the project is soft deleted and can be restored within its retention window. + """ + + @classmethod + def from_dict(cls, value: "PostgresProjectDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresProjectDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresProjectDict(TypedDict, total=False): + """""" + + project_id: VariableOr[str] + """ + The ID to use for the project; becomes the final component of the project's resource name. Must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, `my-app` becomes `projects/my-app`. + """ + + budget_policy_id: VariableOrOptional[str] + """ + The desired budget policy to associate with the project. + See status.budget_policy_id for the policy that is actually applied to the project. + """ + + custom_tags: VariableOrList[ProjectCustomTagParam] + """ + Custom tags to associate with the project, used for billing and cost tracking. + To update tags, provide the new tag list and include "spec.custom_tags" in the update_mask. + To clear all tags, provide an empty list and include "spec.custom_tags" in the update_mask. + To preserve existing tags, omit this field from the update_mask (or use wildcard "*" which auto-excludes empty tags). + """ + + default_branch: VariableOrOptional[str] + """ + The full resource path of the default branch of the project. + Format: projects/{project_id}/branches/{branch_id} + At creation time, the branch ID in this path names the initial branch, which is called + `production` when the field is omitted. On update, the path must name an existing branch of this + project, which then becomes the default branch. + """ + + default_endpoint_settings: VariableOrOptional[ProjectDefaultEndpointSettingsParam] + """ + Settings applied by default to compute endpoints created in this project. The initial endpoint + also takes these values for any setting that initial_endpoint_spec does not provide. + """ + + display_name: VariableOrOptional[str] + """ + Human-readable project name. Length should be between 1 and 256 characters. + """ + + enable_pg_native_login: VariableOrOptional[bool] + """ + Whether to enable PG native password login on all endpoints in this project. Defaults to false. + """ + + history_retention_duration: VariableOrOptional[str] + """ + The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days). + Defaults to 604800s (7 days) when omitted. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + permissions: VariableOrList[PermissionParam] + """ + The permissions to apply to this resource. + """ + + pg_version: VariableOrOptional[int] + """ + The major Postgres version number. Defaults to 17 when omitted. The set of versions that new + projects can use may change over time. + """ + + purge_on_delete: VariableOrOptional[bool] + """ + When true, permanently delete the project when the bundle is destroyed. When false or unset, the project is soft deleted and can be restored within its retention window. + """ + + +PostgresProjectParam = PostgresProjectDict | PostgresProject diff --git a/python/databricks/bundles/postgres_projects/_models/project_custom_tag.py b/python/databricks/bundles/postgres_projects/_models/project_custom_tag.py new file mode 100644 index 00000000000..a74c8c2dc73 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/project_custom_tag.py @@ -0,0 +1,50 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ProjectCustomTag: + """""" + + key: VariableOrOptional[str] = None + """ + The key of the custom tag. + """ + + value: VariableOrOptional[str] = None + """ + The value of the custom tag. + """ + + @classmethod + def from_dict(cls, value: "ProjectCustomTagDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ProjectCustomTagDict": + return _transform_to_json_value(self) # type:ignore + + +class ProjectCustomTagDict(TypedDict, total=False): + """""" + + key: VariableOrOptional[str] + """ + The key of the custom tag. + """ + + value: VariableOrOptional[str] + """ + The value of the custom tag. + """ + + +ProjectCustomTagParam = ProjectCustomTagDict | ProjectCustomTag diff --git a/python/databricks/bundles/postgres_projects/_models/project_default_endpoint_settings.py b/python/databricks/bundles/postgres_projects/_models/project_default_endpoint_settings.py new file mode 100644 index 00000000000..4742e330cd3 --- /dev/null +++ b/python/databricks/bundles/postgres_projects/_models/project_default_endpoint_settings.py @@ -0,0 +1,92 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrDict, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ProjectDefaultEndpointSettings: + """ + A collection of settings for a compute endpoint. + """ + + autoscaling_limit_max_cu: VariableOrOptional[float] = None + """ + The maximum number of Compute Units. Minimum value is 0.5. + """ + + autoscaling_limit_min_cu: VariableOrOptional[float] = None + """ + The minimum number of Compute Units. Minimum value is 0.5. + """ + + no_suspension: VariableOrOptional[bool] = None + """ + When set to true, explicitly disables automatic suspension (never suspend). + Should be set to true when provided. + Mutually exclusive with `suspend_timeout_duration`. + """ + + pg_settings: VariableOrDict[str] = field(default_factory=dict) + """ + A raw representation of Postgres settings. + """ + + suspend_timeout_duration: VariableOrOptional[str] = None + """ + Duration of inactivity after which the compute endpoint is automatically suspended. + If specified should be between 60s and 604800s (1 minute to 1 week). + Mutually exclusive with `no_suspension`. + """ + + @classmethod + def from_dict(cls, value: "ProjectDefaultEndpointSettingsDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ProjectDefaultEndpointSettingsDict": + return _transform_to_json_value(self) # type:ignore + + +class ProjectDefaultEndpointSettingsDict(TypedDict, total=False): + """""" + + autoscaling_limit_max_cu: VariableOrOptional[float] + """ + The maximum number of Compute Units. Minimum value is 0.5. + """ + + autoscaling_limit_min_cu: VariableOrOptional[float] + """ + The minimum number of Compute Units. Minimum value is 0.5. + """ + + no_suspension: VariableOrOptional[bool] + """ + When set to true, explicitly disables automatic suspension (never suspend). + Should be set to true when provided. + Mutually exclusive with `suspend_timeout_duration`. + """ + + pg_settings: VariableOrDict[str] + """ + A raw representation of Postgres settings. + """ + + suspend_timeout_duration: VariableOrOptional[str] + """ + Duration of inactivity after which the compute endpoint is automatically suspended. + If specified should be between 60s and 604800s (1 minute to 1 week). + Mutually exclusive with `no_suspension`. + """ + + +ProjectDefaultEndpointSettingsParam = ( + ProjectDefaultEndpointSettingsDict | ProjectDefaultEndpointSettings +) diff --git a/python/databricks/bundles/postgres_roles/__init__.py b/python/databricks/bundles/postgres_roles/__init__.py new file mode 100644 index 00000000000..f9735fc7b9f --- /dev/null +++ b/python/databricks/bundles/postgres_roles/__init__.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "PostgresRole", + "PostgresRoleDict", + "PostgresRoleParam", + "RoleAttributes", + "RoleAttributesDict", + "RoleAttributesParam", + "RoleAuthMethod", + "RoleAuthMethodParam", + "RoleIdentityType", + "RoleIdentityTypeParam", + "RoleMembershipRole", + "RoleMembershipRoleParam", +] + + +from databricks.bundles.postgres_roles._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_roles._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_roles._models.postgres_role import ( + PostgresRole, + PostgresRoleDict, + PostgresRoleParam, +) +from databricks.bundles.postgres_roles._models.role_attributes import ( + RoleAttributes, + RoleAttributesDict, + RoleAttributesParam, +) +from databricks.bundles.postgres_roles._models.role_auth_method import ( + RoleAuthMethod, + RoleAuthMethodParam, +) +from databricks.bundles.postgres_roles._models.role_identity_type import ( + RoleIdentityType, + RoleIdentityTypeParam, +) +from databricks.bundles.postgres_roles._models.role_membership_role import ( + RoleMembershipRole, + RoleMembershipRoleParam, +) diff --git a/python/databricks/bundles/postgres_roles/_models/depends_on.py b/python/databricks/bundles/postgres_roles/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_roles/_models/lifecycle.py b/python/databricks/bundles/postgres_roles/_models/lifecycle.py new file mode 100644 index 00000000000..39d6f2e1586 --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_roles._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_roles/_models/postgres_role.py b/python/databricks/bundles/postgres_roles/_models/postgres_role.py new file mode 100644 index 00000000000..7ab2e6a7a7d --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/postgres_role.py @@ -0,0 +1,145 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.postgres_roles._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.postgres_roles._models.role_attributes import ( + RoleAttributes, + RoleAttributesParam, +) +from databricks.bundles.postgres_roles._models.role_auth_method import ( + RoleAuthMethod, + RoleAuthMethodParam, +) +from databricks.bundles.postgres_roles._models.role_identity_type import ( + RoleIdentityType, + RoleIdentityTypeParam, +) +from databricks.bundles.postgres_roles._models.role_membership_role import ( + RoleMembershipRole, + RoleMembershipRoleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresRole(Resource): + """""" + + parent: VariableOr[str] + """ + The branch where this role is created. Format projects/{project_id}/branches/{branch_id}. + """ + + role_id: VariableOr[str] + """ + The user-specified role ID; becomes the final component of the role's resource name. Must be 4-63 characters, lowercase letters, numbers, and hyphens (RFC 1123). + """ + + attributes: VariableOrOptional[RoleAttributes] = None + """ + The desired API-exposed Postgres role attributes to associate with the role. + """ + + auth_method: VariableOrOptional[RoleAuthMethod] = None + """ + How the role is authenticated when connecting to Postgres. If left unspecified, a meaningful authentication method is derived from the identity_type. + """ + + identity_type: VariableOrOptional[RoleIdentityType] = None + """ + The type of the Databricks managed identity that this Role represents. Leave empty to create a regular Postgres role not associated with a Databricks identity. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + membership_roles: VariableOrList[RoleMembershipRole] = field(default_factory=list) + """ + Standard roles that this role is a member of. + """ + + postgres_role: VariableOrOptional[str] = None + """ + The name of the Postgres role. Required when creating the role. + """ + + replace_existing: VariableOrOptional[bool] = None + """ + When true, take over an existing role with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a role that already exists on the branch (for example, one inherited from the parent branch) under bundle management. Only takes effect when the role is created. + """ + + @classmethod + def from_dict(cls, value: "PostgresRoleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresRoleDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresRoleDict(TypedDict, total=False): + """""" + + parent: VariableOr[str] + """ + The branch where this role is created. Format projects/{project_id}/branches/{branch_id}. + """ + + role_id: VariableOr[str] + """ + The user-specified role ID; becomes the final component of the role's resource name. Must be 4-63 characters, lowercase letters, numbers, and hyphens (RFC 1123). + """ + + attributes: VariableOrOptional[RoleAttributesParam] + """ + The desired API-exposed Postgres role attributes to associate with the role. + """ + + auth_method: VariableOrOptional[RoleAuthMethodParam] + """ + How the role is authenticated when connecting to Postgres. If left unspecified, a meaningful authentication method is derived from the identity_type. + """ + + identity_type: VariableOrOptional[RoleIdentityTypeParam] + """ + The type of the Databricks managed identity that this Role represents. Leave empty to create a regular Postgres role not associated with a Databricks identity. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + membership_roles: VariableOrList[RoleMembershipRoleParam] + """ + Standard roles that this role is a member of. + """ + + postgres_role: VariableOrOptional[str] + """ + The name of the Postgres role. Required when creating the role. + """ + + replace_existing: VariableOrOptional[bool] + """ + When true, take over an existing role with the same ID instead of failing with an ALREADY_EXISTS error. Use it to bring a role that already exists on the branch (for example, one inherited from the parent branch) under bundle management. Only takes effect when the role is created. + """ + + +PostgresRoleParam = PostgresRoleDict | PostgresRole diff --git a/python/databricks/bundles/postgres_roles/_models/role_attributes.py b/python/databricks/bundles/postgres_roles/_models/role_attributes.py new file mode 100644 index 00000000000..496ce764b9a --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/role_attributes.py @@ -0,0 +1,65 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class RoleAttributes: + """ + Attributes that can be granted to a Postgres role. We are only implementing a subset for now, see xref: + https://www.postgresql.org/docs/16/sql-createrole.html + The values follow Postgres keyword naming e.g. CREATEDB, BYPASSRLS, etc. which is why they don't include typical + underscores between words. + """ + + bypassrls: VariableOrOptional[bool] = None + """ + Grants the Postgres `BYPASSRLS` attribute, which lets the role bypass every row-level security policy. + """ + + createdb: VariableOrOptional[bool] = None + """ + Grants the Postgres `CREATEDB` attribute, which lets the role create databases. + """ + + createrole: VariableOrOptional[bool] = None + """ + Grants the Postgres `CREATEROLE` attribute, which lets the role create, alter, and drop other roles. + """ + + @classmethod + def from_dict(cls, value: "RoleAttributesDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "RoleAttributesDict": + return _transform_to_json_value(self) # type:ignore + + +class RoleAttributesDict(TypedDict, total=False): + """""" + + bypassrls: VariableOrOptional[bool] + """ + Grants the Postgres `BYPASSRLS` attribute, which lets the role bypass every row-level security policy. + """ + + createdb: VariableOrOptional[bool] + """ + Grants the Postgres `CREATEDB` attribute, which lets the role create databases. + """ + + createrole: VariableOrOptional[bool] + """ + Grants the Postgres `CREATEROLE` attribute, which lets the role create, alter, and drop other roles. + """ + + +RoleAttributesParam = RoleAttributesDict | RoleAttributes diff --git a/python/databricks/bundles/postgres_roles/_models/role_auth_method.py b/python/databricks/bundles/postgres_roles/_models/role_auth_method.py new file mode 100644 index 00000000000..11d6903f0c0 --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/role_auth_method.py @@ -0,0 +1,20 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RoleAuthMethod(Enum): + """ + How the role is authenticated when connecting to Postgres. + """ + + NO_LOGIN = "NO_LOGIN" + PG_PASSWORD_SCRAM_SHA_256 = "PG_PASSWORD_SCRAM_SHA_256" + LAKEBASE_OAUTH_V1 = "LAKEBASE_OAUTH_V1" + + +RoleAuthMethodParam = ( + Literal["NO_LOGIN", "PG_PASSWORD_SCRAM_SHA_256", "LAKEBASE_OAUTH_V1"] + | RoleAuthMethod +) diff --git a/python/databricks/bundles/postgres_roles/_models/role_identity_type.py b/python/databricks/bundles/postgres_roles/_models/role_identity_type.py new file mode 100644 index 00000000000..780831ae4ee --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/role_identity_type.py @@ -0,0 +1,18 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RoleIdentityType(Enum): + """ + The type of the Databricks managed identity that this Role represents. + Leave empty if you wish to create a regular Postgres role not associated with a Databricks identity. + """ + + USER = "USER" + SERVICE_PRINCIPAL = "SERVICE_PRINCIPAL" + GROUP = "GROUP" + + +RoleIdentityTypeParam = Literal["USER", "SERVICE_PRINCIPAL", "GROUP"] | RoleIdentityType diff --git a/python/databricks/bundles/postgres_roles/_models/role_membership_role.py b/python/databricks/bundles/postgres_roles/_models/role_membership_role.py new file mode 100644 index 00000000000..20dbfaf8e4b --- /dev/null +++ b/python/databricks/bundles/postgres_roles/_models/role_membership_role.py @@ -0,0 +1,15 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class RoleMembershipRole(Enum): + """ + Roles that the DatabaseInstanceRole can be a member of. + """ + + DATABRICKS_SUPERUSER = "DATABRICKS_SUPERUSER" + + +RoleMembershipRoleParam = Literal["DATABRICKS_SUPERUSER"] | RoleMembershipRole diff --git a/python/databricks/bundles/postgres_snapshot_schedules/__init__.py b/python/databricks/bundles/postgres_snapshot_schedules/__init__.py new file mode 100644 index 00000000000..44e735929d5 --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/__init__.py @@ -0,0 +1,68 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DailySchedule", + "DailyScheduleDict", + "DailyScheduleParam", + "DayOfWeek", + "DayOfWeekParam", + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "MonthlySchedule", + "MonthlyScheduleDict", + "MonthlyScheduleParam", + "PostgresSnapshotSchedule", + "PostgresSnapshotScheduleDict", + "PostgresSnapshotScheduleParam", + "ScheduleCadence", + "ScheduleCadenceDict", + "ScheduleCadenceParam", + "WeeklySchedule", + "WeeklyScheduleDict", + "WeeklyScheduleParam", +] + + +from databricks.bundles.postgres_snapshot_schedules._models.daily_schedule import ( + DailySchedule, + DailyScheduleDict, + DailyScheduleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.day_of_week import ( + DayOfWeek, + DayOfWeekParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.monthly_schedule import ( + MonthlySchedule, + MonthlyScheduleDict, + MonthlyScheduleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.postgres_snapshot_schedule import ( + PostgresSnapshotSchedule, + PostgresSnapshotScheduleDict, + PostgresSnapshotScheduleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.schedule_cadence import ( + ScheduleCadence, + ScheduleCadenceDict, + ScheduleCadenceParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.weekly_schedule import ( + WeeklySchedule, + WeeklyScheduleDict, + WeeklyScheduleParam, +) diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/daily_schedule.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/daily_schedule.py new file mode 100644 index 00000000000..507eabea0d5 --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/daily_schedule.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DailySchedule: + """ + Take a snapshot once per day, at the configured hour. + """ + + hour: VariableOrOptional[int] = None + """ + The hour of the day, in UTC, at which to take the snapshot, in [0, 23]. + """ + + @classmethod + def from_dict(cls, value: "DailyScheduleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DailyScheduleDict": + return _transform_to_json_value(self) # type:ignore + + +class DailyScheduleDict(TypedDict, total=False): + """""" + + hour: VariableOrOptional[int] + """ + The hour of the day, in UTC, at which to take the snapshot, in [0, 23]. + """ + + +DailyScheduleParam = DailyScheduleDict | DailySchedule diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/day_of_week.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/day_of_week.py new file mode 100644 index 00000000000..7a546b0bb06 --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/day_of_week.py @@ -0,0 +1,26 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class DayOfWeek(Enum): + """ + The day of the week on which a weekly snapshot is taken. + """ + + MONDAY = "MONDAY" + TUESDAY = "TUESDAY" + WEDNESDAY = "WEDNESDAY" + THURSDAY = "THURSDAY" + FRIDAY = "FRIDAY" + SATURDAY = "SATURDAY" + SUNDAY = "SUNDAY" + + +DayOfWeekParam = ( + Literal[ + "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" + ] + | DayOfWeek +) diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/depends_on.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/lifecycle.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/lifecycle.py new file mode 100644 index 00000000000..46631673e17 --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_snapshot_schedules._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/monthly_schedule.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/monthly_schedule.py new file mode 100644 index 00000000000..0eba63c182d --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/monthly_schedule.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class MonthlySchedule: + """ + Take a snapshot once per month, on the configured day at the configured hour. + """ + + day: VariableOr[int] + """ + The day of the month on which to take the snapshot, in [1, 31]. In shorter + months the snapshot is taken on the last day instead (day 31 runs on Feb 28 + or 29, and on Apr 30), so every month gets exactly one snapshot. + """ + + hour: VariableOrOptional[int] = None + """ + The hour of the day, in UTC, at which to take the snapshot, in [0, 23]. + """ + + @classmethod + def from_dict(cls, value: "MonthlyScheduleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "MonthlyScheduleDict": + return _transform_to_json_value(self) # type:ignore + + +class MonthlyScheduleDict(TypedDict, total=False): + """""" + + day: VariableOr[int] + """ + The day of the month on which to take the snapshot, in [1, 31]. In shorter + months the snapshot is taken on the last day instead (day 31 runs on Feb 28 + or 29, and on Apr 30), so every month gets exactly one snapshot. + """ + + hour: VariableOrOptional[int] + """ + The hour of the day, in UTC, at which to take the snapshot, in [0, 23]. + """ + + +MonthlyScheduleParam = MonthlyScheduleDict | MonthlySchedule diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/postgres_snapshot_schedule.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/postgres_snapshot_schedule.py new file mode 100644 index 00000000000..cfa3baf67ff --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/postgres_snapshot_schedule.py @@ -0,0 +1,73 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.postgres_snapshot_schedules._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.schedule_cadence import ( + ScheduleCadence, + ScheduleCadenceParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresSnapshotSchedule(Resource): + """""" + + branch: VariableOr[str] + """ + The branch whose automatic-snapshot schedule this manages. Format: projects/{project_id}/branches/{branch_id} + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + schedule: VariableOrList[ScheduleCadence] = field(default_factory=list) + """ + The cadences at which automatic snapshots are taken. An empty set disables automatic snapshots. When several cadences fire together, one snapshot is taken and retained for the longest of their retentions. + """ + + @classmethod + def from_dict(cls, value: "PostgresSnapshotScheduleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresSnapshotScheduleDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresSnapshotScheduleDict(TypedDict, total=False): + """""" + + branch: VariableOr[str] + """ + The branch whose automatic-snapshot schedule this manages. Format: projects/{project_id}/branches/{branch_id} + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + schedule: VariableOrList[ScheduleCadenceParam] + """ + The cadences at which automatic snapshots are taken. An empty set disables automatic snapshots. When several cadences fire together, one snapshot is taken and retained for the longest of their retentions. + """ + + +PostgresSnapshotScheduleParam = PostgresSnapshotScheduleDict | PostgresSnapshotSchedule diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/schedule_cadence.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/schedule_cadence.py new file mode 100644 index 00000000000..438edfe4c5f --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/schedule_cadence.py @@ -0,0 +1,88 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_snapshot_schedules._models.daily_schedule import ( + DailySchedule, + DailyScheduleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.monthly_schedule import ( + MonthlySchedule, + MonthlyScheduleParam, +) +from databricks.bundles.postgres_snapshot_schedules._models.weekly_schedule import ( + WeeklySchedule, + WeeklyScheduleParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class ScheduleCadence: + """ + One cadence at which automatic snapshots are taken. + """ + + retention: VariableOr[str] + """ + How long snapshots from this cadence are kept before automatic deletion. + Must be at least 1 hour. Applied when a snapshot is taken; not retroactive, + so changing it affects only later snapshots. + """ + + daily_schedule: VariableOrOptional[DailySchedule] = None + """ + Take a snapshot once per day. + """ + + monthly_schedule: VariableOrOptional[MonthlySchedule] = None + """ + Take a snapshot once per month. + """ + + weekly_schedule: VariableOrOptional[WeeklySchedule] = None + """ + Take a snapshot once per week. + """ + + @classmethod + def from_dict(cls, value: "ScheduleCadenceDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "ScheduleCadenceDict": + return _transform_to_json_value(self) # type:ignore + + +class ScheduleCadenceDict(TypedDict, total=False): + """""" + + retention: VariableOr[str] + """ + How long snapshots from this cadence are kept before automatic deletion. + Must be at least 1 hour. Applied when a snapshot is taken; not retroactive, + so changing it affects only later snapshots. + """ + + daily_schedule: VariableOrOptional[DailyScheduleParam] + """ + Take a snapshot once per day. + """ + + monthly_schedule: VariableOrOptional[MonthlyScheduleParam] + """ + Take a snapshot once per month. + """ + + weekly_schedule: VariableOrOptional[WeeklyScheduleParam] + """ + Take a snapshot once per week. + """ + + +ScheduleCadenceParam = ScheduleCadenceDict | ScheduleCadence diff --git a/python/databricks/bundles/postgres_snapshot_schedules/_models/weekly_schedule.py b/python/databricks/bundles/postgres_snapshot_schedules/_models/weekly_schedule.py new file mode 100644 index 00000000000..dec3281b0d6 --- /dev/null +++ b/python/databricks/bundles/postgres_snapshot_schedules/_models/weekly_schedule.py @@ -0,0 +1,56 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_snapshot_schedules._models.day_of_week import ( + DayOfWeek, + DayOfWeekParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class WeeklySchedule: + """ + Take a snapshot once per week, on the configured day at the configured hour. + """ + + day_of_week: VariableOr[DayOfWeek] + """ + The day of the week on which to take the snapshot. + """ + + hour: VariableOrOptional[int] = None + """ + The hour of the day, in UTC, at which to take the snapshot, in [0, 23]. + """ + + @classmethod + def from_dict(cls, value: "WeeklyScheduleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "WeeklyScheduleDict": + return _transform_to_json_value(self) # type:ignore + + +class WeeklyScheduleDict(TypedDict, total=False): + """""" + + day_of_week: VariableOr[DayOfWeekParam] + """ + The day of the week on which to take the snapshot. + """ + + hour: VariableOrOptional[int] + """ + The hour of the day, in UTC, at which to take the snapshot, in [0, 23]. + """ + + +WeeklyScheduleParam = WeeklyScheduleDict | WeeklySchedule diff --git a/python/databricks/bundles/postgres_synced_tables/__init__.py b/python/databricks/bundles/postgres_synced_tables/__init__.py new file mode 100644 index 00000000000..9cc9008d288 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/__init__.py @@ -0,0 +1,78 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +__all__ = [ + "DependsOn", + "DependsOnDict", + "DependsOnParam", + "Lifecycle", + "LifecycleDict", + "LifecycleParam", + "NewPipelineSpec", + "NewPipelineSpecDict", + "NewPipelineSpecParam", + "NewPipelineSpecPipelineChannel", + "NewPipelineSpecPipelineChannelParam", + "PostgresSyncedTable", + "PostgresSyncedTableDict", + "PostgresSyncedTableParam", + "SyncedTableSyncedTableSpecExtraColumn", + "SyncedTableSyncedTableSpecExtraColumnDict", + "SyncedTableSyncedTableSpecExtraColumnMaintenance", + "SyncedTableSyncedTableSpecExtraColumnMaintenanceParam", + "SyncedTableSyncedTableSpecExtraColumnParam", + "SyncedTableSyncedTableSpecPgSpecificType", + "SyncedTableSyncedTableSpecPgSpecificTypeParam", + "SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy", + "SyncedTableSyncedTableSpecSyncedTableSchedulingPolicyParam", + "SyncedTableSyncedTableSpecTypeOverride", + "SyncedTableSyncedTableSpecTypeOverrideDict", + "SyncedTableSyncedTableSpecTypeOverrideParam", +] + + +from databricks.bundles.postgres_synced_tables._models.depends_on import ( + DependsOn, + DependsOnDict, + DependsOnParam, +) +from databricks.bundles.postgres_synced_tables._models.lifecycle import ( + Lifecycle, + LifecycleDict, + LifecycleParam, +) +from databricks.bundles.postgres_synced_tables._models.new_pipeline_spec import ( + NewPipelineSpec, + NewPipelineSpecDict, + NewPipelineSpecParam, +) +from databricks.bundles.postgres_synced_tables._models.new_pipeline_spec_pipeline_channel import ( + NewPipelineSpecPipelineChannel, + NewPipelineSpecPipelineChannelParam, +) +from databricks.bundles.postgres_synced_tables._models.postgres_synced_table import ( + PostgresSyncedTable, + PostgresSyncedTableDict, + PostgresSyncedTableParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_extra_column import ( + SyncedTableSyncedTableSpecExtraColumn, + SyncedTableSyncedTableSpecExtraColumnDict, + SyncedTableSyncedTableSpecExtraColumnParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_extra_column_maintenance import ( + SyncedTableSyncedTableSpecExtraColumnMaintenance, + SyncedTableSyncedTableSpecExtraColumnMaintenanceParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_pg_specific_type import ( + SyncedTableSyncedTableSpecPgSpecificType, + SyncedTableSyncedTableSpecPgSpecificTypeParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_synced_table_scheduling_policy import ( + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy, + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicyParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_type_override import ( + SyncedTableSyncedTableSpecTypeOverride, + SyncedTableSyncedTableSpecTypeOverrideDict, + SyncedTableSyncedTableSpecTypeOverrideParam, +) diff --git a/python/databricks/bundles/postgres_synced_tables/_models/depends_on.py b/python/databricks/bundles/postgres_synced_tables/_models/depends_on.py new file mode 100644 index 00000000000..d97ccb11fc4 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/depends_on.py @@ -0,0 +1,40 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class DependsOn: + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + @classmethod + def from_dict(cls, value: "DependsOnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "DependsOnDict": + return _transform_to_json_value(self) # type:ignore + + +class DependsOnDict(TypedDict, total=False): + """""" + + resource: VariableOr[str] + """ + Key of the resource to depend on, as `foo` or `jobs.foo`, or of its grants or permissions, as `schemas.foo.grants`. + """ + + +DependsOnParam = DependsOnDict | DependsOn diff --git a/python/databricks/bundles/postgres_synced_tables/_models/lifecycle.py b/python/databricks/bundles/postgres_synced_tables/_models/lifecycle.py new file mode 100644 index 00000000000..25a9f90f734 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/lifecycle.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrList, VariableOrOptional +from databricks.bundles.postgres_synced_tables._models.depends_on import ( + DependsOn, + DependsOnParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class Lifecycle: + """""" + + depends_on: VariableOrList[DependsOn] = field(default_factory=list) + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] = None + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + @classmethod + def from_dict(cls, value: "LifecycleDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "LifecycleDict": + return _transform_to_json_value(self) # type:ignore + + +class LifecycleDict(TypedDict, total=False): + """""" + + depends_on: VariableOrList[DependsOnParam] + """ + Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering. + """ + + prevent_destroy: VariableOrOptional[bool] + """ + Lifecycle setting to prevent the resource from being destroyed. + """ + + +LifecycleParam = LifecycleDict | Lifecycle diff --git a/python/databricks/bundles/postgres_synced_tables/_models/new_pipeline_spec.py b/python/databricks/bundles/postgres_synced_tables/_models/new_pipeline_spec.py new file mode 100644 index 00000000000..3b31094692b --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/new_pipeline_spec.py @@ -0,0 +1,86 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOrOptional +from databricks.bundles.postgres_synced_tables._models.new_pipeline_spec_pipeline_channel import ( + NewPipelineSpecPipelineChannel, + NewPipelineSpecPipelineChannelParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class NewPipelineSpec: + """""" + + budget_policy_id: VariableOrOptional[str] = None + """ + Budget policy to set on the newly created pipeline. + """ + + pipeline_channel: VariableOrOptional[NewPipelineSpecPipelineChannel] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Release channel of the underlying pipeline's runtime. + Some source table configurations (e.g., read-time CDF) require PREVIEW. + Defaults to CURRENT if not specified. + """ + + storage_catalog: VariableOrOptional[str] = None + """ + UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be a standard catalog where the user has permissions to create Delta tables. + """ + + storage_schema: VariableOrOptional[str] = None + """ + UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be in the standard catalog where the user has permissions to create Delta tables. + """ + + @classmethod + def from_dict(cls, value: "NewPipelineSpecDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "NewPipelineSpecDict": + return _transform_to_json_value(self) # type:ignore + + +class NewPipelineSpecDict(TypedDict, total=False): + """""" + + budget_policy_id: VariableOrOptional[str] + """ + Budget policy to set on the newly created pipeline. + """ + + pipeline_channel: VariableOrOptional[NewPipelineSpecPipelineChannelParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Release channel of the underlying pipeline's runtime. + Some source table configurations (e.g., read-time CDF) require PREVIEW. + Defaults to CURRENT if not specified. + """ + + storage_catalog: VariableOrOptional[str] + """ + UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be a standard catalog where the user has permissions to create Delta tables. + """ + + storage_schema: VariableOrOptional[str] + """ + UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + This needs to be in the standard catalog where the user has permissions to create Delta tables. + """ + + +NewPipelineSpecParam = NewPipelineSpecDict | NewPipelineSpec diff --git a/python/databricks/bundles/postgres_synced_tables/_models/new_pipeline_spec_pipeline_channel.py b/python/databricks/bundles/postgres_synced_tables/_models/new_pipeline_spec_pipeline_channel.py new file mode 100644 index 00000000000..5fe450bd4c3 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/new_pipeline_spec_pipeline_channel.py @@ -0,0 +1,23 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class NewPipelineSpecPipelineChannel(Enum): + """ + :meta private: [EXPERIMENTAL] + + Release channel of the underlying pipeline's runtime. + PREVIEW provides early access to the latest features but may be less stable. + Some source table configurations (e.g., read-time CDF) require PREVIEW. + Defaults to CURRENT if not specified. + """ + + CURRENT = "CURRENT" + PREVIEW = "PREVIEW" + + +NewPipelineSpecPipelineChannelParam = ( + Literal["CURRENT", "PREVIEW"] | NewPipelineSpecPipelineChannel +) diff --git a/python/databricks/bundles/postgres_synced_tables/_models/postgres_synced_table.py b/python/databricks/bundles/postgres_synced_tables/_models/postgres_synced_table.py new file mode 100644 index 00000000000..326b960cd82 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/postgres_synced_table.py @@ -0,0 +1,265 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._resource import Resource +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import ( + VariableOr, + VariableOrList, + VariableOrOptional, +) +from databricks.bundles.postgres_synced_tables._models.lifecycle import ( + Lifecycle, + LifecycleParam, +) +from databricks.bundles.postgres_synced_tables._models.new_pipeline_spec import ( + NewPipelineSpec, + NewPipelineSpecParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_extra_column import ( + SyncedTableSyncedTableSpecExtraColumn, + SyncedTableSyncedTableSpecExtraColumnParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_synced_table_scheduling_policy import ( + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy, + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicyParam, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_type_override import ( + SyncedTableSyncedTableSpecTypeOverride, + SyncedTableSyncedTableSpecTypeOverrideParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class PostgresSyncedTable(Resource): + """""" + + synced_table_id: VariableOr[str] + """ + The ID to use for the synced table; becomes the final component of the synced table's resource name. It is the synced table name, a `{catalog}.{schema}.{table}` tuple of Unity Catalog entity names. + + It names both an online view in Unity Catalog, accessible through Lakehouse Federation, and a Postgres table named `{table}` in schema `{schema}` in the connected Postgres database. + """ + + accelerated_sync: VariableOrOptional[bool] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] When true, enables accelerated sync mode for the initial data load. + This significantly improves performance for large tables. + Requires workspace-level enablement through Lakebase Accelerated Sync preview. + """ + + branch: VariableOrOptional[str] = None + """ + The full resource name the branch associated with the table. + + Format: "projects/{project_id}/branches/{branch_id}". + """ + + create_database_objects_if_missing: VariableOrOptional[bool] = None + """ + If true, the synced table's logical database and schema resources in PG + will be created if they do not already exist. + The request will fail if this is false and the database/schema do not exist. + + Defaults to true if omitted. + """ + + existing_pipeline_id: VariableOrOptional[str] = None + """ + ID of an existing pipeline to bin-pack this synced table into. + At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + The pipeline used for the synced table is returned via the top level pipeline_id attribute. + """ + + extra_columns: VariableOrList[SyncedTableSyncedTableSpecExtraColumn] = field( + default_factory=list + ) + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Extra PostgreSQL-only columns to add to the synced table. + """ + + lifecycle: VariableOrOptional[Lifecycle] = None + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + new_pipeline_spec: VariableOrOptional[NewPipelineSpec] = None + """ + Specification for creating a new pipeline. + At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + The pipeline used for the synced table is returned via the top level pipeline_id attribute. + """ + + postgres_database: VariableOrOptional[str] = None + """ + The Postgres database name where the synced table will be created in. + + If this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred + from the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match. + + A value must be specified when creating a synced table inside a Standard Catalog. + """ + + primary_key_columns: VariableOrList[str] = field(default_factory=list) + """ + Primary Key columns to be used for data insert/update in the destination. + """ + + scheduling_policy: VariableOrOptional[ + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy + ] = None + """ + Scheduling policy of the underlying pipeline. + """ + + source_table_full_name: VariableOrOptional[str] = None + """ + Three-part (catalog, schema, table) name of the source Delta table. + + For the corresponding destination table, use any of the two: + + * synced_table_id used at the creation of the SyncedTable + * "name" consisting of "synced_tables/" prefix and the full name of the destination table. + """ + + timeseries_key: VariableOrOptional[str] = None + """ + Time series key to deduplicate (tie-break) rows with the same primary key. + """ + + type_overrides: VariableOrList[SyncedTableSyncedTableSpecTypeOverride] = field( + default_factory=list + ) + """ + Override the default Delta->PG type mapping for specific columns. + A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + """ + + @classmethod + def from_dict(cls, value: "PostgresSyncedTableDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "PostgresSyncedTableDict": + return _transform_to_json_value(self) # type:ignore + + +class PostgresSyncedTableDict(TypedDict, total=False): + """""" + + synced_table_id: VariableOr[str] + """ + The ID to use for the synced table; becomes the final component of the synced table's resource name. It is the synced table name, a `{catalog}.{schema}.{table}` tuple of Unity Catalog entity names. + + It names both an online view in Unity Catalog, accessible through Lakehouse Federation, and a Postgres table named `{table}` in schema `{schema}` in the connected Postgres database. + """ + + accelerated_sync: VariableOrOptional[bool] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] When true, enables accelerated sync mode for the initial data load. + This significantly improves performance for large tables. + Requires workspace-level enablement through Lakebase Accelerated Sync preview. + """ + + branch: VariableOrOptional[str] + """ + The full resource name the branch associated with the table. + + Format: "projects/{project_id}/branches/{branch_id}". + """ + + create_database_objects_if_missing: VariableOrOptional[bool] + """ + If true, the synced table's logical database and schema resources in PG + will be created if they do not already exist. + The request will fail if this is false and the database/schema do not exist. + + Defaults to true if omitted. + """ + + existing_pipeline_id: VariableOrOptional[str] + """ + ID of an existing pipeline to bin-pack this synced table into. + At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + The pipeline used for the synced table is returned via the top level pipeline_id attribute. + """ + + extra_columns: VariableOrList[SyncedTableSyncedTableSpecExtraColumnParam] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Extra PostgreSQL-only columns to add to the synced table. + """ + + lifecycle: VariableOrOptional[LifecycleParam] + """ + Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. + """ + + new_pipeline_spec: VariableOrOptional[NewPipelineSpecParam] + """ + Specification for creating a new pipeline. + At most one of existing_pipeline_id and new_pipeline_spec should be defined. + + The pipeline used for the synced table is returned via the top level pipeline_id attribute. + """ + + postgres_database: VariableOrOptional[str] + """ + The Postgres database name where the synced table will be created in. + + If this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred + from the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match. + + A value must be specified when creating a synced table inside a Standard Catalog. + """ + + primary_key_columns: VariableOrList[str] + """ + Primary Key columns to be used for data insert/update in the destination. + """ + + scheduling_policy: VariableOrOptional[ + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicyParam + ] + """ + Scheduling policy of the underlying pipeline. + """ + + source_table_full_name: VariableOrOptional[str] + """ + Three-part (catalog, schema, table) name of the source Delta table. + + For the corresponding destination table, use any of the two: + + * synced_table_id used at the creation of the SyncedTable + * "name" consisting of "synced_tables/" prefix and the full name of the destination table. + """ + + timeseries_key: VariableOrOptional[str] + """ + Time series key to deduplicate (tie-break) rows with the same primary key. + """ + + type_overrides: VariableOrList[SyncedTableSyncedTableSpecTypeOverrideParam] + """ + Override the default Delta->PG type mapping for specific columns. + A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + """ + + +PostgresSyncedTableParam = PostgresSyncedTableDict | PostgresSyncedTable diff --git a/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_extra_column.py b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_extra_column.py new file mode 100644 index 00000000000..4b8b009a8e8 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_extra_column.py @@ -0,0 +1,102 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_extra_column_maintenance import ( + SyncedTableSyncedTableSpecExtraColumnMaintenance, + SyncedTableSyncedTableSpecExtraColumnMaintenanceParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SyncedTableSyncedTableSpecExtraColumn: + """ + :meta private: [EXPERIMENTAL] + + An extra PostgreSQL column to add to the synced table. + """ + + column_name: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Name of the column. + """ + + column_type: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] PostgreSQL type of the column, for example "tsvector" or "vector(1024)". + """ + + compute: VariableOrOptional[str] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] SQL expression used to compute the column's value, for example + "to_tsvector('english', content)". + """ + + maintenance: VariableOrOptional[ + SyncedTableSyncedTableSpecExtraColumnMaintenance + ] = None + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] How the column's value is populated and kept up to date. + """ + + @classmethod + def from_dict(cls, value: "SyncedTableSyncedTableSpecExtraColumnDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SyncedTableSyncedTableSpecExtraColumnDict": + return _transform_to_json_value(self) # type:ignore + + +class SyncedTableSyncedTableSpecExtraColumnDict(TypedDict, total=False): + """""" + + column_name: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] Name of the column. + """ + + column_type: VariableOr[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] PostgreSQL type of the column, for example "tsvector" or "vector(1024)". + """ + + compute: VariableOrOptional[str] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] SQL expression used to compute the column's value, for example + "to_tsvector('english', content)". + """ + + maintenance: VariableOrOptional[ + SyncedTableSyncedTableSpecExtraColumnMaintenanceParam + ] + """ + :meta private: [EXPERIMENTAL] + + [Private Preview] How the column's value is populated and kept up to date. + """ + + +SyncedTableSyncedTableSpecExtraColumnParam = ( + SyncedTableSyncedTableSpecExtraColumnDict | SyncedTableSyncedTableSpecExtraColumn +) diff --git a/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_extra_column_maintenance.py b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_extra_column_maintenance.py new file mode 100644 index 00000000000..725a4c71972 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_extra_column_maintenance.py @@ -0,0 +1,19 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SyncedTableSyncedTableSpecExtraColumnMaintenance(Enum): + """ + :meta private: [EXPERIMENTAL] + + How the column's value is populated and kept up to date. + """ + + STORED_GENERATED = "STORED_GENERATED" + + +SyncedTableSyncedTableSpecExtraColumnMaintenanceParam = ( + Literal["STORED_GENERATED"] | SyncedTableSyncedTableSpecExtraColumnMaintenance +) diff --git a/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_pg_specific_type.py b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_pg_specific_type.py new file mode 100644 index 00000000000..39e8e5e30f4 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_pg_specific_type.py @@ -0,0 +1,24 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SyncedTableSyncedTableSpecPgSpecificType(Enum): + """ + PostgreSQL-specific target types that can override the default Delta-to-PG mapping. + """ + + PG_SPECIFIC_TYPE_VECTOR = "PG_SPECIFIC_TYPE_VECTOR" + PG_SPECIFIC_TYPE_HALFVEC = "PG_SPECIFIC_TYPE_HALFVEC" + PG_SPECIFIC_TYPE_VARCHAR = "PG_SPECIFIC_TYPE_VARCHAR" + + +SyncedTableSyncedTableSpecPgSpecificTypeParam = ( + Literal[ + "PG_SPECIFIC_TYPE_VECTOR", + "PG_SPECIFIC_TYPE_HALFVEC", + "PG_SPECIFIC_TYPE_VARCHAR", + ] + | SyncedTableSyncedTableSpecPgSpecificType +) diff --git a/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_synced_table_scheduling_policy.py b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_synced_table_scheduling_policy.py new file mode 100644 index 00000000000..0cc748ef5a8 --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_synced_table_scheduling_policy.py @@ -0,0 +1,20 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from enum import Enum +from typing import Literal + + +class SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy(Enum): + """ + Scheduling policy of the synced table's underlying pipeline. + """ + + CONTINUOUS = "CONTINUOUS" + TRIGGERED = "TRIGGERED" + SNAPSHOT = "SNAPSHOT" + + +SyncedTableSyncedTableSpecSyncedTableSchedulingPolicyParam = ( + Literal["CONTINUOUS", "TRIGGERED", "SNAPSHOT"] + | SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy +) diff --git a/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_type_override.py b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_type_override.py new file mode 100644 index 00000000000..8c992af98ff --- /dev/null +++ b/python/databricks/bundles/postgres_synced_tables/_models/synced_table_synced_table_spec_type_override.py @@ -0,0 +1,70 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from dataclasses import dataclass +from typing import TYPE_CHECKING, TypedDict + +from databricks.bundles.core._transform import _transform +from databricks.bundles.core._transform_to_json import _transform_to_json_value +from databricks.bundles.core._variable import VariableOr, VariableOrOptional +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_pg_specific_type import ( + SyncedTableSyncedTableSpecPgSpecificType, + SyncedTableSyncedTableSpecPgSpecificTypeParam, +) + +if TYPE_CHECKING: + from typing_extensions import Self + + +@dataclass(kw_only=True) +class SyncedTableSyncedTableSpecTypeOverride: + """ + Overrides the default Delta-to-PostgreSQL type mapping for a single column. + """ + + column_name: VariableOr[str] + """ + Name of the source column whose target PostgreSQL type should be overridden. + """ + + pg_type: VariableOr[SyncedTableSyncedTableSpecPgSpecificType] + """ + PostgreSQL-specific target type to use for the column. + """ + + size: VariableOrOptional[int] = None + """ + Size parameter for the target type, for types that take one (e.g. vector + dimension, varchar length). Required when the chosen pg_type needs a size. + """ + + @classmethod + def from_dict(cls, value: "SyncedTableSyncedTableSpecTypeOverrideDict") -> "Self": + return _transform(cls, value) + + def as_dict(self) -> "SyncedTableSyncedTableSpecTypeOverrideDict": + return _transform_to_json_value(self) # type:ignore + + +class SyncedTableSyncedTableSpecTypeOverrideDict(TypedDict, total=False): + """""" + + column_name: VariableOr[str] + """ + Name of the source column whose target PostgreSQL type should be overridden. + """ + + pg_type: VariableOr[SyncedTableSyncedTableSpecPgSpecificTypeParam] + """ + PostgreSQL-specific target type to use for the column. + """ + + size: VariableOrOptional[int] + """ + Size parameter for the target type, for types that take one (e.g. vector + dimension, varchar length). Required when the chosen pg_type needs a size. + """ + + +SyncedTableSyncedTableSpecTypeOverrideParam = ( + SyncedTableSyncedTableSpecTypeOverrideDict | SyncedTableSyncedTableSpecTypeOverride +) diff --git a/python/databricks_tests/core/_generated/__init__.py b/python/databricks_tests/core/_generated/__init__.py index 3382c34d83b..3fe308351ed 100644 --- a/python/databricks_tests/core/_generated/__init__.py +++ b/python/databricks_tests/core/_generated/__init__.py @@ -25,6 +25,15 @@ model_serving_endpoints, models, pipelines, + postgres_branches, + postgres_catalogs, + postgres_data_apis, + postgres_databases, + postgres_endpoints, + postgres_projects, + postgres_roles, + postgres_snapshot_schedules, + postgres_synced_tables, quality_monitors, registered_models, schemas, @@ -64,6 +73,15 @@ model_serving_endpoints._test_case(), models._test_case(), pipelines._test_case(), + postgres_branches._test_case(), + postgres_catalogs._test_case(), + postgres_data_apis._test_case(), + postgres_databases._test_case(), + postgres_endpoints._test_case(), + postgres_projects._test_case(), + postgres_roles._test_case(), + postgres_snapshot_schedules._test_case(), + postgres_synced_tables._test_case(), quality_monitors._test_case(), registered_models._test_case(), schemas._test_case(), diff --git a/python/databricks_tests/core/_generated/postgres_branches.py b/python/databricks_tests/core/_generated/postgres_branches.py new file mode 100644 index 00000000000..30d8afd8a63 --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_branches.py @@ -0,0 +1,25 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_branch_mutator +from databricks.bundles.core._generated.postgres_branches import _resource_type +from databricks.bundles.postgres_branches._models.lifecycle import Lifecycle +from databricks.bundles.postgres_branches._models.postgres_branch import PostgresBranch +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_branch, + dict_example={ + "branch_id": "branch_id", + "lifecycle": {}, + "parent": "parent", + }, + dataclass_example=PostgresBranch( + branch_id="branch_id", lifecycle=Lifecycle(), parent="parent" + ), + mutator=postgres_branch_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_catalogs.py b/python/databricks_tests/core/_generated/postgres_catalogs.py new file mode 100644 index 00000000000..026704c50a5 --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_catalogs.py @@ -0,0 +1,29 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_catalog_mutator +from databricks.bundles.core._generated.postgres_catalogs import _resource_type +from databricks.bundles.postgres_catalogs._models.lifecycle import Lifecycle +from databricks.bundles.postgres_catalogs._models.postgres_catalog import ( + PostgresCatalog, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_catalog, + dict_example={ + "catalog_id": "catalog_id", + "lifecycle": {}, + "postgres_database": "postgres_database", + }, + dataclass_example=PostgresCatalog( + catalog_id="catalog_id", + lifecycle=Lifecycle(), + postgres_database="postgres_database", + ), + mutator=postgres_catalog_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_data_apis.py b/python/databricks_tests/core/_generated/postgres_data_apis.py new file mode 100644 index 00000000000..24263d162c6 --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_data_apis.py @@ -0,0 +1,21 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_data_api_mutator +from databricks.bundles.core._generated.postgres_data_apis import _resource_type +from databricks.bundles.postgres_data_apis._models.lifecycle import Lifecycle +from databricks.bundles.postgres_data_apis._models.postgres_data_api import ( + PostgresDataApi, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_data_api, + dict_example={"lifecycle": {}, "parent": "parent"}, + dataclass_example=PostgresDataApi(lifecycle=Lifecycle(), parent="parent"), + mutator=postgres_data_api_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_databases.py b/python/databricks_tests/core/_generated/postgres_databases.py new file mode 100644 index 00000000000..6349be795cb --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_databases.py @@ -0,0 +1,31 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_database_mutator +from databricks.bundles.core._generated.postgres_databases import _resource_type +from databricks.bundles.postgres_databases._models.lifecycle import Lifecycle +from databricks.bundles.postgres_databases._models.postgres_database import ( + PostgresDatabase, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_database, + dict_example={ + "database_id": "database_id", + "lifecycle": {}, + "parent": "parent", + "role": "role", + }, + dataclass_example=PostgresDatabase( + database_id="database_id", + lifecycle=Lifecycle(), + parent="parent", + role="role", + ), + mutator=postgres_database_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_endpoints.py b/python/databricks_tests/core/_generated/postgres_endpoints.py new file mode 100644 index 00000000000..c9c0d92b73d --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_endpoints.py @@ -0,0 +1,42 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_endpoint_mutator +from databricks.bundles.core._generated.postgres_endpoints import _resource_type +from databricks.bundles.postgres_endpoints._models.endpoint_group_spec import ( + EndpointGroupSpec, +) +from databricks.bundles.postgres_endpoints._models.endpoint_settings import ( + EndpointSettings, +) +from databricks.bundles.postgres_endpoints._models.endpoint_type import EndpointType +from databricks.bundles.postgres_endpoints._models.lifecycle import Lifecycle +from databricks.bundles.postgres_endpoints._models.postgres_endpoint import ( + PostgresEndpoint, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_endpoint, + dict_example={ + "endpoint_id": "endpoint_id", + "endpoint_type": "ENDPOINT_TYPE_READ_WRITE", + "group": {"max": 0, "min": 0}, + "lifecycle": {}, + "parent": "parent", + "settings": {}, + }, + dataclass_example=PostgresEndpoint( + endpoint_id="endpoint_id", + endpoint_type=EndpointType.ENDPOINT_TYPE_READ_WRITE, + group=EndpointGroupSpec(max=0, min=0), + lifecycle=Lifecycle(), + parent="parent", + settings=EndpointSettings(), + ), + mutator=postgres_endpoint_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_projects.py b/python/databricks_tests/core/_generated/postgres_projects.py new file mode 100644 index 00000000000..af4c18298f9 --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_projects.py @@ -0,0 +1,43 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_project_mutator +from databricks.bundles.core._generated.postgres_projects import _resource_type +from databricks.bundles.postgres_projects._models.lifecycle import Lifecycle +from databricks.bundles.postgres_projects._models.permission import Permission +from databricks.bundles.postgres_projects._models.permission_level import ( + PermissionLevel, +) +from databricks.bundles.postgres_projects._models.postgres_project import ( + PostgresProject, +) +from databricks.bundles.postgres_projects._models.project_custom_tag import ( + ProjectCustomTag, +) +from databricks.bundles.postgres_projects._models.project_default_endpoint_settings import ( + ProjectDefaultEndpointSettings, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_project, + dict_example={ + "custom_tags": [{}], + "default_endpoint_settings": {}, + "lifecycle": {}, + "permissions": [{"level": "CAN_MANAGE"}], + "project_id": "project_id", + }, + dataclass_example=PostgresProject( + custom_tags=[ProjectCustomTag()], + default_endpoint_settings=ProjectDefaultEndpointSettings(), + lifecycle=Lifecycle(), + permissions=[Permission(level=PermissionLevel.CAN_MANAGE)], + project_id="project_id", + ), + mutator=postgres_project_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_roles.py b/python/databricks_tests/core/_generated/postgres_roles.py new file mode 100644 index 00000000000..6498f9cfeaf --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_roles.py @@ -0,0 +1,43 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_role_mutator +from databricks.bundles.core._generated.postgres_roles import _resource_type +from databricks.bundles.postgres_roles._models.lifecycle import Lifecycle +from databricks.bundles.postgres_roles._models.postgres_role import PostgresRole +from databricks.bundles.postgres_roles._models.role_attributes import RoleAttributes +from databricks.bundles.postgres_roles._models.role_auth_method import RoleAuthMethod +from databricks.bundles.postgres_roles._models.role_identity_type import ( + RoleIdentityType, +) +from databricks.bundles.postgres_roles._models.role_membership_role import ( + RoleMembershipRole, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_role, + dict_example={ + "attributes": {}, + "auth_method": "NO_LOGIN", + "identity_type": "USER", + "lifecycle": {}, + "membership_roles": ["DATABRICKS_SUPERUSER"], + "parent": "parent", + "role_id": "role_id", + }, + dataclass_example=PostgresRole( + attributes=RoleAttributes(), + auth_method=RoleAuthMethod.NO_LOGIN, + identity_type=RoleIdentityType.USER, + lifecycle=Lifecycle(), + membership_roles=[RoleMembershipRole.DATABRICKS_SUPERUSER], + parent="parent", + role_id="role_id", + ), + mutator=postgres_role_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_snapshot_schedules.py b/python/databricks_tests/core/_generated/postgres_snapshot_schedules.py new file mode 100644 index 00000000000..cb177cca5cc --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_snapshot_schedules.py @@ -0,0 +1,34 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_snapshot_schedule_mutator +from databricks.bundles.core._generated.postgres_snapshot_schedules import ( + _resource_type, +) +from databricks.bundles.postgres_snapshot_schedules._models.lifecycle import Lifecycle +from databricks.bundles.postgres_snapshot_schedules._models.postgres_snapshot_schedule import ( + PostgresSnapshotSchedule, +) +from databricks.bundles.postgres_snapshot_schedules._models.schedule_cadence import ( + ScheduleCadence, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_snapshot_schedule, + dict_example={ + "branch": "branch", + "lifecycle": {}, + "schedule": [{"retention": "3600s"}], + }, + dataclass_example=PostgresSnapshotSchedule( + branch="branch", + lifecycle=Lifecycle(), + schedule=[ScheduleCadence(retention="3600s")], + ), + mutator=postgres_snapshot_schedule_mutator, + ), + _resource_type(), + ) diff --git a/python/databricks_tests/core/_generated/postgres_synced_tables.py b/python/databricks_tests/core/_generated/postgres_synced_tables.py new file mode 100644 index 00000000000..fa57c51b19c --- /dev/null +++ b/python/databricks_tests/core/_generated/postgres_synced_tables.py @@ -0,0 +1,54 @@ +# Code generated by pydabs-codegen. DO NOT EDIT. + +from databricks.bundles.core import Resources, postgres_synced_table_mutator +from databricks.bundles.core._generated.postgres_synced_tables import _resource_type +from databricks.bundles.postgres_synced_tables._models.lifecycle import Lifecycle +from databricks.bundles.postgres_synced_tables._models.new_pipeline_spec import ( + NewPipelineSpec, +) +from databricks.bundles.postgres_synced_tables._models.postgres_synced_table import ( + PostgresSyncedTable, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_pg_specific_type import ( + SyncedTableSyncedTableSpecPgSpecificType, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_synced_table_scheduling_policy import ( + SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy, +) +from databricks.bundles.postgres_synced_tables._models.synced_table_synced_table_spec_type_override import ( + SyncedTableSyncedTableSpecTypeOverride, +) +from databricks_tests.core._resource_test_case import ResourceTestCase + + +def _test_case(): + return ( + ResourceTestCase( + add_resource=Resources.add_postgres_synced_table, + dict_example={ + "lifecycle": {}, + "new_pipeline_spec": {}, + "primary_key_columns": ["primary_key_columns"], + "scheduling_policy": "CONTINUOUS", + "synced_table_id": "synced_table_id", + "type_overrides": [ + {"column_name": "column_name", "pg_type": "PG_SPECIFIC_TYPE_VECTOR"} + ], + }, + dataclass_example=PostgresSyncedTable( + lifecycle=Lifecycle(), + new_pipeline_spec=NewPipelineSpec(), + primary_key_columns=["primary_key_columns"], + scheduling_policy=SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy.CONTINUOUS, + synced_table_id="synced_table_id", + type_overrides=[ + SyncedTableSyncedTableSpecTypeOverride( + column_name="column_name", + pg_type=SyncedTableSyncedTableSpecPgSpecificType.PG_SPECIFIC_TYPE_VECTOR, + ) + ], + ), + mutator=postgres_synced_table_mutator, + ), + _resource_type(), + ) diff --git a/python/docs/databricks.bundles.postgres_branches.rst b/python/docs/databricks.bundles.postgres_branches.rst new file mode 100644 index 00000000000..205a5c67c91 --- /dev/null +++ b/python/docs/databricks.bundles.postgres_branches.rst @@ -0,0 +1,11 @@ +Postgres Branches +=============================== + +.. currentmodule:: databricks.bundles.postgres_branches + +**Package:** ``databricks.bundles.postgres_branches`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_branches diff --git a/python/docs/databricks.bundles.postgres_catalogs.rst b/python/docs/databricks.bundles.postgres_catalogs.rst new file mode 100644 index 00000000000..c33d24c5ca4 --- /dev/null +++ b/python/docs/databricks.bundles.postgres_catalogs.rst @@ -0,0 +1,11 @@ +Postgres Catalogs +=============================== + +.. currentmodule:: databricks.bundles.postgres_catalogs + +**Package:** ``databricks.bundles.postgres_catalogs`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_catalogs diff --git a/python/docs/databricks.bundles.postgres_data_apis.rst b/python/docs/databricks.bundles.postgres_data_apis.rst new file mode 100644 index 00000000000..fb89de6f2c5 --- /dev/null +++ b/python/docs/databricks.bundles.postgres_data_apis.rst @@ -0,0 +1,11 @@ +Postgres Data Apis +=============================== + +.. currentmodule:: databricks.bundles.postgres_data_apis + +**Package:** ``databricks.bundles.postgres_data_apis`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_data_apis diff --git a/python/docs/databricks.bundles.postgres_databases.rst b/python/docs/databricks.bundles.postgres_databases.rst new file mode 100644 index 00000000000..3c883e4639f --- /dev/null +++ b/python/docs/databricks.bundles.postgres_databases.rst @@ -0,0 +1,11 @@ +Postgres Databases +=============================== + +.. currentmodule:: databricks.bundles.postgres_databases + +**Package:** ``databricks.bundles.postgres_databases`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_databases diff --git a/python/docs/databricks.bundles.postgres_endpoints.rst b/python/docs/databricks.bundles.postgres_endpoints.rst new file mode 100644 index 00000000000..6d62a3cf9c6 --- /dev/null +++ b/python/docs/databricks.bundles.postgres_endpoints.rst @@ -0,0 +1,11 @@ +Postgres Endpoints +=============================== + +.. currentmodule:: databricks.bundles.postgres_endpoints + +**Package:** ``databricks.bundles.postgres_endpoints`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_endpoints diff --git a/python/docs/databricks.bundles.postgres_projects.rst b/python/docs/databricks.bundles.postgres_projects.rst new file mode 100644 index 00000000000..15b812d0a6f --- /dev/null +++ b/python/docs/databricks.bundles.postgres_projects.rst @@ -0,0 +1,11 @@ +Postgres Projects +=============================== + +.. currentmodule:: databricks.bundles.postgres_projects + +**Package:** ``databricks.bundles.postgres_projects`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_projects diff --git a/python/docs/databricks.bundles.postgres_roles.rst b/python/docs/databricks.bundles.postgres_roles.rst new file mode 100644 index 00000000000..296a7c8dfcd --- /dev/null +++ b/python/docs/databricks.bundles.postgres_roles.rst @@ -0,0 +1,11 @@ +Postgres Roles +=============================== + +.. currentmodule:: databricks.bundles.postgres_roles + +**Package:** ``databricks.bundles.postgres_roles`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_roles diff --git a/python/docs/databricks.bundles.postgres_snapshot_schedules.rst b/python/docs/databricks.bundles.postgres_snapshot_schedules.rst new file mode 100644 index 00000000000..20108a34625 --- /dev/null +++ b/python/docs/databricks.bundles.postgres_snapshot_schedules.rst @@ -0,0 +1,11 @@ +Postgres Snapshot Schedules +=============================== + +.. currentmodule:: databricks.bundles.postgres_snapshot_schedules + +**Package:** ``databricks.bundles.postgres_snapshot_schedules`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_snapshot_schedules diff --git a/python/docs/databricks.bundles.postgres_synced_tables.rst b/python/docs/databricks.bundles.postgres_synced_tables.rst new file mode 100644 index 00000000000..230a67c104c --- /dev/null +++ b/python/docs/databricks.bundles.postgres_synced_tables.rst @@ -0,0 +1,11 @@ +Postgres Synced Tables +=============================== + +.. currentmodule:: databricks.bundles.postgres_synced_tables + +**Package:** ``databricks.bundles.postgres_synced_tables`` + +Classes +--------------- + +.. automodule:: databricks.bundles.postgres_synced_tables diff --git a/python/docs/index.rst b/python/docs/index.rst index fd443ec9e5d..49e9d946cbd 100644 --- a/python/docs/index.rst +++ b/python/docs/index.rst @@ -34,6 +34,15 @@ See `Bundle configuration in Python