Skip to content

Commit 9948e40

Browse files
committed
add run-action
1 parent 9b03b5c commit 9948e40

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dataikuapi/dss/admin.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,3 +671,16 @@ def stop(self):
671671
raise Exception('Cluster operation failed : %s' % (json.dumps(resp.get('messages', {}).get('messages', {}))))
672672
return resp
673673

674+
675+
def run_action(self, action_id):
676+
"""
677+
Run an action on the cluster
678+
"""
679+
resp = self.client._perform_json(
680+
"POST", "/admin/clusters/%s/run-action/%s" % (self.cluster_id, action_id))
681+
if resp is None:
682+
raise Exception('Env update returned no data')
683+
if resp.get('messages', {}).get('error', False):
684+
raise Exception('Cluster operation failed : %s' % (json.dumps(resp.get('messages', {}).get('messages', {}))))
685+
return resp
686+

0 commit comments

Comments
 (0)