Perform first actions on VM

This commit is contained in:
2024-05-06 18:52:14 +02:00
parent 766ec1780a
commit 9a938041a4
2 changed files with 116 additions and 5 deletions

View File

@ -44,4 +44,25 @@ export class VMApi {
await APIClient.exec({ method: "GET", uri: `/vm/${vm.uiid}/state` })
).data.state;
}
/**
* Request to start VM
*/
static async StartVM(vm: VMInfo): Promise<void> {
await APIClient.exec({ method: "GET", uri: `/vm/${vm.uiid}/start` });
}
/**
* Request to shutdown VM
*/
static async ShutdownVM(vm: VMInfo): Promise<void> {
await APIClient.exec({ method: "GET", uri: `/vm/${vm.uiid}/shutdown` });
}
/**
* Request to kill VM
*/
static async KillVM(vm: VMInfo): Promise<void> {
await APIClient.exec({ method: "GET", uri: `/vm/${vm.uiid}/kill` });
}
}