Can configure network autostart

This commit is contained in:
2023-12-06 19:10:25 +01:00
parent 23f2029deb
commit 8b53875349
7 changed files with 143 additions and 22 deletions

View File

@ -95,6 +95,29 @@ export class NetworkApi {
});
}
/**
* Check if autostart is enabled on a network
*/
static async IsAutostart(net: NetworkInfo): Promise<boolean> {
return (
await APIClient.exec({
uri: `/network/${net.uuid}/autostart`,
method: "GET",
})
).data.autostart;
}
/**
* Set autostart status of a network
*/
static async SetAutostart(net: NetworkInfo, enabled: boolean): Promise<void> {
await APIClient.exec({
uri: `/network/${net.uuid}/autostart`,
method: "PUT",
jsonData: { autostart: enabled },
});
}
/**
* Update an existing network
*/

View File

@ -46,10 +46,10 @@ interface VMInfoInterface {
export class VMInfo implements VMInfoInterface {
name: string;
uuid?: string | undefined;
genid?: string | undefined;
title?: string | undefined;
description?: string | undefined;
uuid?: string;
genid?: string;
title?: string;
description?: string;
boot_type: "UEFI" | "UEFISecureBoot";
architecture: "i686" | "x86_64";
memory: number;