api

package
v0.0.1-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoState     LifeCycle = "NoState"
	Running     LifeCycle = "Running"
	Blocked     LifeCycle = "Blocked"
	Paused      LifeCycle = "Paused"
	Shutdown    LifeCycle = "ShuttingDown"
	Shutoff     LifeCycle = "Shutoff"
	Crashed     LifeCycle = "Crashed"
	PMSuspended LifeCycle = "PMSuspended"

	// Common reasons
	ReasonUnknown StateChangeReason = "Unknown"

	// ShuttingDown reasons
	ReasonUser StateChangeReason = "User"

	// Shutoff reasons
	ReasonShutdown     StateChangeReason = "Shutdown"
	ReasonDestroyed    StateChangeReason = "Destroyed"
	ReasonMigrated     StateChangeReason = "Migrated"
	ReasonCrashed      StateChangeReason = "Crashed"
	ReasonPanicked     StateChangeReason = "Panicked"
	ReasonSaved        StateChangeReason = "Saved"
	ReasonFailed       StateChangeReason = "Failed"
	ReasonFromSnapshot StateChangeReason = "FromSnapshot"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

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

type Alias

type Alias struct {
	Name string `xml:"name,attr"`
}

type BIOS

type BIOS struct {
}

TODO <loader readonly='yes' secure='no' type='rom'>/usr/lib/xen/boot/hvmloader</loader>

type Ballooning

type Ballooning struct {
	Model string `xml:"model,attr"`
}

type BandWidth

type BandWidth struct {
}

type Boot

type Boot struct {
	Dev string `xml:"dev,attr"`
}

type BootMenu

type BootMenu struct {
	Enabled bool  `xml:"enabled,attr"`
	Timeout *uint `xml:"timeout,attr,omitempty"`
}

type BootOrder

type BootOrder struct {
	Order uint `xml:"order,attr"`
}

type Channel

type Channel struct {
	Type   string         `xml:"type,attr"`
	Source ChannelSource  `xml:"source,omitempty"`
	Target *ChannelTarget `xml:"target,omitempty"`
}

type ChannelSource

type ChannelSource struct {
	Mode string `xml:"mode,attr"`
	Path string `xml:"path,attr"`
}

type ChannelTarget

type ChannelTarget struct {
	Name    string `xml:"name,attr,omitempty"`
	Type    string `xml:"type,attr"`
	Address string `xml:"address,attr,omitempty"`
	Port    uint   `xml:"port,attr,omitempty"`
}

type Clock

type Clock struct {
}

type Console

type Console struct {
	Type   string         `xml:"type,attr"`
	Target *ConsoleTarget `xml:"target,omitempty"`
}

type ConsoleTarget

type ConsoleTarget struct {
	Type *string `xml:"type,attr,omitempty"`
	Port *uint   `xml:"port,attr,omitempty"`
}

type Devices

type Devices struct {
	Emulator   string      `xml:"emulator,omitempty"`
	Interfaces []Interface `xml:"interface"`
	Channels   []Channel   `xml:"channel"`
	Video      []Video     `xml:"video"`
	Graphics   []Graphics  `xml:"graphics"`
	Ballooning *Ballooning `xml:"memballoon,omitempty"`
	Disks      []Disk      `xml:"disk"`
	Serials    []Serial    `xml:"serial"`
	Consoles   []Console   `xml:"console"`
}

type Disk

type Disk struct {
	Device   string      `xml:"device,attr"`
	Snapshot string      `xml:"snapshot,attr,omitempty"`
	Type     string      `xml:"type,attr"`
	Source   DiskSource  `xml:"source"`
	Target   DiskTarget  `xml:"target"`
	Serial   string      `xml:"serial,omitempty"`
	Driver   *DiskDriver `xml:"driver,omitempty"`
	ReadOnly *ReadOnly   `xml:"readonly,omitempty"`
	Auth     *DiskAuth   `xml:"auth,omitempty"`
}

type DiskAuth

type DiskAuth struct {
	Username string      `xml:"username,attr"`
	Secret   *DiskSecret `xml:"secret,omitempty"`
}

type DiskDriver

type DiskDriver struct {
	Cache       string `xml:"cache,attr,omitempty"`
	ErrorPolicy string `xml:"error_policy,attr,omitempty"`
	IO          string `xml:"io,attr,omitempty"`
	Name        string `xml:"name,attr"`
	Type        string `xml:"type,attr"`
}

type DiskSecret

type DiskSecret struct {
	Type  string `xml:"type,attr"`
	Usage string `xml:"usage,attr"`
}

type DiskSource

type DiskSource struct {
	File          string          `xml:"file,attr,omitempty"`
	StartupPolicy string          `xml:"startupPolicy,attr,omitempty"`
	Protocol      string          `xml:"protocol,attr,omitempty"`
	Name          string          `xml:"name,attr,omitempty"`
	Host          *DiskSourceHost `xml:"host,omitempty"`
}

type DiskSourceHost

type DiskSourceHost struct {
	Name string `xml:"name,attr"`
	Port string `xml:"port,attr,omitempty"`
}

type DiskTarget

type DiskTarget struct {
	Bus    string `xml:"bus,attr,omitempty"`
	Device string `xml:"dev,attr"`
}

type Domain

type Domain struct {
	metav1.TypeMeta
	ObjectMeta kubev1.ObjectMeta
	Spec       DomainSpec
	Status     DomainStatus
}

func NewDomainReferenceFromName

func NewDomainReferenceFromName(namespace string, name string) *Domain

func NewMinimalDomain

func NewMinimalDomain(name string) *Domain

func NewMinimalDomainWithNS

func NewMinimalDomainWithNS(namespace string, name string) *Domain

func (*Domain) GetObjectKind

func (d *Domain) GetObjectKind() schema.ObjectKind

Required to satisfy Object interface

func (*Domain) GetObjectMeta

func (d *Domain) GetObjectMeta() metav1.Object

Required to satisfy ObjectMetaAccessor interface

func (*Domain) SetState

func (d *Domain) SetState(state LifeCycle, reason StateChangeReason)

type DomainList

type DomainList struct {
	metav1.TypeMeta
	ListMeta metav1.ListMeta
	Items    []Domain
}

func (*DomainList) GetListMeta

func (dl *DomainList) GetListMeta() metav1.List

Required to satisfy ListMetaAccessor interface

func (*DomainList) GetObjectKind

func (dl *DomainList) GetObjectKind() schema.ObjectKind

Required to satisfy Object interface

type DomainSpec

type DomainSpec struct {
	XMLName xml.Name `xml:"domain"`
	Name    string   `xml:"name"`
	UUID    string   `xml:"uuid,omitempty"`
	Memory  Memory   `xml:"memory"`
	Type    string   `xml:"type,attr"`
	OS      OS       `xml:"os"`
	SysInfo *SysInfo `xml:"sysinfo,omitempty"`
	Devices Devices  `xml:"devices"`
	Clock   *Clock   `xml:"clock,omitempty"`
}

DomainSpec represents the actual conversion to libvirt XML. The fields must be tagged, and they must correspond to the libvirt domain as described in https://libvirt.org/formatdomain.html.

func NewMinimalDomainSpec

func NewMinimalDomainSpec(vmName string) *DomainSpec

type DomainStatus

type DomainStatus struct {
	Status LifeCycle
	Reason StateChangeReason
}

type Entry

type Entry struct {
	Name  string `xml:"name"`
	Value string `xml:",chardata"`
}

type FilterRef

type FilterRef struct {
	Filter string `xml:"filter,attr"`
}

type Graphics

type Graphics struct {
	AutoPort      string `xml:"autoPort,attr,omitempty"`
	DefaultMode   string `xml:"defaultMode,attr,omitempty"`
	Listen        Listen `xml:"listen,omitempty"`
	PasswdValidTo string `xml:"passwdValidTo,attr,omitempty"`
	Port          int32  `xml:"port,attr,omitempty"`
	TLSPort       int    `xml:"tlsPort,attr,omitempty"`
	Type          string `xml:"type,attr"`
}

type Interface

