schema

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"`
}

type Channel

type Channel struct {
	Type          string `json:"type"`
	TargetType    string `json:"targetType"`
	TargetName    string `json:"targetName"`
	SourceChannel string `json:"sourceChannel"`
}

type Controller

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

type DHCPLease

type DHCPLease struct {
	Type     int    `json:"type"`
	Mac      string `json:"mac"`
	IPAddr   string `json:"ipAddr"`
	Prefix   uint   `json:"prefix"`
	Hostname string `json:"hostname"`
}

type DHCPLeases

type DHCPLeases map[string]DHCPLease

type DataStore

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"`
}

type Disk

type Disk struct {
	Domain     Instance `json:"domain"`
	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   string   `json:"addrSlot"`
	AddrDomain string   `json:"addrDomain"`
	AddrBus    string   `json:"addrBus"`
	AddrFunc   string   `json:"addrFunc"`
	AddrCtl    string   `json:"addrCtl"`
	AddrTgt    string   `json:"addrTgt"`
	AddrUnit   string   `json:"addrUnit"`
	Volume     Volume   `json:"volume"`
}

type Graphics

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

type History added in v0.9.1

type History struct {
	User   string `json:"user"`
	Date   string `json:"date"`
	Method string `json:"method"`
	Client string `json:"client"`
	Url    string `json:"url"`
}

type Host

type Host struct {
	Name     string `json:"name"`
	Url      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`
	Hostname string `json:"hostname"`
	Schema   string `json:"schema"`
	Port     string `json:"port"`
}

func (*Host) Initialize

func (h *Host) Initialize()

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"`
	UpTime     int64   `json:"uptime"`
}

type Index

type Index struct {
	Version Version `json:"version"`
	User    User    `json:"user"`
	Hyper   Hyper   `json:"hyper"`
	Default string  `json:"default"`
}

type Instance

type Instance struct {
	UUID        string       `json:"uuid"`
	Name        string       `json:"name"`
	Title       string       `json:"title"`
	Description string       `json:"description"`
	Family      string       `json:"family,omitempty"` // linux, windows or others
	State       string       `json:"state,omitempty"`
	Arch        string       `json:"arch,omitempty"` // x86_64 or i386
	Type        string       `json:"type,omitempty"`
	Boots       string       `json:"boots,omitempty"`
	DataStore   string       `json:"datastore,omitempty"`
	Start       string       `json:"start,omitempty"` // whether booting with created
	CpuMode     string       `json:"cpuMode,omitempty"`
	MaxCpu      uint         `json:"maxCpu,omitempty"`
	MaxMem      uint64       `json:"maxMem,omitempty"`  // KiB
	Memory      uint64       `json:"memory,omitempty"`  // KiB
	CpuTime     uint64       `json:"cpuTime,omitempty"` // micro seconds
	Disks       []Disk       `json:"disks,omitempty"`
	Interfaces  []Interface  `json:"interfaces,omitempty"`
	Controllers []Controller `json:"controllers,omitempty"`
	Graphics    []Graphics   `json:"graphics,omitempty"`
	Channels    []Channel    `json:"channels,omitempty"`
}

type InstancesStats

type InstancesStats struct {
	Running      uint   `json:"running"`
	Shutdown     uint   `json:"shutdown"`
	Others       uint   `json:"others"`
	AllocMem     uint64 `json:"allocMem"`
	OccupiedMem  uint64 `json:"occupiedMem"`
	AllocCpu     uint   `json:"allocCpu"`
	OccupiedCpu  uint   `json:"occupiedCpu"`
	AllocStorage uint64 `json:"allocStorage"`
}

type Interface

type Interface struct {
	Domain     Instance `json:"domain"`
	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"`
	Network    string   `json:"network"`
	Source     string   `json:"source"`
	HostDev    string   `json:"hostDev"`
	Model      string   `json:"model"` // configure
	Device     string   `json:"device"`
	AddrType   string   `json:"addrType"` // now only pci.
	AddrSlot   string   `json:"addrSlot"`
	AddrDomain string   `json:"addrDomain"`
	AddrBus    string   `json:"addrBus"`
	AddrFunc   string   `json:"addrFunc"`
}

type List

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

type ListDHCPLease

type ListDHCPLease struct {
	List
	Items []DHCPLease `json:"items"`
}

type ListDataStore

type ListDataStore struct {
	List
	Items []DataStore `json:"items"`
}

type ListDisk

type ListDisk struct {
	List
	Items []Disk `json:"items"`
}

type ListGraphics

type ListGraphics struct {
	List
	Items []Graphics `json:"items"`
}

type ListHistory added in v0.9.1

type ListHistory struct {
	List
	Items []History `json:"items"`
}

type ListInstance

type ListInstance struct {
	List
	Items []Instance `json:"items"`
}

type ListInterface

type ListInterface struct {
	List
	Items []Interface `json:"items"`
}

type ListNetwork

type ListNetwork struct {
	List
	Items []Network `json:"items"`
}

type ListSession added in v0.9.1

type ListSession struct {
	List
	Items []Session `json:"items"`
}

type ListSnapshot

type ListSnapshot struct {
	List
	Items []Snapshot `json:"items"`
}

type ListUser

type ListUser struct {
	List
	Items []User `json:"items"`
}

type Memory

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

type MetaData

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

type NFS

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

type Network

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

type Processor

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

type Range

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

type Session added in v0.9.1

type Session struct {
	Value   string `json:"value"`
	Date    string `json:"date"`
	Client  string `json:"client"`
	Expires string `json:"expires"`
	Uuid    string `json:"uuid"`
}

type Snapshot

type Snapshot struct {
	Name      string `json:"name"`
	Domain    string `json:"domain"`
	Uptime    int64  `json:"uptime"`
	State     string `json:"state"`
	IsCurrent bool   `json:"isCurrent"`
}

type Statics

type Statics struct {
	Instance  StaticsInfo `json:"instance"`
	DataStore StaticsInfo `json:"datastore"`
	Network   StaticsInfo `json:"network"`
	Ports     StaticsInfo `json:"ports"`
}

type StaticsInfo

type StaticsInfo struct {
	Active   int `json:"active"`
	Inactive int `json:"inactive"`
	Unknown  int `json:"unknown"`
	Total    int `json:"total"`
}

type Target

type Target struct {
	Name   string `json:"name"`
	Target string `json:"target"`
	Host   string `json:"host"`
}

func (Target) ID

func (tgt Target) ID() string

type User

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

type Version

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

func NewVersion

func NewVersion() Version

type Volume

type Volume struct {
	Pool       string `json:"pool"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Capacity   uint64 `json:"capacity"`
	Allocation uint64 `json:"allocation"`
}

type Volumes

type Volumes struct {
	List
	Items []Volume `json:"items"`
}

Jump to

Keyboard shortcuts

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