pve

package module
v0.0.0-...-a719b6a Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuInfo

type CpuInfo struct {
	Cpus    uint8   `json:"cpus"`
	Hvm     uint8   `json:"hvm"`
	Mhz     float64 `json:"mhz,string"`
	Model   string  `json:"model"`
	Sockets uint8   `json:"sockets"`
	UserHz  uint8   `json:"user_hz"`
}

type Login

type Login struct {
	Ticket              string `json:"ticket"`
	CSRFPreventionToken string `json:"CSRFPreventionToken"`
	Username            string `json:"username"`
}

type Network

type Network struct {
	Active             bool   `json:"active"`
	AutoStart          bool   `json:"autostart"`
	Exists             bool   `json:"exists"`
	BridgeForwardDelay int16  `json:"bridge_fd,string"`
	BridgePorts        string `json:"bridge_ports"`
	BridgeStp          bool   `json:"bridge_stp"`
	Iface              string `json:"iface"`
	Method             string `json:"method"`
	Address            string `json:"address"`
	NetMask            string `json:"netmask"`
	Gateway            string `json:"gateway"`
	Type               string `json:"type"`
	Priority           uint8  `json:"priority"`
}

func (*Network) UnmarshalJSON

func (task *Network) UnmarshalJSON(data []byte) error

type NetworkResponse

type NetworkResponse struct {
	Data []Network `json:"data"`
}

type Node

type Node struct {
	Cpu        float64   `json:"cpu"`
	Wait       float64   `json:"wait"`
	CpuInfo    CpuInfo   `json:"cpuinfo"`
	KVersion   string    `json:"kversion"`
	PveVersion string    `json:"pveversion"`
	Uptime     int64     `json:"uptime"`
	LoadAvg    []float64 `json:"loadavg"`
	Memory     Size      `json:"memory"`
	Swap       Size      `json:"swap"`
	RootFS     Size      `json:"rootfs"`
}

func (*Node) UnmarshalJSON

func (node *Node) UnmarshalJSON(data []byte) error

type PveClient

type PveClient struct {
	// contains filtered or unexported fields
}

func NewPveClient

func NewPveClient(client *http.Client, BaseURL string, UserAgent string, Username string, Password string, Realm string) *PveClient

func (*PveClient) CheckLogin

func (client *PveClient) CheckLogin() error

func (*PveClient) GetNode

func (client *PveClient) GetNode(name string) (*Node, error)

func (*PveClient) GetNodeList

func (client *PveClient) GetNodeList() ([]string, error)

func (*PveClient) GetNodeNetworks

func (client *PveClient) GetNodeNetworks(name string) ([]Network, error)

func (*PveClient) GetQemuStatus

func (client *PveClient) GetQemuStatus(name string, vmid string) (*QemuStatus, error)

func (*PveClient) GetResources

func (client *PveClient) GetResources() ([]interface{}, error)

func (*PveClient) GetTasks

func (client *PveClient) GetTasks() ([]Task, error)

func (*PveClient) Login

func (client *PveClient) Login() (*Login, error)

func (PveClient) SetDebug

func (client PveClient) SetDebug(debug bool)

type QemuStatus

type QemuStatus struct {
	Cpu       float64 `json:"cpu"`
	Disk      uint8   `json:"disk"`
	Name      string  `json:"name"`
	Status    string  `json:"status"`
	Template  string  `json:"template"`
	Pid       uint16  `json:"pid,string"`
	DiskRead  uint64  `json:"diskread"`
	DiskWrite uint64  `json:"diskwrite"`
	Maxmem    uint64  `json:"maxmem"`
	Maxdisk   uint64  `json:"maxdisk"`
	Uptime    uint32  `json:"uptime"`
	Mem       uint64  `json:"mem"`
	NetIn     uint64  `json:"netin"`
	NetOut    uint64  `json:"netout"`
}

type Resource

type Resource struct {
	Data []interface{} `json:"data"`
}

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(data []byte) error

type ResourceResponse

type ResourceResponse struct {
	Data []json.RawMessage `json:"data"`
}

type Size

type Size struct {
	Free  uint64 `json:"free"`
	Used  uint64 `json:"used"`
	Total uint64 `json:"total"`
}

type Task

type Task struct {
	Id        string    `json:"id"`
	Node      string    `json:"node"`
	Saved     bool      `json:"saved"`
	StartTime time.Time `json:"starttime"`
	EndTime   time.Time `json:"endtime"`
	Status    string    `json:"status"`
	Type      string    `json:"type"`
	UPid      string    `json:"upid"`
	User      string    `json:"user"`
}

func (*Task) UnmarshalJSON

func (task *Task) UnmarshalJSON(data []byte) error

type TaskResponse

type TaskResponse struct {
	Data []Task `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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