package proxmoxaas_common_lib type Cluster struct { Nodes map[string]*Node `json:"nodes"` } type Node struct { Name string `json:"name" mapstructure:"name"` Cores uint64 `json:"cores" mapstructure:"cores"` Memory uint64 `json:"memory" mapstructure:"memory"` Swap uint64 `json:"swap" mapstructure:"swap"` Devices map[DeviceBus]*Device `json:"devices" mapstructure:"devices"` Instances map[InstanceID]*Instance `json:"instances" mapstructure:"instances"` Proctypes []string `json:"cpus" mapstructure:"cpus"` } type InstanceID uint64 type InstanceType string const VM InstanceType = "VM" const CT InstanceType = "CT" type Instance struct { Type InstanceType `json:"type" mapstructure:"type"` Name string `json:"name" mapstructure:"name"` Proctype string `json:"cpu" mapstructure:"cpu"` Cores uint64 `json:"cores" mapstructure:"cores"` Memory uint64 `json:"memory" mapstructure:"memory"` Swap uint64 `json:"swap" mapstructure:"swap"` Volumes map[VolumeID]*Volume `json:"volumes" mapstructure:"volumes"` Nets map[NetID]*Net `json:"nets" mapstructure:"nets"` Devices map[DeviceID]*Device `json:"devices" mapstructure:"devices"` Boot BootOrder `json:"boot" mapstructure:"boot"` Pool string `json:"pool" mapstructure:"pool"` // todo: this should be actual pool } var VolumeTypes = []string{ "sata", "scsi", "ide", "rootfs", "mp", "unused", } type VolumeID string type Volume struct { Volume_ID VolumeID `json:"volume_id" mapstructure:"volume_id"` Type string `json:"type" mapstructure:"type"` Storage string `json:"storage" mapstructure:"storage"` Format string `json:"format" mapstructure:"format"` Size uint64 `json:"size" mapstructure:"size"` File string `json:"file" mapstructure:"file"` MP string `json:"mp" mapstructure:"mp"` } type NetID string type Net struct { Net_ID NetID `json:"net_id" mapstructure:"net_id"` Value string `json:"value" mapstructure:"value"` Rate uint64 `json:"rate" mapstructure:"rate"` VLAN uint64 `json:"vlan" mapstructure:"vlan"` } type DeviceID string type DeviceBus string type Device struct { Device_ID DeviceID `json:"device_id" mapstructure:"device_id"` Device_Bus DeviceBus `json:"device_bus" mapstructure:"device_bus"` Device_Name string `json:"device_name" mapstructure:"device_name"` Vendor_Name string `json:"vendor_name" mapstructure:"vendor_name"` Functions map[FunctionID]*Function `json:"functions" mapstructure:"functions"` Reserved bool `json:"reserved" mapstructure:"reserved"` } type FunctionID string type Function struct { Function_ID FunctionID `json:"function_id" mapstructure:"function_id"` Function_Name string `json:"subsystem_device_name" mapstructure:"subsystem_device_name"` Vendor_Name string `json:"subsystem_vendor_name" mapstructure:"subsystem_vendor_name"` Reserved bool `json:"reserved" mapstructure:"reserved"` } type BootOrder struct { Enabled []any `json:"enabled" mapstructure:"enabled"` Disabled []any `json:"disabled" mapstructure:"disabled"` }