浏览代码

feat: uninstall plugin

Yeuoly 8 月之前
父节点
当前提交
3c1d32e3ac
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      api/core/plugin/manager/plugin.py

+ 9 - 3
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
+        )