Skip to content

Commit

Permalink
Create Data Catalog module and add list_dbcs function
Browse files Browse the repository at this point in the history
Signed-off-by: Webster Mudge <[email protected]>
  • Loading branch information
wmudge committed Sep 12, 2024
1 parent cefd4ab commit fe2a8a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cdpy/cdpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from cdpy.opdb import CdpyOpdb
from cdpy.dw import CdpyDw
from cdpy.df import CdpyDf
from cdpy.dc import CdpyDc


class Cdpy(CdpSdkBase):
Expand All @@ -30,3 +31,4 @@ def __init__(self, *args, **kwargs):
self.dw = CdpyDw(*args, **kwargs)
self.df = CdpyDf(*args, **kwargs)
self.de = CdpyDe(*args, **kwargs)
self.dc = CdpyDc(*args, **kwargs)
20 changes: 20 additions & 0 deletions src/cdpy/dc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-

from cdpy.common import CdpSdkBase, Squelch, CdpError

ENTITLEMENT_DISABLED='Data Catalog not enabled on CDP Tenant'


class CdpyDc(CdpSdkBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def list_dbcs(self, cluster_id):
return self.sdk.call(
svc='dw', func='list_dbcs', ret_field='dbcs', squelch=[
Squelch(value='NOT_FOUND', default=list()),
Squelch(field='status_code', value='504', default=list(), warning="No Data Catalogs found in this Cluster"),
Squelch(value='PATH_DISABLED', warning=ENTITLEMENT_DISABLED, default=list())
],
clusterId=cluster_id
)

0 comments on commit fe2a8a0

Please sign in to comment.