Skip to content

Commit

Permalink
Change Create Recipient CLI to use global metastore ID (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
wchau authored Aug 12, 2022
1 parent 93a8fe2 commit ef918f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions databricks_cli/unity_catalog/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions databricks_cli/unity_catalog/delta_sharing_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
Expand All @@ -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))


Expand Down
6 changes: 3 additions & 3 deletions databricks_cli/unity_catalog/uc_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ef918f1

Please sign in to comment.