Skip to content

Commit

Permalink
Register collections endpoint support.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentk authored and wjohnson committed May 30, 2022
1 parent 1217f3e commit 71e6504
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ For connecting to Azure Purview, it's even more convenient to install the [azure

If you want to use your Azure CLI credential rather than a service principal, install azure-identity by running `pip install azure-identity` and then run the code below.

```
```python
from azure.identity import AzureCliCredential

from pyapacheatlas.core import PurviewClient
Expand All @@ -76,7 +76,7 @@ client = PurviewClient(

If you don't want to install any additional packages, you should use the built-in ServicePrincipalAuthentication class.

```
```python
from pyapacheatlas.auth import ServicePrincipalAuthentication
from pyapacheatlas.core import PurviewClient

Expand All @@ -97,7 +97,7 @@ client = PurviewClient(

You can also create your own entities by hand with the helper `AtlasEntity` class.

```
```python
from pyapacheatlas.core import AtlasEntity

# Get All Type Defs
Expand Down
8 changes: 8 additions & 0 deletions pyapacheatlas/core/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .util import AtlasException, AtlasBaseClient, batch_dependent_entities, PurviewLimitation, PurviewOnly
from .collections.purview import PurviewCollectionsClient
from .glossary import _CrossPlatformTerm, GlossaryClient, PurviewGlossaryClient
from .discovery.purview import PurviewDiscoveryClient
from .typedef import BaseTypeDef, TypeCategory
Expand Down Expand Up @@ -1651,6 +1652,9 @@ class PurviewClient(AtlasClient):
service. Simplifies the requirements for knowing the endpoint url and
requires only the Purview account name.
See also:
https://docs.microsoft.com/en-us/rest/api/purview/
:param str account_name:
Your Purview account name.
:param authentication:
Expand Down Expand Up @@ -1680,6 +1684,7 @@ def __init__(self, account_name, authentication=None, **kwargs):
requests_args = AtlasBaseClient._parse_requests_args(**kwargs)

glossary = PurviewGlossaryClient(endpoint_url, authentication, requests_args = requests_args)
self.collections = PurviewCollectionsClient(endpoint_url, authentication)
self.msgraph = MsGraphClient(authentication, requests_args = requests_args)
self.discovery = PurviewDiscoveryClient(f"https://{account_name.lower()}.purview.azure.com/catalog/api", authentication, requests_args = requests_args)
super().__init__(endpoint_url, authentication, glossary = glossary, requests_args = requests_args, **kwargs)
Expand All @@ -1689,6 +1694,9 @@ def get_entity_next_lineage(self, guid, direction, getDerivedLineage=False, offs
"""
Returns immediate next level lineage info about entity with pagination
See also:
https://docs.microsoft.com/en-us/rest/api/purview/catalogdataplane/lineage
:param str guid: The guid of the entity for which you want to
retrieve lineage.
:param str direction: The direction of the lineage, which could
Expand Down

0 comments on commit 71e6504

Please sign in to comment.