Documentation ¶
Index ¶
- Constants
- type APICaller
- type APITarget
- type BackupComp
- type BackupMode
- type BaseLxcConfig
- type BaseStorageItem
- type BaseTask
- type BasicObject
- type LVMVolumeGroup
- type Lxc
- func (lxc *Lxc) GetStatus() (*LxcStatus, error)
- func (lxc *Lxc) Shutdown(forceStop bool, timeout int) (*TaskID, error)
- func (lxc *Lxc) Start(skiplock bool) (*TaskID, error)
- func (lxc *Lxc) Stop(skiplock bool) (*TaskID, error)
- func (lxc *Lxc) WaitForStatus(status string, timeout int) (bool, *LxcStatus, error)
- type LxcBase
- type LxcConfig
- type LxcConfigReceiver
- type LxcStatus
- type MountPoint
- type NetworkConfig
- type Node
- func (n *Node) CreateLxc(lxcParams LxcConfig) (*TaskID, error)
- func (n *Node) GetLxc(vmid int64) (*Lxc, error)
- func (n *Node) GetLxcList() ([]Lxc, error)
- func (n *Node) GetStorageList() ([]Storage, error)
- func (n *Node) GetTasks() ([]Task, error)
- func (n *Node) RemoveLxc(vmid int64) (*TaskID, error)
- func (n *Node) RestoreLxc(vmid int64, storageContentItem StorageContentItem, storage string, force bool, ...) (*TaskID, error)
- func (n *Node) ScanLVM() ([]LVMVolumeGroup, error)
- func (n *Node) ScanUSB() ([]USBDevice, error)
- func (n *Node) VZDump(vmid int64, storage Storage, mode BackupMode, comp BackupComp, remove bool) (*TaskID, error)
- type Proxmox
- func (px *Proxmox) APICall(method string, target APITarget, data url.Values) ([]byte, int, error)
- func (px *Proxmox) APICall2(method string, target string, data url.Values, result interface{}, ...) (int, error)
- func (px *Proxmox) DataUnmarshal(body []byte, v interface{}, ac APICaller) error
- func (px *Proxmox) GetAuthTicket() string
- func (px *Proxmox) GetHost() string
- func (px *Proxmox) GetNode(nodeName string) (*Node, error)
- func (px *Proxmox) GetNodes() ([]Node, error)
- func (px *Proxmox) GetProxmoxVersion() (*ProxmoxVersionInfo, error)
- func (px *Proxmox) GetStorageList() ([]Storage, error)
- func (px *Proxmox) MakeAPITarget(path string) (APITarget, error)
- type ProxmoxVersionInfo
- type StartupConfig
- type Storage
- type StorageContentItem
- type Task
- type TaskID
- type TaskStatus
- type USBDevice
Constants ¶
View Source
const ( LXC_CMODE_CONSOLE = "console" LXC_CMODE_SHELL = "shell" LXC_CMODE_TTY = "tty" LXC_ARCH_AMD64 = "amd64" LXC_ARCH_I386 = "i386" LXC_LOCK_BACKUP = "backup" LXC_LOCK_MIGRATE = "migrate" LXC_LOCK_ROLBACK = "rollback" LXC_LOCK_SNAPSHOT = "snapshot" )
View Source
const ( BACKUP_MODE_SNAPSHOT BackupMode = 0 BACKUP_MODE_SUSPEND BackupMode = 1 BACKUP_MODE_STOP BackupMode = 2 BACKUP_COMP_LZO BackupComp = 0 BACKUP_COMP_GZIP BackupComp = 1 )
View Source
const ( HTTP_TIMEOUT = 5 API_TARGET = "/api2/json/" API_AUTH_TARGET = "access/ticket" API_TOKEN_LIFETIME = 120 API_TOKEN_UPDATEBEFORE = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupComp ¶
type BackupComp int
func (BackupComp) String ¶
func (bc BackupComp) String() string
type BackupMode ¶
type BackupMode int
func (BackupMode) String ¶
func (bm BackupMode) String() string
type BaseLxcConfig ¶
type BaseLxcConfig struct { Arch string `json:"arch"` CMode string `json:"cmode"` Console bool `json:"console"` Cores int `json:"cores"` CpuLimit int `json:"cpulimit"` CpuUnits int `json:"cpuunits"` Description string `json:"description"` Force bool `json:"force"` Hostname string `json:"hostname"` Lock string `json:"lock"` Memory int `json:"memory"` NameServer string `json:"nameserver"` OnBoot bool `json:"onboot"` OSTemplate string `json:"ostemplate"` OSType string `json:"ostype"` Password string `json:"password"` Pool string `json:"pool"` Protection bool `json:"protection"` Restore bool `json:"restore"` SearchDomain string `json:"search_domain"` Storage string `json:"storage"` Swap int `json:"swap"` Template bool `json:"template"` Tty int `json:"tty"` Unprivileged bool `json:"unprivileged"` VmId int64 `json:"vmid"` RootFS string `json:"rootfs"` }
type BaseStorageItem ¶
type BaseTask ¶
type BaseTask struct { Id string `json:"id"` Node string `json:"node"` PID int `json:"pid"` PStart int `json:"pstart"` StartTime int `json:"starttime"` Status string `json:"status"` // Task("OK"),TaskStatus("running","stopped") Type string `json:"type"` UPid TaskID `json:"upid"` User string `json:"user"` }
type BasicObject ¶
type BasicObject struct {
// contains filtered or unexported fields
}
func NewBasicObject ¶
func NewBasicObject(parent interface{}) BasicObject
func (BasicObject) GetNode ¶
func (bo BasicObject) GetNode() *Node
func (BasicObject) GetParent ¶
func (bo BasicObject) GetParent() interface{}
func (BasicObject) GetProxmox ¶
func (bo BasicObject) GetProxmox() *Proxmox
type LVMVolumeGroup ¶
type Lxc ¶
type Lxc struct { Pid int `json:"pid,string"` LxcBase BasicObject }
type LxcBase ¶
type LxcBase struct { Cpu float64 `json:"cpu"` Cpus interface{} `json:"cpus"` Disk int64 `json:"disk"` DiskRead interface{} `json:"diskread,omitempty"` DiskWrite interface{} `json:"diskwrite,omitempty"` MaxDisk int64 `json:"maxdisk"` MaxMem int64 `json:"maxmem"` MaxSwap int64 `json:"maxswap"` Mem int64 `json:"mem"` Name string `json:"name"` NetIn int64 `json:"netin"` NetOut int64 `json:"netout"` Status string `json:"status"` Swap int64 `json:"swap"` Template string `json:"template"` Type string `json:"type"` Uptime int64 `json:"uptime"` VmId int64 `json:"vmid,string"` }
type LxcConfig ¶
type LxcConfig struct { MountPoints []MountPoint Networks []NetworkConfig Startup StartupConfig BaseLxcConfig }
func (*LxcConfig) GetUrlDataValues ¶
type LxcConfigReceiver ¶
type LxcConfigReceiver struct { Mp0 string `json:"mp0"` Mp1 string `json:"mp1"` Mp2 string `json:"mp2"` Mp3 string `json:"mp3"` Mp4 string `json:"mp4"` Mp5 string `json:"mp5"` Mp6 string `json:"mp6"` Mp7 string `json:"mp7"` Mp8 string `json:"mp8"` Mp9 string `json:"mp9"` Net0 string `json:"net0"` Net1 string `json:"net1"` Net2 string `json:"net2"` Net3 string `json:"net3"` Net4 string `json:"net4"` Net5 string `json:"net5"` Net6 string `json:"net6"` Net7 string `json:"net7"` Net8 string `json:"net8"` Net9 string `json:"net9"` Startup string `json:"startup"` Lxc []interface{} `json:"lxc"` BaseLxcConfig }
func (*LxcConfigReceiver) Parse ¶
func (lcr *LxcConfigReceiver) Parse() *LxcConfig
type MountPoint ¶
type MountPoint struct { Index int Volume string Path string BaseStorageItem }
func (*MountPoint) SetFromString ¶
func (mp *MountPoint) SetFromString(idx int, str string)
func (*MountPoint) String ¶
func (mp *MountPoint) String() string
type NetworkConfig ¶
type NetworkConfig struct { Index int Name string Bridge string Firewall bool Gateway string GatewayV6 string HWAddr string IPAddress string IPAddresV6 string MTU int Rate int Tag int Trunks string Type string }
func (*NetworkConfig) SetFromString ¶
func (nc *NetworkConfig) SetFromString(idx int, str string)
func (*NetworkConfig) String ¶
func (nc *NetworkConfig) String() string
type Node ¶
type Node struct { Cpu float64 `json:"cpu"` Disk int64 `json:"disk"` Id string `json:"id"` Level string `json:"level"` MaxCpu int `json:"maxcpu"` MaxDisk int64 `json:"maxdisk"` MaxMem int64 `json:"maxmem"` Mem int64 `json:"mem"` Node string `json:"node"` Type string `json:"type"` Uptime int64 `json:"uptime"` BasicObject }
func (*Node) GetLxcList ¶
func (*Node) GetStorageList ¶
func (*Node) RestoreLxc ¶
func (*Node) ScanLVM ¶
func (n *Node) ScanLVM() ([]LVMVolumeGroup, error)
func (*Node) VZDump ¶
func (n *Node) VZDump(vmid int64, storage Storage, mode BackupMode, comp BackupComp, remove bool) (*TaskID, error)
type Proxmox ¶
func (*Proxmox) DataUnmarshal ¶
func (*Proxmox) GetAuthTicket ¶
func (*Proxmox) GetProxmoxVersion ¶
func (px *Proxmox) GetProxmoxVersion() (*ProxmoxVersionInfo, error)
func (*Proxmox) GetStorageList ¶
type ProxmoxVersionInfo ¶
type StartupConfig ¶
func (*StartupConfig) SetFromString ¶
func (sc *StartupConfig) SetFromString(str string)
func (*StartupConfig) String ¶
func (sc *StartupConfig) String() string
type Storage ¶
type Storage struct { Content string `json:"content"` Digest string `json:"digest"` Maxfiles int64 `json:"maxfiles"` Path string `json:"path"` Storage string `json:"storage"` Type string `json:"type"` BasicObject }
func (*Storage) GetContents ¶
func (s *Storage) GetContents() ([]StorageContentItem, error)
type StorageContentItem ¶
type Task ¶
type Task struct { EndTime int `json:"endtime"` BaseTask BasicObject }
func (*Task) GetStatus ¶
func (t *Task) GetStatus() (*TaskStatus, error)
func (*Task) WaitForStatus ¶
type TaskStatus ¶
type USBDevice ¶
type USBDevice struct { Busnum int `json:"busnum"` Class int `json:"class"` Devnum int `json:"devnum"` Level int `json:"level"` Manufacturer string `json:"manufacturer"` Port int `json:"port"` Prodid string `json:"prodid"` Product string `json:"product"` Speed string `json:"speed"` Usbpath string `json:"usbpath"` Vendid string `json:"vendid"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.