diff --git a/databricks_cli/unity_catalog/api.py b/databricks_cli/unity_catalog/api.py index a66e4f7a..908e0ba8 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, 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 6672f3ac..66206fbf 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('--sharing-id', default=None, required=False, + 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. ' @@ -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, sharing_id, allowed_ip_address): """ Create a new recipient. """ recipient_json = UnityCatalogApi(api_client).create_recipient( - name, comment, sharing_code, 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 54c3d212..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, sharing_code=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 sharing_code is not None: - _data['sharing_code'] = sharing_code + if sharing_id is not None: + _data['data_recipient_global_metastore_id'] = sharing_id _data['authentication_type'] = 'DATABRICKS' else: _data['authentication_type'] = 'TOKEN'