add quota related types

This commit is contained in:
alu
2026-07-24 22:00:10 +00:00
parent 05519694e1
commit a645b9aa16
2 changed files with 71 additions and 38 deletions
+71
View File
@@ -0,0 +1,71 @@
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 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"`
}