api

package
v0.8.40 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPool

func CleanPool(name string) error

func DataStore2XML

func DataStore2XML(conf schema.DataStore) libvirts.Pool

func Disk2XML

func Disk2XML(conf *schema.Disk) (*libvirtc.DiskXML, error)

func GetArg

func GetArg(r *http.Request, name string) (string, bool)

func GetAuth

func GetAuth(req *http.Request) (name, pass string, ok bool)

func GetData

func GetData(r *http.Request, v interface{}) error

func GetFile

func GetFile(name string) string

func GetPath

func GetPath(store, name string) string

store: datastore@01 name: domain name

func GetQueryOne

func GetQueryOne(req *http.Request, name string) string

func GetStatic

func GetStatic() string

func GetTypeByVolume

func GetTypeByVolume(file string) (string, string)

func GetUser

func GetUser(req *http.Request) (schema.User, bool)

func Instance2XML

func Instance2XML(conf *schema.Instance) (libvirtc.DomainXML, error)

func Interface2XML

func Interface2XML(source, model, seq, typ string) libvirtc.InterfaceXML

func IsUniCast

func IsUniCast(address string) bool

func IsVolume

func IsVolume(file string) bool

func Network2XML

func Network2XML(conf schema.Network) libvirtn.NetworkXML

func NewBackingVolumeAndPool

func NewBackingVolumeAndPool(store, name, disk, backingFle, backingFmt string) (*libvirts.VolumeXML, error)

name: Domain name. store: like: datatore@01

func NewCdXML

func NewCdXML(file, family string, seq *diskSeq) libvirtc.DiskXML

func NewDiskXML

func NewDiskXML(format, file, bus string, seq *diskSeq) libvirtc.DiskXML

func NewFileXML

func NewFileXML(disk *schema.Disk, conf *schema.Instance, seq *diskSeq) (libvirtc.DiskXML, error)

func NewIsoXML

func NewIsoXML(file, family string, seq *diskSeq) libvirtc.DiskXML

func NewVolume

func NewVolume(name, disk string, size uint64) (*libvirts.VolumeXML, error)

name: domain name disk: disk name size: disk size using bytes

func NewVolumeAndPool

func NewVolumeAndPool(store, name, disk string, size uint64) (*libvirts.VolumeXML, error)

name: Domain name. store: like: datatore@01

func ParseBasicAuth

func ParseBasicAuth(auth string) (username, password string, ok bool)

func ParseFiles

func ParseFiles(w http.ResponseWriter, name string, data interface{}) error

func RemovePool

func RemovePool(name string) error

name: Domain name.

func ResponseJson

func ResponseJson(w http.ResponseWriter, v interface{})

func ResponseMsg

func ResponseMsg(w http.ResponseWriter, code int, message string)

func ResponseXML

func ResponseXML(w http.ResponseWriter, v string)

func SetStatic

func SetStatic(dir string)

Types

type Api

type Api interface {
	Router(router *mux.Router)
	Get(w http.ResponseWriter, r *http.Request)
	Post(w http.ResponseWriter, r *http.Request)
	Delete(w http.ResponseWriter, r *http.Request)
	Put(w http.ResponseWriter, r *http.Request)
}

type Bridger

type Bridger struct {
}

func (Bridger) Delete added in v0.8.40

func (br Bridger) Delete(w http.ResponseWriter, r *http.Request)

func (Bridger) Get added in v0.8.40

func (br Bridger) Get(w http.ResponseWriter, r *http.Request)

func (Bridger) Post added in v0.8.40

func (br Bridger) Post(w http.ResponseWriter, r *http.Request)

func (Bridger) Put added in v0.8.40

func (br Bridger) Put(w http.ResponseWriter, r *http.Request)

func (Bridger) Router

func (br Bridger) Router(router *mux.Router)

type DHCPLease

type DHCPLease struct {
}

func (DHCPLease) Get

func (l DHCPLease) Get(w http.ResponseWriter, r *http.Request)

func (DHCPLease) Getx added in v0.8.40

func (l DHCPLease) Getx(data schema.DHCPLeases) error

func (DHCPLease) Router

func (l DHCPLease) Router(router *mux.Router)

type DataStore

type DataStore struct {
}

func (DataStore) Delete added in v0.8.40

func (store DataStore) Delete(w http.ResponseWriter, r *http.Request)

func (DataStore) Get added in v0.8.40

func (store DataStore) Get(w http.ResponseWriter, r *http.Request)

func (DataStore) Post added in v0.8.40

func (store DataStore) Post(w http.ResponseWriter, r *http.Request)

func (DataStore) Put added in v0.8.40

func (store DataStore) Put(w http.ResponseWriter, r *http.Request)

func (DataStore) Router

