Prepare UI for disks backups
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { APIClient } from "./ApiClient";
|
||||
import { DiskImageFormat } from "./DiskImageApi";
|
||||
|
||||
export type VMState =
|
||||
| "NoState"
|
||||
@ -24,7 +25,7 @@ export interface BaseFileVMDisk {
|
||||
name: string;
|
||||
delete: boolean;
|
||||
|
||||
// application attribute
|
||||
// application attributes
|
||||
new?: boolean;
|
||||
deleteType?: "keepfile" | "deletefile";
|
||||
}
|
||||
@ -384,4 +385,20 @@ export class VMApi {
|
||||
encodeURIComponent(token)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Backup VM disk
|
||||
*/
|
||||
static async BackupDisk(
|
||||
vm: VMInfo,
|
||||
disk: VMFileDisk,
|
||||
file_name: string,
|
||||
format: DiskImageFormat
|
||||
): Promise<void> {
|
||||
await APIClient.exec({
|
||||
uri: `/vm/${vm.uuid}/disk/${disk.name}/backup`,
|
||||
method: "POST",
|
||||
jsonData: { ...format, file_name },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user