Files
2026-07-23 16:23:31 +00:00

79 lines
1.8 KiB
Go

package proxmoxaas_common_lib
// numerical constraint
type Constraint struct {
Max int64 `json:"max" mapstructure:"max"`
Used int64 `json:"used" mapstructure:"used"`
Avail int64 `json:"avail" mapstructure:"avail"`
}
// match constraint
type Match struct {
Constraint `mapstructure:",squash"`
Name string `json:"name" mapstructure:"name"`
Match string `json:"match" mapstructure:"match"`
}
// numerical resource
type NumericResource struct {
Type string
Name string
Multiplier int64
Base uint64
Compact bool
Unit string
Display bool
Global Constraint
Nodes map[string]Constraint
Total Constraint
Category string
}
// storage resource
type StorageResource struct {
Type string
Name string
Multiplier int64
Base uint64
Compact bool
Unit string
Display bool
Disks []string
Global Constraint
Nodes map[string]Constraint
Total Constraint
Category string
}
// list resource
type ListResource struct {
Type string
Whitelist bool
Display bool
Global []Match
Nodes map[string][]Match
Total []Match
Category string
}
type Templates struct {
Instances struct {
LXC map[string]ResourceTemplate `json:"lxc" mapstructure:"lxc"`
QEMU map[string]ResourceTemplate `json:"qemu" mapstructure:"qemu"`
} `json:"instances"`
}
type ResourceTemplate struct {
Value string `json:"value" mapstructure:"value"`
Resource struct {
Enabled bool `json:"enabled" mapstructure:"enabled"`
Name string `json:"name" mapstructure:"name"`
Amount int `json:"amount" mapstructure:"amount"`
} `json:"resource" mapstructure:"resource"`
}
type Backups struct {
MaxPerInstance int `json:"max-per-instance" mapstructure:"max-per-instance"`
MaxTotal int `json:"max-total" mapstructure:"max-total"`
}