type Interface struct {
	Address   *Address         `xml:"address,omitempty"`
	Type      string           `xml:"type,attr"`
	Source    InterfaceSource  `xml:"source"`
	Target    *InterfaceTarget `xml:"target,omitempty"`
	Model     *Model           `xml:"model,omitempty"`
	MAC       *MAC             `xml:"mac,omitempty"`
	BandWidth *BandWidth       `xml:"bandwidth,omitempty"`
	BootOrder *BootOrder       `xml:"boot,omitempty"`
	LinkState *LinkState       `xml:"link,omitempty"`
	FilterRef *FilterRef       `xml:"filterref,omitempty"`
	Alias     *Alias           `xml:"alias,omitempty"`
}

type InterfaceSource

type InterfaceSource struct {
	Network string `xml:"network,attr,omitempty"`
	Device  string `xml:"dev,attr,omitempty"`
	Bridge  string `xml:"bridge,attr,omitempty"`
}

type InterfaceTarget

type InterfaceTarget struct {
	Device string `xml:"dev,attr"`
}

type LifeCycle

type LifeCycle string

type LinkState

type LinkState struct {
	State string `xml:"state,attr"`
}

type Listen

type Listen struct {
	Type    string `xml:"type,attr"`
	Address string `xml:"address,attr,omitempty"`
	Network string `xml:"newtork,attr,omitempty"`
}

type Loader

type Loader struct {
}

TODO <bios useserial='yes' rebootTimeout='0'/>

type MAC

type MAC struct {
	MAC string `xml:"address,attr"`
}

type Memory

type Memory struct {
	Value uint   `xml:",chardata"`
	Unit  string `xml:"unit,attr"`
}

type Model

type Model struct {
	Type string `xml:"type,attr"`
}

type NVRam

type NVRam struct {
	NVRam    string `xml:",chardata,omitempty"`
	Template string `xml:"template,attr,omitempty"`
}

type OS

type OS struct {
	Type       OSType    `xml:"type"`
	SMBios     *SMBios   `xml:"smbios,omitempty"`
	BootOrder  []Boot    `xml:"boot"`
	BootMenu   *BootMenu `xml:"bootmenu,omitempty"`
	BIOS       *BIOS     `xml:"bios,omitempty"`
	Kernel     string    `xml:"kernel,omitempty"`
	Initrd     string    `xml:"initrd,omitempty"`
	KernelArgs string    `xml:"cmdline,omitempty"`
}

type OSType

type OSType struct {
	OS      string `xml:",chardata"`
	Arch    string `xml:"arch,attr,omitempty"`
	Machine string `xml:"machine,attr,omitempty"`
}

type RandomGenerator

type RandomGenerator struct {
}

type ReadOnly

type ReadOnly struct{}

type SMBios

type SMBios struct {
	Mode string `xml:"mode,attr"`
}

type SecretSpec

type SecretSpec struct {
	XMLName     xml.Name    `xml:"secret"`
	Ephemeral   string      `xml:"ephemeral,attr"`
	Private     string      `xml:"private,attr"`
	Description string      `xml:"description,omitempty"`
	Usage       SecretUsage `xml:"usage,omitempty"`
}

type SecretUsage

type SecretUsage struct {
	Type   string `xml:"type,attr"`
	Target string `xml:"target,omitempty"`
}

type Serial

type Serial struct {
	Type   string        `xml:"type,attr"`
	Target *SerialTarget `xml:"target,omitempty"`
}

type SerialTarget

type SerialTarget struct {
	Port *uint `xml:"port,attr,omitempty"`
}

type StateChangeReason

type StateChangeReason string

type SysInfo

type SysInfo struct {
	Type      string  `xml:"type,attr"`
	System    []Entry `xml:"system>entry"`
	BIOS      []Entry `xml:"bios>entry"`
	BaseBoard []Entry `xml:"baseBoard>entry"`
}

type Timer

type Timer struct {
	Name       string `xml:"name,attr"`
	TickPolicy string `xml:"tickpolicy,attr,omitempty"`
	Present    string `xml:"present,attr,omitempty"`
}

type Video

type Video struct {
	Model VideoModel `xml:"model"`
}

type VideoModel

type VideoModel struct {
	Type   string `xml:"type,attr"`
	Heads  *uint  `xml:"heads,attr,omitempty"`
	Ram    *uint  `xml:"ram,attr,omitempty"`
	VRam   *uint  `xml:"vram,attr,omitempty"`
	VGAMem *uint  `xml:"vgamem,attr,omitempty"`
}

Jump to

Keyboard shortcuts

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