From 1119681e0eb4887f810719b69ff9135671e8ff61 Mon Sep 17 00:00:00 2001 From: William Chau Date: Thu, 11 Aug 2022 14:01:23 -0700 Subject: [PATCH 1/4] initial --- databricks_cli/unity_catalog/api.py | 4 ++-- databricks_cli/unity_catalog/delta_sharing_cli.py | 8 ++++---- databricks_cli/unity_catalog/uc_service.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/databricks_cli/unity_catalog/api.py b/databricks_cli/unity_catalog/api.py index a66e4f7a..112eacab 100644 --- a/databricks_cli/unity_catalog/api.py +++ b/databricks_cli/unity_catalog/api.py @@ -192,8 +192,8 @@ def update_share_permissions(self, name, perm_spec): # Recipient APIs - def create_recipient(self, name, comment, sharing_code, allowed_ip_addresses): - return self.client.create_recipient(name, comment, sharing_code, allowed_ip_addresses) + def create_recipient(self, name, comment, global_metastore_id, allowed_ip_addresses): + return self.client.create_recipient(name, comment, global_metastore_id, allowed_ip_addresses) def list_recipients(self): return self.client.list_recipients() diff --git a/databricks_cli/unity_catalog/delta_sharing_cli.py b/databricks_cli/unity_catalog/delta_sharing_cli.py index 6672f3ac..d24fbfae 100644 --- a/databricks_cli/unity_catalog/delta_sharing_cli.py +++ b/databricks_cli/unity_catalog/delta_sharing_cli.py @@ -183,8 +183,8 @@ def delete_share_cli(api_client, name): @click.option('--name', required=True, help='Name of new recipient.') @click.option('--comment', default=None, required=False, help='Free-form text description.') -@click.option('--sharing-code', default=None, required=False, - help='A one-time sharing code shared by the data recipient offline.') +@click.option('--global-metastore-id', default=None, required=False, + help='The global UC metastore id provided by the data recipient offline.') @click.option('--allowed_ip_address', default=None, required=False, multiple=True, help=( 'IP address in CIDR notation that is allowed to use delta sharing. ' @@ -193,12 +193,12 @@ def delete_share_cli(api_client, name): @profile_option @eat_exceptions @provide_api_client -def create_recipient_cli(api_client, name, comment, sharing_code, allowed_ip_address): +def create_recipient_cli(api_client, name, comment, global_metastore_id, allowed_ip_address): """ Create a new recipient. """ recipient_json = UnityCatalogApi(api_client).create_recipient( - name, comment, sharing_code, allowed_ip_address) + name, comment, global_metastore_id, allowed_ip_address) click.echo(mc_pretty_format(recipient_json)) diff --git a/databricks_cli/unity_catalog/uc_service.py b/databricks_cli/unity_catalog/uc_service.py index 54c3d212..920cfee3 100644 --- a/databricks_cli/unity_catalog/uc_service.py +++ b/databricks_cli/unity_catalog/uc_service.py @@ -376,15 +376,15 @@ def update_share_permissions(self, name, perm_spec, headers=None): # Recipient Operations - def create_recipient(self, name, comment=None, sharing_code=None, + def create_recipient(self, name, comment=None, global_metastore_id=None, allowed_ip_addresses=None, headers=None): _data = { 'name': name, } if comment is not None: _data['comment'] = comment - if sharing_code is not None: - _data['sharing_code'] = sharing_code + if global_metastore_id is not None: + _data['data_recipient_global_metastore_id'] = global_metastore_id _data['authentication_type'] = 'DATABRICKS' else: _data['authentication_type'] = 'TOKEN' From 00cb7e81a48d9fe06256598f8871e72db332d42d Mon Sep 17 00:00:00 2001 From: William Chau Date: Thu, 11 Aug 2022 14:04:28 -0700 Subject: [PATCH 2/4] lint --- databricks_cli/unity_catalog/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/databricks_cli/unity_catalog/api.py b/databricks_cli/unity_catalog/api.py index 112eacab..a05fcfc5 100644 --- a/databricks_cli/unity_catalog/api.py +++ b/databricks_cli/unity_catalog/api.py @@ -193,7 +193,8 @@ def update_share_permissions(self, name, perm_spec): # Recipient APIs def create_recipient(self, name, comment, global_metastore_id, allowed_ip_addresses): - return self.client.create_recipient(name, comment, global_metastore_id, allowed_ip_addresses) + return self.client.create_recipient(name, comment, global_metastore_id, + allowed_ip_addresses) def list_recipients(self): return self.client.list_recipients() From 5c514f179deeb07d6a48b5156ab97d6d9b08c415 Mon Sep 17 00:00:00 2001 From: William Chau Date: Thu, 11 Aug 2022 15:25:18 -0700 Subject: [PATCH 3/4] sharing_id --- databricks_cli/unity_catalog/api.py | 5 ++--- databricks_cli/unity_catalog/delta_sharing_cli.py | 8 ++++---- databricks_cli/unity_catalog/uc_service.py | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/databricks_cli/unity_catalog/api.py b/databricks_cli/unity_catalog/api.py index a05fcfc5..908e0ba8 100644 --- a/databricks_cli/unity_catalog/api.py +++ b/databricks_cli/unity_catalog/api.py @@ -192,9 +192,8 @@ def update_share_permissions(self, name, perm_spec): # Recipient APIs - def create_recipient(self, name, comment, global_metastore_id, allowed_ip_addresses): - return self.client.create_recipient(name, comment, global_metastore_id, - allowed_ip_addresses) + def create_recipient(self, name, comment, sharing_id, allowed_ip_addresses): + return self.client.create_recipient(name, comment, sharing_id, allowed_ip_addresses) def list_recipients(self): return self.client.list_recipients() diff --git a/databricks_cli/unity_catalog/delta_sharing_cli.py b/databricks_cli/unity_catalog/delta_sharing_cli.py index d24fbfae..404f0ec7 100644 --- a/databricks_cli/unity_catalog/delta_sharing_cli.py +++ b/databricks_cli/unity_catalog/delta_sharing_cli.py @@ -183,8 +183,8 @@ def delete_share_cli(api_client, name): @click.option('--name', required=True, help='Name of new recipient.') @click.option('--comment', default=None, required=False, help='Free-form text description.') -@click.option('--global-metastore-id', default=None, required=False, - help='The global UC metastore id provided by the data recipient offline.') +@click.option('--sharing-id', default=None, required=False, + help='The sharing id provided by the data recipient offline.') @click.option('--allowed_ip_address', default=None, required=False, multiple=True, help=( 'IP address in CIDR notation that is allowed to use delta sharing. ' @@ -193,12 +193,12 @@ def delete_share_cli(api_client, name): @profile_option @eat_exceptions @provide_api_client -def create_recipient_cli(api_client, name, comment, global_metastore_id, allowed_ip_address): +def create_recipient_cli(api_client, name, comment, sharing_id, allowed_ip_address): """ Create a new recipient. """ recipient_json = UnityCatalogApi(api_client).create_recipient( - name, comment, global_metastore_id, allowed_ip_address) + name, comment, sharing_id, allowed_ip_address) click.echo(mc_pretty_format(recipient_json)) diff --git a/databricks_cli/unity_catalog/uc_service.py b/databricks_cli/unity_catalog/uc_service.py index 920cfee3..ea835c07 100644 --- a/databricks_cli/unity_catalog/uc_service.py +++ b/databricks_cli/unity_catalog/uc_service.py @@ -376,15 +376,15 @@ def update_share_permissions(self, name, perm_spec, headers=None): # Recipient Operations - def create_recipient(self, name, comment=None, global_metastore_id=None, + def create_recipient(self, name, comment=None, sharing_id=None, allowed_ip_addresses=None, headers=None): _data = { 'name': name, } if comment is not None: _data['comment'] = comment - if global_metastore_id is not None: - _data['data_recipient_global_metastore_id'] = global_metastore_id + if sharing_id is not None: + _data['data_recipient_global_metastore_id'] = sharing_id _data['authentication_type'] = 'DATABRICKS' else: _data['authentication_type'] = 'TOKEN' From de331485b1089c0b67d09b5dc811e705550ace45 Mon Sep 17 00:00:00 2001 From: William Chau Date: Thu, 11 Aug 2022 16:01:05 -0700 Subject: [PATCH 4/4] . --- databricks_cli/unity_catalog/delta_sharing_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/databricks_cli/unity_catalog/delta_sharing_cli.py b/databricks_cli/unity_catalog/delta_sharing_cli.py index 404f0ec7..66206fbf 100644 --- a/databricks_cli/unity_catalog/delta_sharing_cli.py +++ b/databricks_cli/unity_catalog/delta_sharing_cli.py @@ -184,7 +184,7 @@ def delete_share_cli(api_client, name): @click.option('--comment', default=None, required=False, help='Free-form text description.') @click.option('--sharing-id', default=None, required=False, - help='The sharing id provided by the data recipient offline.') + help='The sharing identifier provided by the data recipient offline.') @click.option('--allowed_ip_address', default=None, required=False, multiple=True, help=( 'IP address in CIDR notation that is allowed to use delta sharing. '