Can view from web UI XML definition of domains
This commit is contained in:
@ -106,7 +106,14 @@ export class APIClient {
|
||||
// JSON response
|
||||
if (res.headers.get("content-type") === "application/json")
|
||||
data = await res.json();
|
||||
// Binary file
|
||||
// Text / XML response
|
||||
else if (
|
||||
["application/xml", "text/plain"].includes(
|
||||
res.headers.get("content-type") ?? ""
|
||||
)
|
||||
)
|
||||
data = await res.text();
|
||||
// Binary file, tracking download progress
|
||||
else if (res.body !== null && args.downProgress) {
|
||||
// Track download progress
|
||||
const contentEncoding = res.headers.get("content-encoding");
|
||||
|
@ -113,6 +113,10 @@ export class VMInfo implements VMInfoInterface {
|
||||
get VNCURL(): string {
|
||||
return `/vm/${this.uuid}/vnc`;
|
||||
}
|
||||
|
||||
get XMLURL(): string {
|
||||
return `/vm/${this.uuid}/xml`;
|
||||
}
|
||||
}
|
||||
|
||||
export class VMApi {
|
||||
@ -154,6 +158,18 @@ export class VMApi {
|
||||
return new VMInfo(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the source XML configuration of a domain for debugging purposes
|
||||
*/
|
||||
static async GetSingleXML(uuid: string): Promise<string> {
|
||||
return (
|
||||
await APIClient.exec({
|
||||
uri: `/vm/${uuid}/src`,
|
||||
method: "GET",
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the information about a single VM
|
||||
*/
|
||||
|
Reference in New Issue
Block a user