Add Proxmox snapshots: list, take, roll back, delete
A guest's drawer on the Proxmox page now has a Snapshots section. Everyone signed in sees them, operators take them, administrators roll back and delete (each behind a confirmation). Proxmox does each as a task, followed for up to 20 seconds. Audit log and change log entries for all three. An http:// Proxmox address is now allowed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
12e9fee7af
commit
97df28c6dc
11 files changed
+733
-11
No files matched your search
@@ -3524,6 +3524,25 @@ export interface ProxmoxGuest {
|
||||
uptime: number | null;
|
||||
}
|
||||
|
||||
/** One snapshot of a Proxmox guest. */
|
||||
export interface ProxmoxSnapshot {
|
||||
name: string;
|
||||
description: string;
|
||||
takenAt: string | null;
|
||||
/** A VM's snapshot that kept its memory. */
|
||||
withRam: boolean;
|
||||
/** The snapshot it was taken after. */
|
||||
parent: string | null;
|
||||
}
|
||||
|
||||
/** How a snapshot task went: done and worked, still going (done false), or an error (the request fails with what Proxmox said). */
|
||||
export interface ProxmoxSnapshotResult {
|
||||
snapshot: string;
|
||||
done: boolean;
|
||||
ok: boolean | null;
|
||||
upid: string;
|
||||
}
|
||||
|
||||
export interface ProxmoxGuestsResponse {
|
||||
guests: ProxmoxGuest[];
|
||||
summary: { total: number; running: number };
|
||||
@@ -4447,6 +4466,14 @@ export const api = {
|
||||
request<void>(`/api/integrations/${integrationId}/proxmox/nodes/${node}/${type}/${vmid}/restart`, { method: "POST" }),
|
||||
shutdown: (integrationId: number, node: string, type: ProxmoxGuestType, vmid: number) =>
|
||||
request<void>(`/api/integrations/${integrationId}/proxmox/nodes/${node}/${type}/${vmid}/shutdown`, { method: "POST" }),
|
||||
snapshots: (integrationId: number, node: string, type: ProxmoxGuestType, vmid: number) =>
|
||||
request<{ snapshots: ProxmoxSnapshot[] }>(`/api/integrations/${integrationId}/proxmox/nodes/${node}/${type}/${vmid}/snapshots`),
|
||||
createSnapshot: (integrationId: number, node: string, type: ProxmoxGuestType, vmid: number, body: { name?: string; description?: string; includeRam?: boolean }) =>
|
||||
request<ProxmoxSnapshotResult>(`/api/integrations/${integrationId}/proxmox/nodes/${node}/${type}/${vmid}/snapshots`, { method: "POST", body: JSON.stringify(body) }),
|
||||
rollbackSnapshot: (integrationId: number, node: string, type: ProxmoxGuestType, vmid: number, name: string) =>
|
||||
request<ProxmoxSnapshotResult>(`/api/integrations/${integrationId}/proxmox/nodes/${node}/${type}/${vmid}/snapshots/${encodeURIComponent(name)}/rollback`, { method: "POST" }),
|
||||
deleteSnapshot: (integrationId: number, node: string, type: ProxmoxGuestType, vmid: number, name: string) =>
|
||||
request<ProxmoxSnapshotResult>(`/api/integrations/${integrationId}/proxmox/nodes/${node}/${type}/${vmid}/snapshots/${encodeURIComponent(name)}`, { method: "DELETE" }),
|
||||
},
|
||||
synology: {
|
||||
storage: (integrationId: number) => request<SynologyStorageResponse>(`/api/integrations/${integrationId}/synology/storage`),
|
||||
|
||||
Reference in new issue
Block a user