Can get XML network definition

This commit is contained in:
2023-12-11 18:41:59 +01:00
parent 2d5dc9237e
commit 375bdb1a46
11 changed files with 135 additions and 18 deletions

View File

@ -25,6 +25,10 @@ export function NetworkURL(n: NetworkInfo, edit: boolean = false): string {
return `/net/${n.uuid}${edit ? "/edit" : ""}`;
}
export function NetworkXMLURL(n: NetworkInfo): string {
return `/net/${n.uuid}/xml`;
}
export class NetworkApi {
/**
* Create a new network
@ -63,6 +67,18 @@ export class NetworkApi {
).data;
}
/**
* Get the source XML configuration of a network for debugging purposes
*/
static async GetSingleXML(uuid: string): Promise<string> {
return (
await APIClient.exec({
uri: `/network/${uuid}/src`,
method: "GET",
})
).data;
}
/**
* Get the status of network
*/