implement node endpoint

This commit is contained in:
2025-02-11 07:11:05 +00:00
parent 747c705420
commit c9b2fa9b6f
5 changed files with 197 additions and 34 deletions

View File

@@ -1,37 +1,57 @@
package app
type PVEBus int
type Resource struct { // number of virtual cores (usually threads)
Reserved int64
Free int64
Total int64
}
const (
IDE PVEBus = iota
SATA
)
type Host struct {
Name string
Cores Resource
Memory Resource
Swap Resource
Storage map[string]Storage
Hardware map[string]Device
}
type PVEDrive struct{}
type PVEDisk struct{}
type PVENet struct{}
type PVEDevice struct{}
type Storage struct{}
type QEMUInstance struct {
Name string
Proctype string
Cores int16
Memory int32
Drive map[int]PVEDrive
Disk map[int]PVEDisk
Net map[int]PVENet
Device map[int]PVEDevice
Cores Resource
Memory Resource
Drive map[int]Volume
Disk map[int]Volume
Net map[int]Net
Device map[int]Device
}
type LXCInstance struct {
Name string
Cores int16
Memory int32
Swap int32
RootDisk PVEDrive
MP map[int]PVEDisk
Net map[int]PVENet
Cores Resource
Memory Resource
Swap Resource
RootDisk Volume
MP map[int]Volume
Net map[int]Net
}
type Volume struct {
Format string
Path string
Size string
Used string
}
type Net struct{}
type Device struct {
BusID string `json:"id"`
DeviceName string `json:"device_name"`
VendorName string `json:"vendor_name"`
SubsystemDeviceName string `json:"subsystem_device_name"`
SubsystemVendorName string `json:"subsystem_vendor_name"`
Reserved bool
}