Provider Data Share Functions
The procedures listed here covers all the functions required by the provider of a Data Share.
Create Provider Procedure
This function creates a Data Share Recipient.
Syntax
Share.create_provider(name, endpoint, share_links, provider_type, bearer, client_id,
client_secret, token_endpoint, description, owner )
The following are it's parameters and descriptions:
Example- name: The name of the Recipient. This field is mandatory.
- endpoint: This field displays the endpoint of the Provider Data Share service. It is mandatory.
- share_links: The provider share links dictionary has the following fields:
- [{"shareName":"shareNameValue", "shareLinkName":"shareLinkNameValue"}]
This field is mandatory.
- provider_type*: This field displays the type of a provider data share type. You can have two values,
DELTA
orLIVE
. - bearer: This field displays the provider Data Share bearer token. This field is mandatory.
- client_id: This field displays the provider Data Share Client ID address. This field is mandatory.
- client_secret: This field displays the provider Data Share Client Secret token. This field is mandatory.
- token_endpoint: This field displays the provider Data Share Token endpoint address. This field is mandatory.
- email: This field displays the mail address of the Recipient.
- description: This field displays the description of the Provider. If this field is missing, the tool uses an empty string.
- owner: This field displays the Provider owner. If this field is missing, the tool uses the current schema owner.
In this example, you can create a Data Share Provider:
provider_json = {
"shareCredentialsVersion": 1,
"endpoint": "https://abcd/delta-sharing/",
"bearerToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
bearer_token = provider_json['bearerToken']
endpoint = provider_json['endpoint']
provider_name = "provider_demo_delta_sharing_1"
description = "provider demo delta sharing desc"
owner = "ADMIN"
provider_type = "DELTA"
share_links = json.dumps([{"shareName":"DELTA_SHARING",
"shareLinkName":"DEMO_DELTA_SHARING"}])
adp.Share.create_provider (
bearer = bearer_token,
description = description,
endpoint = endpoint,
name = provider_name,
owner = owner,
provider_type = provider_type,
share_links = share_links)
//Output:
'{ "CreateShareProvider": true }'
Delete Provider Procedure
This function deletes a Data Share Provider.
Syntax
Share.delete_provider(name, owner)
The following are it's parameters and descriptions:
Example- name: The name of the Recipient. This field is mandatory.
- owner: This field displays the Provider owner. If this field is missing, the tool uses the current schema owner.
In this example, you can delete a Data Share Provider:
adp.Share.delete_provider(name = 'provider_demo_delta_sharing_2')
//Output:
'{ "status": true }'
Rename Provider Procedure
This function renames a Data Share Provider.
Syntax
Share.rename_provider(name, new_name, owner)
The following are it's parameters and descriptions:
Example- name: The name of the Provider. This field is mandatory.
- new_name: This field displays the name of the Data Share Provider of your choice. It is mandatory.
- owner: This field displays the Provider owner. If this field is missing, the tool uses the current schema owner.
In this example, you can rename a Data Share Provider:
adp.Share.rename_provider (name = 'provider_demo_delta_sharing_1', new_name = 'provider_demo_delta_sharing_2')
//Output:
'{ "status": true }'
Get Provider Procedure
This function receives the details of the Data Share Provider.
Syntax
Share.get_provider(name, owner)
The following are it's parameters and descriptions:
Example- name: The name of the Provider. This field is mandatory.
- owner: This field displays the Provider owner. If this field is missing, the tool uses the current schema owner.
In this example, you can receive details of a Data Share Provider:
name = 'provider_demo_delta_sharing_2'
s = adp.Share.get_provider(name)
json.loads(s)
//Output:
{'name': 'PROVIDER_DEMO_DELTA_SHARING_2',
'id': 40437,
'endpoint': 'https://abcd/',
'shareType': 'DELTA',
'tokenEndPoint': None,
'shareLinks': [{'name': 'DEMO_DELTA_SHARING',
'id': 40438,
'shareType': 'DELTA',
'shareName': 'DELTA_SHARING'}]}
Get Providers
This function receives a list of the Data Share Providers based on the providers owner.
Syntax
Share.get_providers(owner)
The following are it's parameters and descriptions:
Example- name: The name of the Provider. This field is mandatory.
- endpoint: This field displays the endpoint of the Provider Data Share service. It is mandatory.
- share_links: The provider share links dictionary has the following fields:
- [{"shareName":"shareNameValue", "shareLinkName":"shareLinkNameValue"}]
This field is mandatory.
- owner: This field displays the Provider owner. If this field is missing, the tool uses the current schema owner.
In this example, you can receive a list of Data Share Providers:
s = adp.Share.get_providers()
json.loads(s)
//Output:
[{'id': 40437,
'name': 'PROVIDER_DEMO_DELTA_SHARING_2',
'owner': 'ADMIN',
'endpoint': 'https://abcd/delta-sharing/',
'shareType': 'DELTA'}]