Can update VM settings
This commit is contained in:
@ -63,7 +63,11 @@ export class VMInfo implements VMInfoInterface {
|
||||
}
|
||||
|
||||
get ViewURL(): string {
|
||||
return `/api/vm/${this.uuid}`;
|
||||
return `/vm/${this.uuid}`;
|
||||
}
|
||||
|
||||
get EditURL(): string {
|
||||
return `/vm/${this.uuid}/edit`;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,6 +97,33 @@ export class VMApi {
|
||||
).data.map((i: VMInfoInterface) => new VMInfo(i));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the information about a single VM
|
||||
*/
|
||||
static async GetSingle(uuid: string): Promise<VMInfo> {
|
||||
const data = (
|
||||
await APIClient.exec({
|
||||
uri: `/vm/${uuid}`,
|
||||
method: "GET",
|
||||
})
|
||||
).data;
|
||||
return new VMInfo(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the information about a single VM
|
||||
*/
|
||||
static async UpdateSingle(vm: VMInfo): Promise<VMInfo> {
|
||||
const data = (
|
||||
await APIClient.exec({
|
||||
uri: `/vm/${vm.uuid!}`,
|
||||
method: "PUT",
|
||||
jsonData: vm,
|
||||
})
|
||||
).data;
|
||||
return new VMInfo(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the state of a VM
|
||||
*/
|
||||
|
Reference in New Issue
Block a user