func (store DataStore) Router(router *mux.Router)

type Disk

type Disk struct {
}

func (Disk) Delete added in v0.8.40

func (disk Disk) Delete(w http.ResponseWriter, r *http.Request)

func (Disk) FindByDev

func (disk Disk) FindByDev(devices *libvirtc.DevicesXML, dev string) *libvirtc.DiskXML

func (Disk) Get added in v0.8.40

func (disk Disk) Get(w http.ResponseWriter, r *http.Request)

func (Disk) Post added in v0.8.40

func (disk Disk) Post(w http.ResponseWriter, r *http.Request)

func (Disk) Router

func (disk Disk) Router(router *mux.Router)

func (Disk) Travel

func (disk Disk) Travel(instance schema.Instance) map[string]libvirts.VolumeInfo

type Graphics

type Graphics struct {
}

func (Graphics) Get added in v0.8.40

func (gra Graphics) Get(w http.ResponseWriter, r *http.Request)

func (Graphics) Post added in v0.8.40

func (gra Graphics) Post(w http.ResponseWriter, r *http.Request)

func (Graphics) Router

func (gra Graphics) Router(router *mux.Router)

type Hyper

type Hyper struct {
}

func (Hyper) Get added in v0.8.40

func (h Hyper) Get(w http.ResponseWriter, r *http.Request)

func (Hyper) Router

func (h Hyper) Router(router *mux.Router)

type ISO

type ISO struct {
}

func (ISO) Get added in v0.8.40

func (iso ISO) Get(w http.ResponseWriter, r *http.Request)

func (ISO) Router

func (iso ISO) Router(router *mux.Router)

type Instance

type Instance struct {
}

func (Instance) Delete added in v0.8.40

func (ins Instance) Delete(w http.ResponseWriter, r *http.Request)

func (Instance) Destroy added in v0.8.40

func (ins Instance) Destroy(w http.ResponseWriter, r *http.Request)

func (Instance) Execute added in v0.8.40

func (ins Instance) Execute(w http.ResponseWriter, uuid, action string)

func (Instance) Get added in v0.8.40

func (ins Instance) Get(w http.ResponseWriter, r *http.Request)

func (Instance) GetByUser

func (ins Instance) GetByUser(user *schema.User, list *schema.ListInstance)

func (Instance) HasPermission

func (ins Instance) HasPermission(user *schema.User, instance string) bool

func (Instance) Post added in v0.8.40

func (ins Instance) Post(w http.ResponseWriter, r *http.Request)

func (Instance) Reset added in v0.8.40

func (ins Instance) Reset(w http.ResponseWriter, r *http.Request)

func (Instance) Resume added in v0.8.40

func (ins Instance) Resume(w http.ResponseWriter, r *http.Request)

func (Instance) Router

func (ins Instance) Router(router *mux.Router)

func (Instance) Shutdown added in v0.8.40

func (ins Instance) Shutdown(w http.ResponseWriter, r *http.Request)

func (Instance) Start added in v0.8.40

func (ins Instance) Start(w http.ResponseWriter, r *http.Request)

func (Instance) Stats added in v0.8.38

func (ins Instance) Stats(w http.ResponseWriter, r *http.Request)

func (Instance) Suspend added in v0.8.40

func (ins Instance) Suspend(w http.ResponseWriter, r *http.Request)

func (Instance) Title added in v0.8.40

func (ins Instance) Title(w http.ResponseWriter, r *http.Request)

func (Instance) Undefine added in v0.8.40

func (ins Instance) Undefine(w http.ResponseWriter, r *http.Request)

type Interface

type Interface struct {
}

func (Interface) Delete added in v0.8.40

func (in Interface) Delete(w http.ResponseWriter, r *http.Request)

func (Interface) Get added in v0.8.40

func (in Interface) Get(w http.ResponseWriter, r *http.Request)

func (Interface) Post added in v0.8.40

func (in Interface) Post(w http.ResponseWriter, r *http.Request)

func (Interface) Put added in v0.8.40

func (in Interface) Put(w http.ResponseWriter, r *http.Request)

func (Interface) Router

func (in Interface) Router(router *mux.Router)

type Memory

type Memory struct {
}

func (Memory) Delete added in v0.8.40

func (mem Memory) Delete(w http.ResponseWriter, r *http.Request)

func (Memory) Get added in v0.8.40

func (mem Memory) Get(w http.ResponseWriter, r *http.Request)

func (Memory) Post added in v0.8.40

func (mem Memory) Post(w http.ResponseWriter, r *http.Request)

func (Memory) Put added in v0.8.40

func (mem Memory) Put(w http.ResponseWriter, r *http.Request)

func (Memory) Router

func (mem Memory) Router(router *mux.Router)

type Network

type Network struct {
}

