models

package
v0.0.0-...-56be8c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HV

type HV struct {
	Mutex          sync.Mutex            `json:"-"`
	IP             net.IP                `json:"-"`
	Port           int                   `json:"-"`
	CPUModel       string                `json:"cpu_model"`
	Arch           string                `json:"arch"`
	RAMTotal       uint64                `json:"total_ram"`
	RAMFree        uint64                `json:"free_ram"`
	CPUCount       int32                 `json:"cpu_count"`
	CPUFrequency   int32                 `json:"cpu_frequency_mhz"`
	NUMANodes      int32                 `json:"numa_nodes"`
	CPUSockets     int32                 `json:"cpu_sockets"`
	CPUCores       int32                 `json:"cpu_cores"`
	CPUThreads     int32                 `json:"cpu_threads"`
	Brs            map[string]*HVBr      `json:"-"`
	Storages       map[string]*HVStorage `json:"-"`
	VMs            map[uuid.UUID]*VM     `json:"-"`
	Status         status.Status         `json:"status"`
	StatusReason   string                `json:"status_reason"`
	QemuVersion    string                `json:"qemu_version"`
	LibvirtVersion string                `json:"libvirt_version"`
	Libvirt        *libvirt.Libvirt      `json:"-"`
}

The struct for the hypervisor status (more transient), this is different from the struct in eve, which persists the data to the database.

type HVBr

type HVBr struct {
	Name    string `json:"name"`
	Remarks string `json:"remarks"`
}

type HVStorage

type HVStorage struct {
	ID      uuid.UUID `json:"id"`
	Size    int       `json:"size"`
	Used    int       `json:"used"`
	Free    int       `json:"free"`
	Updated time.Time `json:"updated"`
	Remarks string    `json:"remarks"`
}

type VM

type VM struct {
	Mutex    sync.Mutex           `json:"-"`
	Domain   libvirt.Dom          `json:"-"`
	ID       uuid.UUID            `json:"id"`
	CPU      int                  `json:"cpu"`
	Memory   int64                `json:"memory"`
	Nics     map[string]VMNic     `json:"nics"`
	Storages map[string]VMStorage `json:"storages"`
}

type VMNic

type VMNic struct {
	Mutex sync.Mutex `json:"-"`
	ID    uuid.UUID  `json:"id"`

	MAC     string    `json:"mac"`
	IP      []net.IP  `json:"ip"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`
	Remarks string    `json:"remarks"`
	State   string    `json:"state"`
	// contains filtered or unexported fields
}

type VMState

type VMState struct {
	State       status.Status `json:"state"`
	StateStr    string        `json:"state_str"`
	StateReason string        `json:"state_reason"`
}

type VMStorage

type VMStorage struct {
	Mutex   sync.Mutex `json:"-"`
	ID      uuid.UUID  `json:"id"`
	Path    string     `json:"path"`
	Size    int        `json:"size"`
	Created time.Time  `json:"created"`
	Updated time.Time  `json:"updated"`
	Remarks string     `json:"remarks"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL