From 13451feeb68fe814a94629b292be3fd3cc4827cd Mon Sep 17 00:00:00 2001 From: Krishnan9074 <114993913+Krishnan9074@users.noreply.github.com> Date: Tue, 6 May 2025 20:42:00 +0530 Subject: [PATCH 1/3] Add external_access_enabled parameter to Metastore API --- METASTORE_EXTERNAL_ACCESS.md | 35 ++++++++++++++++++++++++ service/catalog/metastores_usage_test.go | 1 + service/catalog/model.go | 4 +++ 3 files changed, 40 insertions(+) create mode 100644 METASTORE_EXTERNAL_ACCESS.md diff --git a/METASTORE_EXTERNAL_ACCESS.md b/METASTORE_EXTERNAL_ACCESS.md new file mode 100644 index 000000000..b44417760 --- /dev/null +++ b/METASTORE_EXTERNAL_ACCESS.md @@ -0,0 +1,35 @@ +# Metastore External Access Support +This change adds support for the external_access_enabled parameter in the Databricks Metastore API. + +## Changes Made + +1. Added the ExternalAccessEnabled field to the UpdateMetastore struct in service/catalog/model.go +2. Updated the test in service/catalog/metastores_usage_test.go to test the new field + +## API Documentation + +This implementation supports the external_access_enabled parameter as documented in the Databricks API documentation: +https://docs.databricks.com/api/workspace/metastores/update#external_access_enabled + +This parameter allows or prevents non-Databricks Runtime clients from directly accessing entities under the metastore. + +## Terraform Usage + +With this change, users can add the external_access_enabled parameter to Terraform resources that use the Metastore API: + +```hcl +resource "databricks_metastore" "this" { + name = "my-metastore" + storage_root = "s3://my-bucket/my-path" + external_access_enabled = true +} +``` + +Or when updating an existing metastore: + +```hcl +resource "databricks_metastore" "this" { + id = "metastore-id" + external_access_enabled = true +} +``` diff --git a/service/catalog/metastores_usage_test.go b/service/catalog/metastores_usage_test.go index 8304b2bbd..588880d09 100755 --- a/service/catalog/metastores_usage_test.go +++ b/service/catalog/metastores_usage_test.go @@ -227,6 +227,7 @@ func ExampleMetastoresAPI_Update_metastores() { _, err = w.Metastores.Update(ctx, catalog.UpdateMetastore{ Id: created.MetastoreId, + ExternalAccessEnabled: true, NewName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()), }) if err != nil { diff --git a/service/catalog/model.go b/service/catalog/model.go index d5bc4af35..27110bbbc 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -5572,6 +5572,10 @@ type UpdateMetastore struct { DeltaSharingRecipientTokenLifetimeInSeconds int64 `json:"delta_sharing_recipient_token_lifetime_in_seconds,omitempty"` // The scope of Delta Sharing enabled for the metastore. DeltaSharingScope UpdateMetastoreDeltaSharingScope `json:"delta_sharing_scope,omitempty"` + + // Whether to allow non-DBR clients to directly access entities under the + // metastore. + ExternalAccessEnabled bool `json:"external_access_enabled,omitempty"` // Unique ID of the metastore. Id string `json:"-" url:"-"` // New name for the metastore. From ceb3ac3b491565a78256eac784555faab4822614 Mon Sep 17 00:00:00 2001 From: Krishnan9074 <114993913+Krishnan9074@users.noreply.github.com> Date: Wed, 7 May 2025 15:29:19 +0530 Subject: [PATCH 2/3] Remove unnecessary METASTORE_EXTERNAL_ACCESS.md documentation file --- METASTORE_EXTERNAL_ACCESS.md | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 METASTORE_EXTERNAL_ACCESS.md diff --git a/METASTORE_EXTERNAL_ACCESS.md b/METASTORE_EXTERNAL_ACCESS.md deleted file mode 100644 index b44417760..000000000 --- a/METASTORE_EXTERNAL_ACCESS.md +++ /dev/null @@ -1,35 +0,0 @@ -# Metastore External Access Support -This change adds support for the external_access_enabled parameter in the Databricks Metastore API. - -## Changes Made - -1. Added the ExternalAccessEnabled field to the UpdateMetastore struct in service/catalog/model.go -2. Updated the test in service/catalog/metastores_usage_test.go to test the new field - -## API Documentation - -This implementation supports the external_access_enabled parameter as documented in the Databricks API documentation: -https://docs.databricks.com/api/workspace/metastores/update#external_access_enabled - -This parameter allows or prevents non-Databricks Runtime clients from directly accessing entities under the metastore. - -## Terraform Usage - -With this change, users can add the external_access_enabled parameter to Terraform resources that use the Metastore API: - -```hcl -resource "databricks_metastore" "this" { - name = "my-metastore" - storage_root = "s3://my-bucket/my-path" - external_access_enabled = true -} -``` - -Or when updating an existing metastore: - -```hcl -resource "databricks_metastore" "this" { - id = "metastore-id" - external_access_enabled = true -} -``` From 9fe0ad8c995f9b85c6af2c9b1e9028ad00c2fcb2 Mon Sep 17 00:00:00 2001 From: Krishnan9074 <114993913+Krishnan9074@users.noreply.github.com> Date: Thu, 8 May 2025 11:08:02 +0530 Subject: [PATCH 3/3] Update NEXT_CHANGELOG.md with ExternalAccessEnabled field addition --- NEXT_CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index b4585a98d..d3aaf9bd4 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -11,3 +11,4 @@ ### Internal Changes ### API Changes +* Added `ExternalAccessEnabled` field to `catalog.UpdateMetastore` struct to support controlling non-DBR client access to metastore entities.