From 3c1d32e3ac687486785c307789b7a93f79aadb2f Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Fri, 20 Sep 2024 21:50:44 +0800 Subject: [PATCH] feat: uninstall plugin --- api/core/plugin/manager/plugin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/api/core/plugin/manager/plugin.py b/api/core/plugin/manager/plugin.py index 85e865bb93..101827246a 100644 --- a/api/core/plugin/manager/plugin.py +++ b/api/core/plugin/manager/plugin.py @@ -31,10 +31,10 @@ class PluginInstallationManager(BasePluginManager): """ identifier = quote(identifier) # exception will be raised if the request failed - self._request_with_plugin_daemon_response( + return self._request_with_plugin_daemon_response( "POST", f"/plugin/{tenant_id}/install/identifier", - dict, + bool, headers={ "Content-Type": "application/json", }, @@ -43,4 +43,10 @@ class PluginInstallationManager(BasePluginManager): }, ) - return True + def uninstall(self, tenant_id: str, identifier: str) -> bool: + """ + Uninstall a plugin. + """ + return self._request_with_plugin_daemon_response( + "DELETE", f"/plugin/{tenant_id}/uninstall?plugin_unique_identifier={identifier}", bool + )