Can configure network autostart
This commit is contained in:
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user