SharesClient
Client for managing shares of entities in the Datagrok platform. This client provides functionality to share entities (such as queries, data connections, scripts, etc.) with one or more groups or users, specifying access permissions.
Examples
Prepare an entity to share
>>> conn = DataConnection(
... name="TestConn",
... data_source=DatabaseDataSourceType.Postgres,
... description="Test conn",
... server="localhost",
... port=5432,
... db="datagrok",
... credentials=Credentials(login="postgres", password="postgres")
... )
>>> conn = grok.connections.save(conn, save_credentials=True)
>>> query = grok.functions.create_query(connection=conn, query="select * from events", name="Events")
Share the query with the DEVELOPERS group with View access
>>> grok.shares.share(query, groups=[Group.DEVELOPERS()])
Methods
__init__()
share()
Shares an entity.
Parameters
| Name | Type | Description |
|---|---|---|
| id | str or Model | |
| Identifier of an entity | ID or Grok name, or a Model instance. | groups : str or list of (str or Group) Comma-separated list of group/user names, or a list of names/Group instances. |
| access | str | Either 'View' or 'Edit' |