Skip to content

Commit ef918f1

Browse files
authored
Change Create Recipient CLI to use global metastore ID (#534)
1 parent 93a8fe2 commit ef918f1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

databricks_cli/unity_catalog/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ def update_share_permissions(self, name, perm_spec):
192192

193193
# Recipient APIs
194194

195-
def create_recipient(self, name, comment, sharing_code, allowed_ip_addresses):
196-
return self.client.create_recipient(name, comment, sharing_code, allowed_ip_addresses)
195+
def create_recipient(self, name, comment, sharing_id, allowed_ip_addresses):
196+
return self.client.create_recipient(name, comment, sharing_id, allowed_ip_addresses)
197197

198198
def list_recipients(self):
199199
return self.client.list_recipients()

databricks_cli/unity_catalog/delta_sharing_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ def delete_share_cli(api_client, name):
183183
@click.option('--name', required=True, help='Name of new recipient.')
184184
@click.option('--comment', default=None, required=False,
185185
help='Free-form text description.')
186-
@click.option('--sharing-code', default=None, required=False,
187-
help='A one-time sharing code shared by the data recipient offline.')
186+
@click.option('--sharing-id', default=None, required=False,
187+
help='The sharing identifier provided by the data recipient offline.')
188188
@click.option('--allowed_ip_address', default=None, required=False, multiple=True,
189189
help=(
190190
'IP address in CIDR notation that is allowed to use delta sharing. '
@@ -193,12 +193,12 @@ def delete_share_cli(api_client, name):
193193
@profile_option
194194
@eat_exceptions
195195
@provide_api_client
196-
def create_recipient_cli(api_client, name, comment, sharing_code, allowed_ip_address):
196+
def create_recipient_cli(api_client, name, comment, sharing_id, allowed_ip_address):
197197
"""
198198
Create a new recipient.
199199
"""
200200
recipient_json = UnityCatalogApi(api_client).create_recipient(
201-
name, comment, sharing_code, allowed_ip_address)
201+
name, comment, sharing_id, allowed_ip_address)
202202
click.echo(mc_pretty_format(recipient_json))
203203

204204

databricks_cli/unity_catalog/uc_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,15 @@ def update_share_permissions(self, name, perm_spec, headers=None):
376376

377377
# Recipient Operations
378378

379-
def create_recipient(self, name, comment=None, sharing_code=None,
379+
def create_recipient(self, name, comment=None, sharing_id=None,
380380
allowed_ip_addresses=None, headers=None):
381381
_data = {
382382
'name': name,
383383
}
384384
if comment is not None:
385385
_data['comment'] = comment
386-
if sharing_code is not None:
387-
_data['sharing_code'] = sharing_code
386+
if sharing_id is not None:
387+
_data['data_recipient_global_metastore_id'] = sharing_id
388388
_data['authentication_type'] = 'DATABRICKS'
389389
else:
390390
_data['authentication_type'] = 'TOKEN'

0 commit comments

Comments
 (0)