entity

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootDevice

type BootDevice string

BootDevice defines model for Boot.Device

const (
	BootDeviceCdrom   BootDevice = "cdrom"
	BootDeviceDisk    BootDevice = "disk"
	BootDeviceUnknown BootDevice = "unknown"
)

Defines values for BootDevice.

type Cpu

type Cpu struct {
	// Counts returns the number of logical cores in the system
	Counts int `json:"counts"`

	// Percent calculates the percentage of used either per CPU or combined
	Percent float64 `json:"percent"`
}

Cpu provides CPU info

This struct depends on gopsutil detail: https://godocs.io/github.com/shirou/gopsutil/v3/cpu

type Devices

type Devices struct {
	OS   Disk   `json:"os"`
	Disk []Disk `json:"disk"`
}

Devices defines model for Devices.

type Disk

type Disk struct {
	Device DiskDevice `json:"device"`
	Name   string     `json:"name"`
	Pool   string     `json:"pool"`
	Type   DiskType   `json:"type"`
}

Disk defines model for Disk.

type DiskDevice

type DiskDevice string

DiskDevice defines model for Disk.Device.

const (
	DiskDeviceCdrom   DiskDevice = "cdrom"
	DiskDeviceDisk    DiskDevice = "disk"
	DiskDeviceUnknown DiskDevice = "unknown"
)

Defines values for DiskDevice.

type DiskType

type DiskType string

DiskType defines model for Disk.Type.

const (
	DiskTypeQcow2   DiskType = "qcow2"
	DiskTypeRaw     DiskType = "raw"
	DiskTypeIso     DiskType = "iso"
	DiskTypeUnknown DiskType = "unknown"
)

Defines values for DiskType.

type Host

type Host struct {
	// Cpu is host's CPU
	Cpu Cpu `json:"cpu"`

	// Memory is host's Memory
	Memory Memory `json:"memory"`

	// StoragePools is host's storage pools
	StoragePools []StoragePool `json:"storage_pools"`
}

Host defines model for Host.

type Memory

type Memory struct {
	// This is the kernel's notion of free
	Free uint64 `json:"free"`

	// Percentage of RAM used by programs
	Percent float64 `json:"percent"`

	// Total amount of RAM on this system
	Total uint64 `json:"total"`

	// RAM used by programs
	Used uint64 `json:"used"`
}

Memory provides Memory info

This struct depends on gopsutil detail: https://godocs.io/github.com/shirou/gopsutil/v3/mem

type StoragePool

type StoragePool struct {
	// Name of storage pool
	Name string `json:"name"`

	// Path to storage pool
	Path string `json:"path"`

	// Status of storage pool
	Status StoragePoolStatus `json:"status"`

	// Total amount of storage pool
	TotalSize uint64 `json:"total_size"`

	// Used amount of storage pool
	UsedSize uint64 `json:"used_size"`
}

StoragePool provides storage pools info

This struct depends on gopsutil detail: https://godocs.io/github.com/shirou/gopsutil/v3/disk

type StoragePoolStatus

type StoragePoolStatus string

StoragePoolStatus defines model for StoragePool.Status.

const (
	ACTIVE StoragePoolStatus = "ACTIVE"
	ERROR  StoragePoolStatus = "ERROR"
)

Defines values for StoragePoolStatus.

type VirtualizationType

type VirtualizationType string

VirtualizationType defines model for Virtualization.Type

const (
	VirtualizationTypeKvm     VirtualizationType = "kvm"
	VirtualizationTypeQemu    VirtualizationType = "qemu"
	VirtualizationTypeUnknown VirtualizationType = "unknown"
)

Defines values for VirtualizationType

type Vm

type Vm struct {
	VmCore
	// ID specifies unique VM and is represented by UUID version 4.
	ID             uuid.UUID          `json:"id"`
	Devices        Devices            `json:"devices"`
	Boot           BootDevice         `json:"boot"`
	Virtualization VirtualizationType `json:"virtualization"`
	Daemonize      bool               `json:"daemonize"`
}

Vm defines model for VM

type VmCore

type VmCore struct {
	// Cpu is amount of VM's logical core
	Cpu int `json:"cpu"`
	// Memory
	Memory uint64 `json:"memory"`
	// Name
	Name string `json:"name"`
}

VmCore contains the most important part of Vm struct type

Jump to

Keyboard shortcuts

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