fix: add keep_last param to backup API and fix notes-template field name
This commit is contained in:
@@ -268,12 +268,14 @@ async def create_backup(
|
||||
compress = data.get("compress", "zstd")
|
||||
remove = int(data.get("remove", 1))
|
||||
notes = data.get("notes")
|
||||
keep_last = data.get("keep_last")
|
||||
|
||||
try:
|
||||
client = _get_proxmox_client(server)
|
||||
result = client.create_backup(
|
||||
node=node, vmid=int(vmid), storage=storage,
|
||||
mode=mode, compress=compress, remove=remove, notes=notes,
|
||||
mode=mode, compress=compress, remove=remove,
|
||||
keep_last=keep_last, notes=notes,
|
||||
)
|
||||
if result.get("success"):
|
||||
LoggingService.log_proxmox_action(
|
||||
|
||||
@@ -3180,7 +3180,7 @@ class ProxmoxClient:
|
||||
if keep_last and int(keep_last) > 0:
|
||||
params["prune-backups"] = f"keep-last={int(keep_last)}"
|
||||
if notes:
|
||||
params["notes"] = notes
|
||||
params["notes-template"] = notes
|
||||
upid = self.proxmox.nodes(node).vzdump.post(**params)
|
||||
return {"success": True, "upid": upid}
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user