feat: support upgrade interfaces

This commit is contained in:
Yeuoly
2024-10-25 18:56:38 +08:00
parent 5f61aa85db
commit d36dece0af
3 changed files with 148 additions and 0 deletions

View File

@ -141,3 +141,27 @@ class PluginInstallationManager(BasePluginManager):
},
headers={"Content-Type": "application/json"},
)
def upgrade_plugin(
self,
tenant_id: str,
original_plugin_unique_identifier: str,
new_plugin_unique_identifier: str,
source: PluginInstallationSource,
meta: dict,
) -> PluginInstallTaskStartResponse:
"""
Upgrade a plugin.
"""
return self._request_with_plugin_daemon_response(
"POST",
f"plugin/{tenant_id}/management/upgrade",
PluginInstallTaskStartResponse,
data={
"original_plugin_unique_identifier": original_plugin_unique_identifier,
"new_plugin_unique_identifier": new_plugin_unique_identifier,
"source": source,
"meta": meta,
},
headers={"Content-Type": "application/json"},
)