schema

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstanceState2Str

func InstanceState2Str(state libvirt.DomainState) string

Types

type Address

type Address struct {
	Type     string `json:"type"`
	Domain   string `json:"domain"`
	Bus      string `json:"bus"`
	Slot     string `json:"slot"`
	Function string `json:"function"`
}

func NewFromAddressXML

func NewFromAddressXML(xml libvirtc.AddressXML) (addr Address)

type Controller

type Controller struct {
	Type    string  `json:"source"`
	Model   string  `json:"model"`
	Index   string  `json:"device"`
	Address Address `json:"address"`
}

func NewFromControllerXML

func NewFromControllerXML(xml libvirtc.ControllerXML) (ctl Controller)

type Disk

type Disk struct {
	Format     string `json:"format"`
	Source     string `json:"source"`
	Device     string `json:"device"`
	Bus        string `json:"bus"`
	AddrType   string `json:"addrType"` // pci, and drive
	AddrSlot   uint16 `json:"addrSlot"`
	AddrDomain uint16 `json:"addrDomain"`
	AddrBus    uint16 `json:"addrBus"`
	AddrFunc   uint16 `json:"addrFunc"`
	AddrCtl    uint16 `json"addrCtl"`
	AddrTgt    uint16 `json:"addrTgt"`
	AddrUnit   uint16 `json:"addrUnit"`
}

func NewFromDiskXML

func NewFromDiskXML(xml libvirtc.DiskXML) (disk Disk)

type DiskConf

type DiskConf struct {
	Action string `json:"action"` // If is "", means not action.
	Name   string `json:"name"`
	UUID   string `json:"uuid"`
	Store  string `json:"datastore"`
	Size   string `json:"size"`
	Unit   string `json:"unit"`
	Bus    string `json:"bus"`
	Slot   string `json:"slot"`
}

type Hyper

type Hyper struct {
	Name       string  `json:"Name"`
	CpuNum     uint    `json:"cpuNum"`
	CpuVendor  string  `json:"cpuVendor"`
	MemTotal   uint64  `json:"memTotal"`
	MemFree    uint64  `json:"memFree"`
	MemCached  uint64  `json:"memCached"`
	MemPercent float64 `json:"memPercent"`
}

func NewHyper

func NewHyper() (hs Hyper)

type Index

type Index struct {
	Version   Version    `json:"version"`
	Hyper     Hyper      `json:"hyper"`
	Instances []Instance `json:"instances"`
}

type Instance

type Instance struct {
	UUID        string       `json:"uuid"`
	Name        string       `json:"name"`
	State       string       `json:"state"`
	Arch        string       `json:"arch"`
	Type        string       `json:"type"`
	MaxCpu      uint         `json:"maxCpu"`
	MaxMem      uint64       `json:"maxMem"`  // Kbytes
	Memory      uint64       `json:"memory"`  // KBytes
	CpuTime     uint64       `json:"cpuTime"` // MicroSeconds
	Disks       []Disk       `json:"disks,omitempty"`
	Interfaces  []Interface  `json:"interfaces,omitempty"`
	Controllers []Controller `json:"controllers,omitempty"`
	Password    string       `json:"password"`
}

func NewInstance

func NewInstance(dom libvirtc.Domain) Instance

type InstanceConf

type InstanceConf struct {
	Action       string `json:"action"` // If is "", means not action.
	Name         string `json:"name"`
	Family       string `json:"family"'`
	Arch         string `json:"arch"`
	Boots        string `json:"boots"`
	DataStore    string `json:"datastore"`
	Cpu          string `json:"cpu"`
	CpuMode      string `json:"cpuMode"`
	MemorySize   string `json:"memorySize"`
	MemoryUnit   string `json:"memoryUnit"`
	DiskSize     string `json:"diskSize"`
	DiskUnit     string `json:"diskUnit"`
	DiskBus      string `json:"diskBus"`
	IsoFile      string `json:"isoFile"`
	Interface    string `json:"interface"`
	InterfaceBus string `json:"interfaceBus"`
	Start        string `json:"start"`
}

type Interface

type Interface struct {
	Address    string `json:"address"`
	Source     string `json:"source"`
	Model      string `json:"model"`
	Device     string `json:"device"`
	AddrType   string `json:"addrType"` // now only pci.
	AddrSlot   uint16 `json:"addrSlot"`
	AddrDomain uint16 `json:"addrDomain"`
	AddrBus    uint16 `json:"addrBus"`
	AddrFunc   uint16 `json:"addrFunc"`
}

func NewFromInterfaceXML

func NewFromInterfaceXML(xml libvirtc.InterfaceXML) (int Interface)

type InterfaceConf

type InterfaceConf struct {
	Action    string `json:"action"` // If is "", means not action.
	Name      string `json:"name"`
	UUID      string `json:"uuid"`
	Interface string `json:"interface"`
	Type      string `json:"type"`
	Bus       string `json:"bus"`
	Model     string `json:"model"`
	Slot      string `json:"slot"`
}

type Version

type Version struct {
	Version string `json:"version"`
	Date    string `json:"date"`
	Commit  string `json:"commit"`
}

func NewVersion

func NewVersion() Version

Jump to

Keyboard shortcuts

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