diff --git a/src/cdpy/cdpy.py b/src/cdpy/cdpy.py index 72ae7de..1369bf9 100644 --- a/src/cdpy/cdpy.py +++ b/src/cdpy/cdpy.py @@ -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): @@ -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) diff --git a/src/cdpy/dc.py b/src/cdpy/dc.py new file mode 100644 index 0000000..9299aea --- /dev/null +++ b/src/cdpy/dc.py @@ -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 + ) \ No newline at end of file