Skip to content

Commit 962fe51

Browse files
committed
Create Data Catalog module and add list_dbcs function
Signed-off-by: Webster Mudge <[email protected]>
1 parent eeb420a commit 962fe51

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.coverage

src/cdpy/cdpy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from cdpy.opdb import CdpyOpdb
1515
from cdpy.dw import CdpyDw
1616
from cdpy.df import CdpyDf
17+
from cdpy.dc import CdpyDc
1718

1819

1920
class Cdpy(CdpSdkBase):
@@ -30,3 +31,4 @@ def __init__(self, *args, **kwargs):
3031
self.dw = CdpyDw(*args, **kwargs)
3132
self.df = CdpyDf(*args, **kwargs)
3233
self.de = CdpyDe(*args, **kwargs)
34+
self.dc = CdpyDc(*args, **kwargs)

src/cdpy/dc.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from cdpy.common import CdpSdkBase, Squelch, CdpError
4+
5+
ENTITLEMENT_DISABLED='Data Catalog not enabled on CDP Tenant'
6+
7+
8+
class CdpyDc(CdpSdkBase):
9+
def __init__(self, *args, **kwargs):
10+
super().__init__(*args, **kwargs)
11+
12+
def list_dbcs(self, cluster_id):
13+
return self.sdk.call(
14+
svc='dw', func='list_dbcs', ret_field='dbcs', squelch=[
15+
Squelch(value='NOT_FOUND', default=list()),
16+
Squelch(field='status_code', value='504', default=list(), warning="No Data Catalogs found in this Cluster"),
17+
Squelch(value='PATH_DISABLED', warning=ENTITLEMENT_DISABLED, default=list())
18+
],
19+
clusterId=cluster_id
20+
)

0 commit comments

Comments
 (0)