Compare commits

...

2 Commits

Author SHA1 Message Date
alu 0936e8e5a5 fix VMID Max naming issue,
add mapstructure decode tags
2026-05-22 21:30:01 +00:00
alu be50bf3428 add pool mapping to Instance type 2026-05-22 18:49:01 +00:00
2 changed files with 7 additions and 6 deletions
+6 -6
View File
@@ -6,9 +6,9 @@ type Pool struct {
Groups []Group `json:"groups"` Groups []Group `json:"groups"`
Resources map[string]any `json:"resources"` Resources map[string]any `json:"resources"`
Templates Templates `json:"templates"` Templates Templates `json:"templates"`
AllowedNodes map[string]bool `json:"nodes-allowed"` AllowedNodes map[string]bool `json:"nodes-allowed" mapstructure:"nodes-allowed"`
AllowedVMIDRange VMID `json:"vmid-allowed"` AllowedVMIDRange VMID `json:"vmid-allowed" mapstructure:"vmid-allowed"`
AllowedBackups Backups `json:"backups-allowed"` AllowedBackups Backups `json:"backups-allowed" mapstructure:"backups-allowed"`
} }
// proxmox typically formats as gid-realm for non pve realms // proxmox typically formats as gid-realm for non pve realms
@@ -40,12 +40,12 @@ type User struct {
type VMID struct { type VMID struct {
Min int `json:"min"` Min int `json:"min"`
MAx int `json:"max"` Max int `json:"max"`
} }
type Backups struct { type Backups struct {
MaxPerInstance int `json:"max-per-instance"` MaxPerInstance int `json:"max-per-instance" mapstructure:"max-per-instance"`
MaxTotal int `json:"max-total"` MaxTotal int `json:"max-total" mapstructure:"max-total"`
} }
type Templates struct { type Templates struct {
+1
View File
@@ -31,6 +31,7 @@ type Instance struct {
Nets map[NetID]*Net `json:"nets"` Nets map[NetID]*Net `json:"nets"`
Devices map[DeviceID]*Device `json:"devices"` Devices map[DeviceID]*Device `json:"devices"`
Boot BootOrder `json:"boot"` Boot BootOrder `json:"boot"`
Pool string `json:"pool"` // todo: this should be actual pool
} }
var VolumeTypes = []string{ var VolumeTypes = []string{