Skip to content

Commit c247ccc

Browse files
committed
Public API for plugin uninstall.
1 parent 1f51e1e commit c247ccc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

dataikuapi/dss/plugin.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,28 @@ def update_from_git(self, repository_url, checkout = "master", subpath=None):
116116
})
117117
return self.client.get_future(ret["jobId"])
118118

119+
########################################################
120+
# Plugin uninstall/delete
121+
########################################################
122+
123+
def prepare_delete(self):
124+
"""
125+
Prepares deletion of the plugins. Check if it is possible, warns on usages.
126+
127+
:return: a json object with the counts of project and plugin elements in use
128+
"""
129+
return self.client._perform_json("GET", "/plugins/%s/actions/prepareDelete" % (self.plugin_id))
130+
131+
def delete(self, force):
132+
"""
133+
Deletes the plugin. Will fail if a usage is specified and force is not set to true
134+
135+
:return: a :class:`~dataikuapi.dss.future.DSSFuture`
136+
"""
137+
ret = self.client._perform_json("GET", "/plugins/%s/actions/delete" % (self.plugin_id),
138+
params={force: force})
139+
return self.client.get_future(ret["jobId"])
140+
119141
########################################################
120142
# Managing the dev plugin's contents
121143
########################################################

0 commit comments

Comments
 (0)