Skip to content

Commit 4ecedfd

Browse files
authored
Add start_vw, pause_vw, and restart_vw functions (#55)
Signed-off-by: Webster Mudge <wmudge@cloudera.com> Signed-off-by: Webster Mudge <wmudge@cloudera.com>
1 parent 067fbac commit 4ecedfd

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/cdpy/dw.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,33 @@ def delete_vw(self, cluster_id:str, vw_id:str):
167167
clusterId=cluster_id, vwId=vw_id
168168
)
169169

170+
def start_vw(self, cluster_id:str, vw_id:str):
171+
return self.sdk.call(
172+
svc='dw', func='start_vw', squelch=[
173+
Squelch('NOT_FOUND'),
174+
Squelch(value='PATH_DISABLED', warning=ENTITLEMENT_DISABLED)
175+
],
176+
clusterId=cluster_id, vwId=vw_id
177+
)
178+
179+
def pause_vw(self, cluster_id:str, vw_id:str):
180+
return self.sdk.call(
181+
svc='dw', func='pause_vw', squelch=[
182+
Squelch('NOT_FOUND'),
183+
Squelch(value='PATH_DISABLED', warning=ENTITLEMENT_DISABLED)
184+
],
185+
clusterId=cluster_id, vwId=vw_id
186+
)
187+
188+
def restart_vw(self, cluster_id:str, vw_id:str):
189+
return self.sdk.call(
190+
svc='dw', func='restart_vw', squelch=[
191+
Squelch('NOT_FOUND'),
192+
Squelch(value='PATH_DISABLED', warning=ENTITLEMENT_DISABLED)
193+
],
194+
clusterId=cluster_id, vwId=vw_id
195+
)
196+
170197
def create_dbc(self, cluster_id:str, name:str, load_demo_data: bool = None):
171198
return self.sdk.call(
172199
svc='dw', func='create_dbc', ret_field='dbcId', clusterId = cluster_id, name=name,
@@ -183,3 +210,12 @@ def delete_dbc(self, cluster_id:str, dbc_id:str):
183210
],
184211
clusterId=cluster_id, dbcId=dbc_id
185212
)
213+
214+
def restart_dbc(self, cluster_id:str, dbc_id:str):
215+
return self.sdk.call(
216+
svc='dw', func='restart_dbc', squelch=[
217+
Squelch('NOT_FOUND'),
218+
Squelch(value='PATH_DISABLED', warning=ENTITLEMENT_DISABLED)
219+
],
220+
clusterId=cluster_id, dbcId=dbc_id
221+
)

0 commit comments

Comments
 (0)