func (Network) Delete added in v0.8.40

func (net Network) Delete(w http.ResponseWriter, r *http.Request)

func (Network) Get added in v0.8.40

func (net Network) Get(w http.ResponseWriter, r *http.Request)

func (Network) Post added in v0.8.40

func (net Network) Post(w http.ResponseWriter, r *http.Request)

func (Network) Put added in v0.8.40

func (net Network) Put(w http.ResponseWriter, r *http.Request)

func (Network) Router

func (net Network) Router(router *mux.Router)

type Password

type Password struct {
	Old string `json:"old"`
	New string `json:"new"`
}

type Processor

type Processor struct {
}

func (Processor) Delete added in v0.8.40

func (proc Processor) Delete(w http.ResponseWriter, r *http.Request)

func (Processor) Get added in v0.8.40

func (proc Processor) Get(w http.ResponseWriter, r *http.Request)

func (Processor) Post added in v0.8.40

func (proc Processor) Post(w http.ResponseWriter, r *http.Request)

func (Processor) Put added in v0.8.40

func (proc Processor) Put(w http.ResponseWriter, r *http.Request)

func (Processor) Router

func (proc Processor) Router(router *mux.Router)

type ProxyTcp

type ProxyTcp struct {
}

func (ProxyTcp) Get added in v0.8.40

func (pro ProxyTcp) Get(w http.ResponseWriter, r *http.Request)

func (ProxyTcp) GetTarget

func (pro ProxyTcp) GetTarget(host string, inst *schema.Instance, leases schema.DHCPLeases) []schema.Target

func (ProxyTcp) Graphics

func (pro ProxyTcp) Graphics(inst *schema.Instance) []schema.Target

func (ProxyTcp) Local

func (pro ProxyTcp) Local(user *schema.User) []schema.Target

func (ProxyTcp) Remote

func (pro ProxyTcp) Remote(user *schema.User) []schema.Target

func (ProxyTcp) Router

func (pro ProxyTcp) Router(router *mux.Router)

type Snapshot added in v0.8.40

type Snapshot struct {
}

func (Snapshot) Delete added in v0.8.40

func (in Snapshot) Delete(w http.ResponseWriter, r *http.Request)

func (Snapshot) Get added in v0.8.40

func (in Snapshot) Get(w http.ResponseWriter, r *http.Request)

func (Snapshot) Post added in v0.8.40

func (in Snapshot) Post(w http.ResponseWriter, r *http.Request)

func (Snapshot) Revert added in v0.8.40

func (in Snapshot) Revert(w http.ResponseWriter, r *http.Request)

func (Snapshot) Router added in v0.8.40

func (in Snapshot) Router(router *mux.Router)

type Upload

type Upload struct {
}

func (Upload) Get added in v0.8.40

func (up Upload) Get(w http.ResponseWriter, r *http.Request)

func (Upload) Post added in v0.8.40

func (up Upload) Post(w http.ResponseWriter, r *http.Request)

func (Upload) Router

func (up Upload) Router(router *mux.Router)

type User

type User struct {
}

func (User) Delete added in v0.8.40

func (u User) Delete(writer http.ResponseWriter, request *http.Request)

func (User) Get added in v0.8.40

func (u User) Get(writer http.ResponseWriter, request *http.Request)

func (User) Post added in v0.8.40

func (u User) Post(writer http.ResponseWriter, request *http.Request)

func (User) Put added in v0.8.40

func (u User) Put(writer http.ResponseWriter, request *http.Request)

func (User) Router

func (u User) Router(router *mux.Router)

type Volume

type Volume struct {
}

func (Volume) Delete added in v0.8.40

func (v Volume) Delete(w http.ResponseWriter, r *http.Request)

func (Volume) Get added in v0.8.40

func (v Volume) Get(w http.ResponseWriter, r *http.Request)

func (Volume) Post added in v0.8.40

func (v Volume) Post(w http.ResponseWriter, r *http.Request)

func (Volume) Put added in v0.8.40

func (v Volume) Put(w http.ResponseWriter, r *http.Request)

func (Volume) Router

func (v Volume) Router(router *mux.Router)

type Zone

type Zone struct {
}

func (Zone) Delete added in v0.8.40

func (z Zone) Delete(w http.ResponseWriter, r *http.Request)

func (Zone) Get added in v0.8.40

func (z Zone) Get(w http.ResponseWriter, r *http.Request)

func (Zone) Post added in v0.8.40

func (z Zone) Post(w http.ResponseWriter, r *http.Request)

func (Zone) Put added in v0.8.40

func (z Zone) Put(w http.ResponseWriter, r *http.Request)

func (Zone) Router

func (z Zone) Router(router *mux.Router)

Jump to

Keyboard shortcuts

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