schema

package
v0.5.90 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDigit added in v0.4.83

func IsDigit(s string) bool

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 DataStore added in v0.2.23

type DataStore struct {
	UUID       string `json:"uuid"`
	Id         string `json:"id"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Format     string `json:"format"`
	State      string `json:"state"`
	Capacity   uint64 `json:"capacity"`   // bytes
	Allocation uint64 `json:"allocation"` // bytes
	Available  uint64 `json:"available"`  // Bytes
	Source     string `json:"source"`
	NFS        *NFS   `json:"nfs"`
}

func NewDataStore added in v0.2.23

func NewDataStore(pol libvirts.Pool) DataStore

type Disk

type Disk struct {
	Action     string `json:"action,omitempty"`
	Seq        string `json:"seq,omitempty"`       // configure
	Name       string `json:"name,omitempty"`      // disk name
	UUID       string `json:"uuid,omitempty"`      // disk UUID
	Store      string `json:"datastore,omitempty"` // disk saved to datastore
	Size       string `json:"size"`                // configure
	SizeUnit   string `json:"sizeUnit,omitempty"`  //configure
	Format     string `json:"format"`
	Source     string `json:"source"`
	Device     string `json:"device"`
	Bus        string `json:"bus"`      //configre
	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 Graphics added in v0.4.83

type Graphics struct {
	Type     string `json:"type"`
	Password string `json:"password"`
	Listen   string `json:"listen"`
	Port     string `json:"port"`
}

type Hyper

type Hyper struct {
	Name       string  `json:"name"`
	Host       string  `json:"host"`
	CpuNum     uint    `json:"cpuNum"`
	CpuVendor  string  `json:"cpuVendor"`
	CpuUtils   uint64  `json:"cpuUtils"`
	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"`
	User       User        `json:"user"`
	Hyper      Hyper       `json:"hyper"`
	Instances  []Instance  `json:"instances"`
	DataStores []DataStore `json:"datastores"`
	Networks   []Network   `json:"networks"`
}

type Instance

type Instance struct {
	Action           string `json:"action,omitempty"` // If is "", means not action.
	UUID             string `json:"uuid"`
	Name             string `json:"name"`
	Family           string `json:"family"'` // configure
	State            string `json:"state"`
	Arch             string `json:"arch"` // configure: x86_64 or i386
	Type             string `json:"type"`
	Boots            string `json:"boots,omitempty"`     // configure: hd,cdrom,network.
	DataStore        string `json:"datastore,omitempty"` // configure
	Cpu              string `json:"cpu,omitempty"`       // configure
	MemSize          string `json:"memSize,omitempty"`   // configure
	MemUnit          string `json:"memUnit,omitempty"`   // configure
	CpuMode          string `json:"cpuMode,omitempty"`   // configure
	Disk0File        string `json:"disk0File,omitempty"` // configure
	Disk1Size        string `json:"disk1Size,omitempty"` // configure
	Disk1Unit        string `json:"disk1Unit,omitempty"` // configure
	Disk1Bus         string `json:"disk1Bus,omitempty"`  // configure
	Interface0Source string `json:"interface0Source,omitempty"`
	Interface0Bus    string `json:"interface0Bus,omitempty"`
	Start            string `json:"start,omitempty"` //configure

	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"`
	Vnc         Graphics     `json:"vnc"`
	Spice       Graphics     `json:"spice"`
	Graphics    []Graphics   `json:"graphics"`

	XMLObj *libvirtc.DomainXML `json:"-"`
}

func NewInstance

func NewInstance(dom libvirtc.Domain) Instance

type Interface

type Interface struct {
	Action     string `json:"action,omitempty"` // If is "", means not action.
	Seq        string `json:"seq,omitempty"`    //configure
	Name       string `json:"name,omitempty"`
	UUID       string `json:"uuid,omitempty"`
	Type       string `json:"type,omitempty"` //bridge or openvswitch
	Address    string `json:"address"`
	Source     string `json:"source"`
	Model      string `json:"model"` // configure
	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 List added in v0.4.83

type List struct {
	Items    []interface{} `json:"items"`
	Metadata MetaData      `json:"metadata"`
}

type Memory added in v0.5.90

type Memory struct {
	Size string `json:"size"` // configure
	Unit string `json:"unit"` // configure
}

type MetaData added in v0.4.83

type MetaData struct {
	Total  int `json:"total"`
	Size   int `json:"size"`
	Offset int `json:"offset"`
}

type NFS added in v0.4.83

type NFS struct {
	Host   string `json:"host"`
	Path   string `json:"path"`
	Format string `json:"format"`
}

type Network added in v0.2.23

type Network struct {
	UUID    string  `json:"uuid"`
	Name    string  `json:"name"`
	State   string  `json:"state"`
	Address string  `json:"address"`
	Netmask string  `json:"netmask,omitempty"`
	Prefix  string  `json:"prefix,omitempty"`
	Range   []Range `json:"range"`
	DHCP    string  `json:"dhcp,omitempty"`
	Mode    string  `json:"mode"` // nat, router.
}

func NewNetwork added in v0.2.23

func NewNetwork(net libvirtn.Network) Network

type Processor added in v0.5.90

type Processor struct {
	Cpu  string `json:"cpu"`  // configure
	Mode string `json:"mode"` // configure
	Time uint64 `json:"time"` // MicroSeconds
}

type Range added in v0.5.90

type Range struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type User added in v0.5.90

type User struct {
	Type      string   `json:"type"` // admin, guest or other
	Name      string   `json:"name"`
	Password  string   `json:"password"`
	Instances []string `json:"instances"`
}

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