Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Data Catalog module #56

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)