proxmox

package
v0.3.10-0-alpha...-9b162f2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLOUD_PROVIDER_PROXMOX = api.CLOUD_PROVIDER_PROXMOX
	AUTH_ADDR              = "/access/ticket"
)

Variables

This section is empty.

Functions

func DiskSizeGB

func DiskSizeGB(dcSize interface{}) float64

Convert a disk-size string to a GB float

func Itob

func Itob(i int) bool

func ParseSubConf

func ParseSubConf(
	element string,
	separator string,
) (key string, value interface{})

ParseSubConf - Parse standard sub-conf strings `key=value`.

Types

type ClusterStatus

type ClusterStatus struct {
	Nodes   int    `json:"nodes,omitempty"`
	Quorate int    `json:"quorate,omitempty"`
	Version int    `json:"version,omitempty"`
	Type    string `json:"type"`
	ID      string `json:"id"`
	Name    string `json:"name"`
	Online  int    `json:"online,omitempty"`
	Level   string `json:"level,omitempty"`
	Nodeid  int    `json:"nodeid,omitempty"`
	Local   int    `json:"local,omitempty"`
	IP      string `json:"ip,omitempty"`
}

type Cpuinfo

type Cpuinfo struct {
	Flags   string  `json:"flags"`
	Hvm     string  `json:"hvm"`
	Cores   int     `json:"cores"`
	Model   string  `json:"model"`
	Mhz     float64 `json:"mhz"`
	Cpus    int     `json:"cpus"`
	UserHz  int     `json:"user_hz"`
	Sockets int     `json:"sockets"`
}

type InstanceVnc

type InstanceVnc struct {
	Port   int
	Ticket string
	Cert   string
}

type Intermediate

type Intermediate struct {
	HardwareAddress string `json:"hardware-address"`
	IPAddresses     []struct {
		IPAddress     string `json:"ip-address"`
		IPAddressType string `json:"ip-address-type"`
		Prefix        int    `json:"prefix"`
	} `json:"ip-addresses"`
	Name       string           `json:"name"`
	Statistics map[string]int64 `json:"statistics"`
}

type Ksm

type Ksm struct {
	Shared int `json:"shared"`
}

type Memory

type Memory struct {
	Free  int64 `json:"free"`
	Used  int64 `json:"used"`
	Total int64 `json:"total"`
}

type ProxmoxClientConfig

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

func NewProxmoxClientConfig

func NewProxmoxClientConfig(username, password, host string, port int) *ProxmoxClientConfig

func (*ProxmoxClientConfig) CloudproviderConfig

func (self *ProxmoxClientConfig) CloudproviderConfig(cpcfg cloudprovider.ProviderConfig) *ProxmoxClientConfig

func (*ProxmoxClientConfig) Debug

func (self *ProxmoxClientConfig) Debug(debug bool) *ProxmoxClientConfig

type ProxmoxError

type ProxmoxError struct {
	Message string
	Code    int
	Params  []string
	Errors  string
	Status  string
}

func (ProxmoxError) Error

func (self ProxmoxError) Error() string

func (*ProxmoxError) ParseErrorFromJsonResponse

func (ce *ProxmoxError) ParseErrorFromJsonResponse(statusCode int, status string, body jsonutils.JSONObject) error

type ProxmoxTags

type ProxmoxTags struct {
}

func (*ProxmoxTags) GetSysTags

func (self *ProxmoxTags) GetSysTags() map[string]string

func (*ProxmoxTags) GetTags

func (self *ProxmoxTags) GetTags() (map[string]string, error)

func (*ProxmoxTags) SetTags

func (self *ProxmoxTags) SetTags(tags map[string]string, replace bool) error

type QemuDevice

type QemuDevice map[string]interface{}

func ParseConf

func ParseConf(
	kvString string,
	confSeparator string,
	subConfSeparator string,
	implicitFirstKey string,
) QemuDevice

ParseConf - Parse standard device conf string `key1=val1,key2=val2`.

func ParsePMConf

func ParsePMConf(
	kvString string,
	implicitFirstKey string,
) QemuDevice

type QemuDeviceParam

type QemuDeviceParam []string

type QemuDevices

type QemuDevices map[string]map[string]interface{}

type Rootfs

type Rootfs struct {
	Used  int64 `json:"used"`
	Total int64 `json:"total"`
	Avail int64 `json:"avail"`
	Free  int64 `json:"free"`
}

type SClusterResource

type SClusterResource struct {
	Maxcpu     int    `json:"maxcpu,omitempty"`
	Uptime     int    `json:"uptime,omitempty"`
	Template   int    `json:"template,omitempty"`
	Netin      int    `json:"netin,omitempty"`
	Mem        int    `json:"mem,omitempty"`
	Node       string `json:"node"`
	VmId       int    `json:"vmid,omitempty"`
	Maxdisk    int64  `json:"maxdisk"`
	Netout     int    `json:"netout,omitempty"`
	Diskwrite  int    `json:"diskwrite,omitempty"`
	Diskread   int    `json:"diskread,omitempty"`
	Maxmem     int64  `json:"maxmem,omitempty"`
	Disk       int    `json:"disk"`
	CPU        int    `json:"cpu,omitempty"`
	Id         string `json:"id"`
	Type       string `json:"type"`
	Status     string `json:"status"`
	Name       string `json:"name,omitempty"`
	Level      string `json:"level,omitempty"`
	Storage    string `json:"storage,omitempty"`
	Plugintype string `json:"plugintype,omitempty"`
	Content    string `json:"content,omitempty"`
	Shared     int    `json:"shared,omitempty"`
}

type SDisk

type SDisk struct {
	multicloud.SDisk
	ProxmoxTags

	Format  string `json:"format"`
	Size    int64  `json:"size"`
	Vmid    string
	VolId   string `json:"volid"`
	Name    string `json:"name"`
	Parent  string `json:"parent"`
	Content string `json:"content"`
	// contains filtered or unexported fields
}

func (*SDisk) CreateISnapshot

func (self *SDisk) CreateISnapshot(ctx context.Context, name, desc string) (cloudprovider.ICloudSnapshot, error)

func (*SDisk) Delete

func (self *SDisk) Delete(ctx context.Context) error

func (*SDisk) GetAccessPath

func (self *SDisk) GetAccessPath() string

func (*SDisk) GetCacheMode

func (self *SDisk) GetCacheMode() string

func (*SDisk) GetDiskFormat

func (self *SDisk) GetDiskFormat() string

func (*SDisk) GetDiskSizeMB

func (self *SDisk) GetDiskSizeMB() int

func (*SDisk) GetDiskType

func (self *SDisk) GetDiskType() string

func (*SDisk) GetDriver

func (self *SDisk) GetDriver() string

func (*SDisk) GetFsFormat

func (self *SDisk) GetFsFormat() string

func (*SDisk) GetGlobalId

func (self *SDisk) GetGlobalId() string

func (*SDisk) GetISnapshot

func (self *SDisk) GetISnapshot(snapshotId string) (cloudprovider.ICloudSnapshot, error)

func (*SDisk) GetISnapshots

func (self *SDisk) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SDisk) GetIStorage

func (self *SDisk) GetIStorage() (cloudprovider.ICloudStorage, error)

func (*SDisk) GetId

func (self *SDisk) GetId() string

func (*SDisk) GetIsAutoDelete

func (self *SDisk) GetIsAutoDelete() bool

func (*SDisk) GetIsNonPersistent

func (self *SDisk) GetIsNonPersistent() bool

func (*SDisk) GetMountpoint

func (self *SDisk) GetMountpoint() string

func (*SDisk) GetName

func (self *SDisk) GetName() string

func (*SDisk) GetStatus

func (self *SDisk) GetStatus() string

func (*SDisk) GetTemplateId

func (self *SDisk) GetTemplateId() string

func (*SDisk) Rebuild

func (self *SDisk) Rebuild(ctx context.Context) error

func (*SDisk) Refresh

func (self *SDisk) Refresh() error

func (*SDisk) Reset

func (self *SDisk) Reset(ctx context.Context, snapshotId string) (string, error)

func (*SDisk) Resize

func (self *SDisk) Resize(ctx context.Context, sizeMb int64) error

type SHost

type SHost struct {
	multicloud.SHostBase
	ProxmoxTags

	Id   string
	Node string

	Uptime     int      `json:"uptime"`
	Wait       int      `json:"wait"`
	Idle       int      `json:"idle"`
	Kversion   string   `json:"kversion"`
	Pveversion string   `json:"pveversion"`
	CPU        int      `json:"cpu"`
	Loadavg    []string `json:"loadavg"`
	Rootfs     Rootfs   `json:"rootfs"`
	Swap       Swap     `json:"swap"`
	Memory     Memory   `json:"memory"`
	Cpuinfo    Cpuinfo  `json:"cpuinfo"`
	Ksm        Ksm      `json:"ksm"`
	// contains filtered or unexported fields
}

func (*SHost) CreateVM

func (*SHost) GetAccessIp

func (self *SHost) GetAccessIp() string

func (*SHost) GetAccessMac

func (self *SHost) GetAccessMac() string

func (*SHost) GetCpuCmtbound

func (self *SHost) GetCpuCmtbound() float32

func (*SHost) GetCpuCount

func (self *SHost) GetCpuCount() int

func (*SHost) GetCpuDesc

func (self *SHost) GetCpuDesc() string

func (*SHost) GetCpuMhz

func (self *SHost) GetCpuMhz() int

func (*SHost) GetEnabled

func (self *SHost) GetEnabled() bool

func (*SHost) GetGlobalId

func (self *SHost) GetGlobalId() string

func (*SHost) GetHostStatus

func (self *SHost) GetHostStatus() string

func (*SHost) GetHostType

func (self *SHost) GetHostType() string

func (*SHost) GetIHostNics

func (host *SHost) GetIHostNics() ([]cloudprovider.ICloudHostNetInterface, error)

func (*SHost) GetIStorageById

func (self *SHost) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SHost) GetIStorages

func (self *SHost) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SHost) GetIVMById

func (self *SHost) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SHost) GetIVMs

func (self *SHost) GetIVMs() ([]cloudprovider.ICloudVM, error)

func (*SHost) GetId

func (self *SHost) GetId() string

func (*SHost) GetIsMaintenance

func (self *SHost) GetIsMaintenance() bool

func (*SHost) GetMemCmtbound

func (self *SHost) GetMemCmtbound() float32

func (*SHost) GetMemSizeMB

func (self *SHost) GetMemSizeMB() int

func (*SHost) GetName

func (self *SHost) GetName() string

func (*SHost) GetNodeCount

func (self *SHost) GetNodeCount() int8

func (*SHost) GetReservedMemoryMb

func (self *SHost) GetReservedMemoryMb() int

func (*SHost) GetSN

func (self *SHost) GetSN() string

func (*SHost) GetStatus

func (self *SHost) GetStatus() string

func (*SHost) GetStorageSizeMB

func (self *SHost) GetStorageSizeMB() int

func (*SHost) GetStorageType

func (self *SHost) GetStorageType() string

func (*SHost) GetSysInfo

func (self *SHost) GetSysInfo() jsonutils.JSONObject

func (*SHost) GetVersion

func (self *SHost) GetVersion() string

type SImage

type SImage struct {
	multicloud.SImageBase
	ProxmoxTags

	Volid   string
	Size    int64
	Ctime   int64
	Content string
	Format  string
	// contains filtered or unexported fields
}

func (*SImage) Delete

func (self *SImage) Delete(ctx context.Context) error

func (*SImage) GetBios

func (img *SImage) GetBios() cloudprovider.TBiosType

func (*SImage) GetFullOsName

func (img *SImage) GetFullOsName() string

func (*SImage) GetGlobalId

func (self *SImage) GetGlobalId() string

func (*SImage) GetIStoragecache

func (self *SImage) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SImage) GetId

func (self *SImage) GetId() string

func (*SImage) GetImageFormat

func (self *SImage) GetImageFormat() string

func (*SImage) GetImageStatus

func (self *SImage) GetImageStatus() string

func (*SImage) GetImageType

func (self *SImage) GetImageType() cloudprovider.TImageType

func (*SImage) GetMinOsDiskSizeGb

func (self *SImage) GetMinOsDiskSizeGb() int

func (*SImage) GetMinRamSizeMb

func (self *SImage) GetMinRamSizeMb() int

func (*SImage) GetName

func (self *SImage) GetName() string

func (*SImage) GetOsArch

func (img *SImage) GetOsArch() string

func (*SImage) GetOsDist

func (img *SImage) GetOsDist() string

func (*SImage) GetOsLang

func (img *SImage) GetOsLang() string

func (*SImage) GetOsType

func (img *SImage) GetOsType() cloudprovider.TOsType

func (*SImage) GetOsVersion

func (img *SImage) GetOsVersion() string

func (*SImage) GetSizeByte

func (self *SImage) GetSizeByte() int64

func (*SImage) GetStatus

func (self *SImage) GetStatus() string

type SInstance

type SInstance struct {
	multicloud.SInstanceBase
	ProxmoxTags

	QemuNetworks []SInstanceNic
	PowerState   string
	Node         string

	VmID        int        `json:"vmid"`
	Name        string     `json:"name"`
	Description string     `json:"desc"`
	Pool        string     `json:"pool,omitempty"`
	Bios        string     `json:"bios"`
	EFIDisk     QemuDevice `json:"efidisk,omitempty"`
	Machine     string     `json:"machine,omitempty"`
	Onboot      bool       `json:"onboot"`
	Startup     string     `json:"startup,omitempty"`
	Tablet      bool       `json:"tablet"`
	Agent       int        `json:"agent"`
	Memory      int        `json:"memory"`
	Balloon     int        `json:"balloon"`
	QemuOs      string     `json:"ostype"`
	QemuCores   int        `json:"cores"`
	QemuSockets int        `json:"sockets"`
	QemuVcpus   int        `json:"vcpus"`
	QemuCpu     string     `json:"cpu"`
	QemuNuma    bool       `json:"numa"`
	QemuKVM     bool       `json:"kvm"`
	Hotplug     string     `json:"hotplug"`
	QemuIso     string     `json:"iso"`
	QemuPxe     bool       `json:"pxe"`
	FullClone   *int       `json:"fullclone"`
	Boot        string     `json:"boot"`
	BootDisk    string     `json:"bootdisk,omitempty"`
	Scsihw      string     `json:"scsihw,omitempty"`
	QemuDisks   map[string][]struct {
		Driver string
		DiskId string
	} `json:"disk"`
	QemuUnusedDisks QemuDevices `json:"unused_disk"`
	QemuVga         QemuDevice  `json:"vga,omitempty"`
	QemuSerials     QemuDevices `json:"serial,omitempty"`
	QemuUsbs        QemuDevices `json:"usb,omitempty"`
	Hookscript      string      `json:"hookscript,omitempty"`
	Tags            string      `json:"tags"`
	Args            string      `json:"args"`

	// Deprecated single disk.
	DiskSize    float64 `json:"diskGB"`
	Storage     string  `json:"storage"`
	StorageType string  `json:"storageType"` // virtio|scsi (cloud-init defaults to scsi)

	// Deprecated single nic.
	QemuNicModel string `json:"nic"`
	QemuBridge   string `json:"bridge"`
	QemuVlanTag  int    `json:"vlan"`
	QemuMacAddr  string `json:"mac"`

	// cloud-init options
	CIuser     string `json:"ciuser"`
	CIpassword string `json:"cipassword"`
	CIcustom   string `json:"cicustom"`

	Searchdomain string `json:"searchdomain"`
	Nameserver   string `json:"nameserver"`
	Sshkeys      string `json:"sshkeys"`
	// contains filtered or unexported fields
}

func (*SInstance) AttachDisk

func (self *SInstance) AttachDisk(ctx context.Context, diskId string) error

func (*SInstance) ChangeConfig

func (self *SInstance) ChangeConfig(ctx context.Context, opts *cloudprovider.SManagedVMChangeConfig) error

func (*SInstance) CreateDisk

func (self *SInstance) CreateDisk(ctx context.Context, opts *cloudprovider.GuestDiskCreateOptions) (string, error)

func (*SInstance) DeleteVM

func (self *SInstance) DeleteVM(ctx context.Context) error

func (*SInstance) DeployVM

func (self *SInstance) DeployVM(ctx context.Context, name string, username string, password string, publicKey string, deleteKeypair bool, description string) error

func (*SInstance) DetachDisk

func (self *SInstance) DetachDisk(ctx context.Context, diskId string) error

func (*SInstance) GetBios

func (self *SInstance) GetBios() cloudprovider.TBiosType

func (*SInstance) GetBootOrder

func (self *SInstance) GetBootOrder() string

func (*SInstance) GetError

func (self *SInstance) GetError() error

func (*SInstance) GetFullOsName

func (self *SInstance) GetFullOsName() string

func (*SInstance) GetGlobalId

func (self *SInstance) GetGlobalId() string

func (*SInstance) GetHostname

func (self *SInstance) GetHostname() string

func (*SInstance) GetHypervisor

func (self *SInstance) GetHypervisor() string

func (*SInstance) GetIDisks

func (self *SInstance) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SInstance) GetIEIP

func (self *SInstance) GetIEIP() (cloudprovider.ICloudEIP, error)

func (*SInstance) GetIHost

func (self *SInstance) GetIHost() cloudprovider.ICloudHost

func (*SInstance) GetINics

func (self *SInstance) GetINics() ([]cloudprovider.ICloudNic, error)

func (*SInstance) GetId

func (self *SInstance) GetId() string

func (*SInstance) GetInstanceType

func (self *SInstance) GetInstanceType() string

func (*SInstance) GetMachine

func (self *SInstance) GetMachine() string

func (*SInstance) GetName

func (self *SInstance) GetName() string

func (*SInstance) GetOsArch

func (ins *SInstance) GetOsArch() string

func (*SInstance) GetOsDist

func (ins *SInstance) GetOsDist() string

func (*SInstance) GetOsLang

func (ins *SInstance) GetOsLang() string

func (*SInstance) GetOsType

func (self *SInstance) GetOsType() cloudprovider.TOsType

func (*SInstance) GetOsVersion

func (ins *SInstance) GetOsVersion() string

func (*SInstance) GetProjectId

func (self *SInstance) GetProjectId() string

func (*SInstance) GetSecurityGroupIds

func (self *SInstance) GetSecurityGroupIds() ([]string, error)

func (*SInstance) GetStatus

func (self *SInstance) GetStatus() string

func (*SInstance) GetVNCInfo

func (*SInstance) GetVcpuCount

func (self *SInstance) GetVcpuCount() int

func (*SInstance) GetVdi

func (self *SInstance) GetVdi() string

func (*SInstance) GetVga

func (self *SInstance) GetVga() string

func (*SInstance) GetVmemSizeMB

func (self *SInstance) GetVmemSizeMB() int

func (*SInstance) RebuildRoot

func (*SInstance) Refresh

func (self *SInstance) Refresh() error

func (*SInstance) SetSecurityGroups

func (self *SInstance) SetSecurityGroups(secgroupIds []string) error

func (*SInstance) StartVM

func (self *SInstance) StartVM(ctx context.Context) error

func (*SInstance) StopVM

func (self *SInstance) StopVM(ctx context.Context, opts *cloudprovider.ServerStopOptions) error

func (*SInstance) UpdateUserData

func (self *SInstance) UpdateUserData(userData string) error

func (*SInstance) UpdateVM

func (*SInstance) VMIdExists

func (self *SInstance) VMIdExists(vmId int) (bool, error)

type SInstanceDisk

type SInstanceDisk struct {
	Storage string
	VolId   string
}

type SInstanceNic

type SInstanceNic struct {
	cloudprovider.DummyICloudNic

	MacAddr   string
	IpAddr    string
	NicId     string
	Model     string
	NetworkId string
	// contains filtered or unexported fields
}

func (*SInstanceNic) AssignAddress

func (self *SInstanceNic) AssignAddress(ipAddrs []string) error

func (*SInstanceNic) GetDriver

func (self *SInstanceNic) GetDriver() string

func (*SInstanceNic) GetINetworkId

func (self *SInstanceNic) GetINetworkId() string

func (*SInstanceNic) GetIP

func (self *SInstanceNic) GetIP() string

func (*SInstanceNic) GetId

func (self *SInstanceNic) GetId() string

func (*SInstanceNic) GetMAC

func (self *SInstanceNic) GetMAC() string

func (*SInstanceNic) GetSubAddress

func (self *SInstanceNic) GetSubAddress() ([]string, error)

func (*SInstanceNic) InClassicNetwork

func (self *SInstanceNic) InClassicNetwork() bool

type SNetwork

type SNetwork struct {
	multicloud.SResourceBase
	ProxmoxTags

	Id string

	Priority        int      `json:"priority"`
	Families        []string `json:"families"`
	Method          string   `json:"method"`
	Autostart       int      `json:"autostart,omitempty"`
	Iface           string   `json:"iface"`
	BridgeFd        string   `json:"bridge_fd,omitempty"`
	Method6         string   `json:"method6"`
	BridgePorts     string   `json:"bridge_ports,omitempty"`
	Type            string   `json:"type"`
	Active          int      `json:"active"`
	BridgeStp       string   `json:"bridge_stp,omitempty"`
	BridgeVids      string   `json:"bridge_vids,omitempty"`
	Netmask         string   `json:"netmask,omitempty"`
	Address         string   `json:"address,omitempty"`
	BridgeVlanAware int      `json:"bridge_vlan_aware,omitempty"`
	Gateway         string   `json:"gateway,omitempty"`
	Cidr            string   `json:"cidr,omitempty"`
	Exists          int      `json:"exists,omitempty"`
	Options         []string `json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*SNetwork) Contains

func (self *SNetwork) Contains(_ip string) bool

func (*SNetwork) Delete

func (self *SNetwork) Delete() error

func (*SNetwork) GetAllocTimeoutSeconds

func (self *SNetwork) GetAllocTimeoutSeconds() int

func (*SNetwork) GetGateway

func (self *SNetwork) GetGateway() string

func (*SNetwork) GetGlobalId

func (self *SNetwork) GetGlobalId() string

func (*SNetwork) GetIWire

func (self *SNetwork) GetIWire() cloudprovider.ICloudWire

func (*SNetwork) GetId

func (self *SNetwork) GetId() string

func (*SNetwork) GetIpEnd

func (self *SNetwork) GetIpEnd() string

func (*SNetwork) GetIpMask

func (self *SNetwork) GetIpMask() int8

func (*SNetwork) GetIpStart

func (self *SNetwork) GetIpStart() string

func (*SNetwork) GetName

func (self *SNetwork) GetName() string

func (*SNetwork) GetProjectId

func (self *SNetwork) GetProjectId() string

func (*SNetwork) GetPublicScope

func (self *SNetwork) GetPublicScope() rbacscope.TRbacScope

func (*SNetwork) GetServerType

func (self *SNetwork) GetServerType() string

func (*SNetwork) GetStatus

func (self *SNetwork) GetStatus() string

func (*SNetwork) Refresh

func (self *SNetwork) Refresh() error

type SNodeResource

type SNodeResource struct {
	Id   string
	Node string
}

type SProxmoxClient

type SProxmoxClient struct {
	*ProxmoxClientConfig
}

func NewProxmoxClient

func NewProxmoxClient(cfg *ProxmoxClientConfig) (*SProxmoxClient, error)

func (*SProxmoxClient) GetAccountId

func (self *SProxmoxClient) GetAccountId() string

func (*SProxmoxClient) GetCapabilities

func (self *SProxmoxClient) GetCapabilities() []string

func (*SProxmoxClient) GetIRegions

func (self *SProxmoxClient) GetIRegions() []cloudprovider.ICloudRegion

func (*SProxmoxClient) GetImages

func (self *SProxmoxClient) GetImages(node, storageName string) ([]SImage, error)

func (*SProxmoxClient) GetRegion

func (self *SProxmoxClient) GetRegion() *SRegion

func (*SProxmoxClient) GetRegions

func (self *SProxmoxClient) GetRegions() ([]SRegion, error)

func (*SProxmoxClient) GetSubAccounts

func (self *SProxmoxClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error)

type SRegion

type SRegion struct {
	multicloud.SRegion
	multicloud.SRegionEipBase
	multicloud.SNoObjectStorageRegion
	multicloud.SRegionLbBase
	// contains filtered or unexported fields
}

func (*SRegion) ChangeConfig

func (self *SRegion) ChangeConfig(vmId int, cpu int, memMb int) error

func (*SRegion) CreateISecurityGroup

func (*SRegion) CreateIVpc

func (*SRegion) DeleteVM

func (self *SRegion) DeleteVM(vmId int) error

func (*SRegion) DetachDisk

func (self *SRegion) DetachDisk(node string, vmId int, driver string) error

func (*SRegion) GenVM

func (self *SRegion) GenVM(name, node string, cores, memMB int) (*SInstance, error)

func (*SRegion) GetCapabilities

func (self *SRegion) GetCapabilities() []string

func (*SRegion) GetClient

func (self *SRegion) GetClient() *SProxmoxClient

func (*SRegion) GetCloudEnv

func (self *SRegion) GetCloudEnv() string

func (*SRegion) GetClusterAllResources

func (self *SRegion) GetClusterAllResources() ([]SClusterResource, error)

func (*SRegion) GetClusterNodeResources

func (self *SRegion) GetClusterNodeResources() (map[string]SNodeResource, error)

func (*SRegion) GetClusterResources

func (self *SRegion) GetClusterResources(resType string) ([]SClusterResource, error)

func (*SRegion) GetClusterVmMaxId

func (self *SRegion) GetClusterVmMaxId() int

func (*SRegion) GetClusterVmResources

func (self *SRegion) GetClusterVmResources() (map[int]SVmResource, error)

func (*SRegion) GetDisks

func (self *SRegion) GetDisks(node, storageName string) ([]SDisk, error)

func (*SRegion) GetGeographicInfo

func (self *SRegion) GetGeographicInfo() cloudprovider.SGeographicInfo

func (*SRegion) GetGlobalId

func (self *SRegion) GetGlobalId() string

func (*SRegion) GetHost

func (self *SRegion) GetHost(id string) (*SHost, error)

func (*SRegion) GetHosts

func (self *SRegion) GetHosts() ([]SHost, error)

func (*SRegion) GetI18n

func (self *SRegion) GetI18n() cloudprovider.SModelI18nTable

func (*SRegion) GetIHostById

func (self *SRegion) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SRegion) GetISecurityGroupById

func (self *SRegion) GetISecurityGroupById(secgroupId string) (cloudprovider.ICloudSecurityGroup, error)

func (*SRegion) GetIStorageById

func (self *SRegion) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SRegion) GetIStoragecacheById

func (self *SRegion) GetIStoragecacheById(id string) (cloudprovider.ICloudStoragecache, error)

func (*SRegion) GetIStoragecaches

func (self *SRegion) GetIStoragecaches() ([]cloudprovider.ICloudStoragecache, error)

func (*SRegion) GetIVMById

func (self *SRegion) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SRegion) GetIVMs

func (region *SRegion) GetIVMs() ([]cloudprovider.ICloudVM, error)

func (*SRegion) GetIVpcById

func (self *SRegion) GetIVpcById(id string) (cloudprovider.ICloudVpc, error)

func (*SRegion) GetIVpcs

func (self *SRegion) GetIVpcs() ([]cloudprovider.ICloudVpc, error)

func (*SRegion) GetIZoneById

func (self *SRegion) GetIZoneById(id string) (cloudprovider.ICloudZone, error)

func (*SRegion) GetIZones

func (self *SRegion) GetIZones() ([]cloudprovider.ICloudZone, error)

func (*SRegion) GetId

func (self *SRegion) GetId() string

func (*SRegion) GetImages

func (self *SRegion) GetImages(node, storageName string) ([]SImage, error)

func (*SRegion) GetInstance

func (self *SRegion) GetInstance(id string) (*SInstance, error)

func (*SRegion) GetInstances

func (self *SRegion) GetInstances(hostId string) ([]SInstance, error)

func (*SRegion) GetName

func (self *SRegion) GetName() string

func (*SRegion) GetNetwork

func (self *SRegion) GetNetwork(id string) (*SNetwork, error)

func (*SRegion) GetNetworks

func (self *SRegion) GetNetworks() ([]SNetwork, error)

func (*SRegion) GetProvider

func (self *SRegion) GetProvider() string

func (*SRegion) GetQemuConfig

func (self *SRegion) GetQemuConfig(node string, VmId int) (*SInstance, error)

func (*SRegion) GetStatus

func (self *SRegion) GetStatus() string

func (*SRegion) GetStorage

func (self *SRegion) GetStorage(id string) (*SStorage, error)

func (*SRegion) GetStorages

func (self *SRegion) GetStorages() ([]SStorage, error)

func (*SRegion) GetStoragesByHost

func (self *SRegion) GetStoragesByHost(node string) ([]SStorage, error)

func (*SRegion) GetVNCInfo

func (self *SRegion) GetVNCInfo(node string, vmId int) (*InstanceVnc, error)

func (*SRegion) GetVmAgentNetworkInterfaces

func (self *SRegion) GetVmAgentNetworkInterfaces(node string, VmId int) (map[string]string, error)

func (*SRegion) GetVmPowerStatus

func (self *SRegion) GetVmPowerStatus(node string, VmId int) string

func (*SRegion) GetWire

func (self *SRegion) GetWire() (*SWire, error)

func (*SRegion) GetWires

func (self *SRegion) GetWires() ([]SWire, error)

func (*SRegion) GetZone

func (self *SRegion) GetZone() (*SZone, error)

func (*SRegion) Refresh

func (self *SRegion) Refresh() error

func (*SRegion) ResetVmPassword

func (self *SRegion) ResetVmPassword(vmId int, username, password string) error

func (*SRegion) ResizeDisk

func (self *SRegion) ResizeDisk(node string, vmId string, driver string, sizeGb int) error

func (*SRegion) StartVm

func (self *SRegion) StartVm(vmId int) error

func (*SRegion) StopVm

func (self *SRegion) StopVm(vmId int) error

func (*SRegion) UploadImage

func (self *SRegion) UploadImage(node, storage, filename string, reader io.Reader) (*SImage, error)

type SStorage

type SStorage struct {
	multicloud.SStorageBase
	ProxmoxTags

	Storage string `json:"storage"`
	Status  string
	Id      string
	Node    string

	Shared     int    `json:"shared"`
	Content    string `json:"content"`
	MaxDisk    int64  `json:"maxdisk"`
	Disk       int64  `json:"disk"`
	PluginType string `json:"plugintype"`
	// contains filtered or unexported fields
}

func (*SStorage) CreateIDisk

func (*SStorage) GetCapacityMB

func (self *SStorage) GetCapacityMB() int64

func (*SStorage) GetCapacityUsedMB

func (self *SStorage) GetCapacityUsedMB() int64

func (*SStorage) GetEnabled

func (self *SStorage) GetEnabled() bool

func (*SStorage) GetGlobalId

func (self *SStorage) GetGlobalId() string

func (*SStorage) GetIDiskById

func (self *SStorage) GetIDiskById(id string) (cloudprovider.ICloudDisk, error)

func (*SStorage) GetIDisks

func (self *SStorage) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SStorage) GetIStoragecache

func (self *SStorage) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SStorage) GetIZone

func (self *SStorage) GetIZone() cloudprovider.ICloudZone

func (*SStorage) GetId

func (self *SStorage) GetId() string

func (*SStorage) GetMediumType

func (self *SStorage) GetMediumType() string

func (*SStorage) GetMountPoint

func (self *SStorage) GetMountPoint() string

func (*SStorage) GetName

func (self *SStorage) GetName() string

func (*SStorage) GetStatus

func (self *SStorage) GetStatus() string

func (*SStorage) GetStorageConf

func (self *SStorage) GetStorageConf() jsonutils.JSONObject

func (*SStorage) GetStorageType

func (self *SStorage) GetStorageType() string

func (*SStorage) IsSysDiskStore

func (self *SStorage) IsSysDiskStore() bool

func (*SStorage) Refresh

func (self *SStorage) Refresh() error

type SStorageResource

type SStorageResource struct {
	Id      string
	Path    string
	Node    string
	Name    string
	Shared  int
	Content string
}

type SStoragecache

type SStoragecache struct {
	multicloud.SResourceBase
	ProxmoxTags

	Node string
	// contains filtered or unexported fields
}

func (*SStoragecache) GetGlobalId

func (self *SStoragecache) GetGlobalId() string

func (*SStoragecache) GetICloudImages

func (self *SStoragecache) GetICloudImages() ([]cloudprovider.ICloudImage, error)

func (*SStoragecache) GetICustomizedCloudImages

func (seflf *SStoragecache) GetICustomizedCloudImages() ([]cloudprovider.ICloudImage, error)

func (*SStoragecache) GetIImageById

func (self *SStoragecache) GetIImageById(id string) (cloudprovider.ICloudImage, error)

func (*SStoragecache) GetId

func (self *SStoragecache) GetId() string

func (*SStoragecache) GetName

func (self *SStoragecache) GetName() string

func (*SStoragecache) GetPath

func (self *SStoragecache) GetPath() string

func (*SStoragecache) GetStatus

func (self *SStoragecache) GetStatus() string

func (*SStoragecache) UploadImage

func (self *SStoragecache) UploadImage(ctx context.Context, opts *cloudprovider.SImageCreateOption, callback func(float32)) (string, error)

type STask

type STask struct {
	User      string `json:"user"`
	Type      string `json:"type"`
	Saved     string `json:"saved"`
	Status    string `json:"status"`
	Starttime int    `json:"starttime"`
	Node      string `json:"node"`
	ID        string `json:"id"`
	Endtime   int    `json:"endtime"`
	Upid      string `json:"upid"`
}

type SVmResource

type SVmResource struct {
	VmId     int
	Id       string
	Name     string
	Node     string
	NodeId   string
	Status   string
	Template bool
}

type SVpc

type SVpc struct {
	multicloud.SVpc
	ProxmoxTags
	// contains filtered or unexported fields
}

func (*SVpc) Delete

func (self *SVpc) Delete() error

func (*SVpc) GetCidrBlock

func (self *SVpc) GetCidrBlock() string

func (*SVpc) GetGlobalId

func (self *SVpc) GetGlobalId() string

func (*SVpc) GetIRouteTableById

func (self *SVpc) GetIRouteTableById(routeTableId string) (cloudprovider.ICloudRouteTable, error)

func (*SVpc) GetIRouteTables

func (self *SVpc) GetIRouteTables() ([]cloudprovider.ICloudRouteTable, error)

func (*SVpc) GetISecurityGroups

func (self *SVpc) GetISecurityGroups() ([]cloudprovider.ICloudSecurityGroup, error)

func (*SVpc) GetIWireById

func (self *SVpc) GetIWireById(id string) (cloudprovider.ICloudWire, error)

func (*SVpc) GetIWires

func (self *SVpc) GetIWires() ([]cloudprovider.ICloudWire, error)

func (*SVpc) GetId

func (self *SVpc) GetId() string

func (*SVpc) GetIsDefault

func (self *SVpc) GetIsDefault() bool

func (*SVpc) GetName

func (self *SVpc) GetName() string

func (*SVpc) GetRegion

func (self *SVpc) GetRegion() cloudprovider.ICloudRegion

func (*SVpc) GetStatus

func (self *SVpc) GetStatus() string

func (*SVpc) IsEmulated

func (self *SVpc) IsEmulated() bool

type SWire

type SWire struct {
	multicloud.SResourceBase
	ProxmoxTags
	// contains filtered or unexported fields
}

func (*SWire) CreateINetwork

func (*SWire) GetBandwidth

func (self *SWire) GetBandwidth() int

func (*SWire) GetGlobalId

func (self *SWire) GetGlobalId() string

func (*SWire) GetINetworkById

func (self *SWire) GetINetworkById(id string) (cloudprovider.ICloudNetwork, error)

func (*SWire) GetINetworks

func (self *SWire) GetINetworks() ([]cloudprovider.ICloudNetwork, error)

func (*SWire) GetIVpc

func (self *SWire) GetIVpc() cloudprovider.ICloudVpc

func (*SWire) GetIZone

func (self *SWire) GetIZone() cloudprovider.ICloudZone

func (*SWire) GetId

func (self *SWire) GetId() string

func (*SWire) GetName

func (self *SWire) GetName() string

func (*SWire) GetStatus

func (self *SWire) GetStatus() string

type SZone

type SZone struct {
	multicloud.SResourceBase
	ProxmoxTags

	Name    string
	Nodes   int
	Quorate int
	Version int
	// contains filtered or unexported fields
}

func (*SZone) GetGlobalId

func (self *SZone) GetGlobalId() string

func (*SZone) GetI18n

func (self *SZone) GetI18n() cloudprovider.SModelI18nTable

func (*SZone) GetIHostById

func (self *SZone) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SZone) GetIHosts

func (self *SZone) GetIHosts() ([]cloudprovider.ICloudHost, error)

func (*SZone) GetIRegion

func (self *SZone) GetIRegion() cloudprovider.ICloudRegion

func (*SZone) GetIStorageById

func (self *SZone) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SZone) GetIStorages

func (self *SZone) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SZone) GetId

func (self *SZone) GetId() string

func (*SZone) GetName

func (self *SZone) GetName() string

func (*SZone) GetStatus

func (self *SZone) GetStatus() string

type Swap

type Swap struct {
	Free  int64 `json:"free"`
	Used  int64 `json:"used"`
	Total int64 `json:"total"`
}

type VmBase

type VmBase struct {
	Name         string `json:"name"`
	Description  string `json:"Description"`
	Tags         string `json:"tags"`
	Args         string `json:"args"`
	Bios         string `json:"bios"`
	OnBoot       int    `json:"onboot"`
	Startup      string `json:"startup"`
	Tablet       int    `json:"tablet"`
	Ostype       string `json:"ostype"`
	Memory       int64  `json:"memory"`
	Balloon      int64  `json:"balloon"`
	Cores        int64  `json:"cores"`
	Vcpus        int64  `json:"vcpus"`
	Sockets      int64  `json:"sockets"`
	Cpu          string `json:"cpu"`
	Numa         int    `json:"numa"`
	Hotplug      string `json:"hotplug"`
	Boot         string `json:"boot"`
	Bootdisk     string `json:"bootdisk"`
	Kvm          int    `json:"kvm"`
	Scsihw       string `json:"scsihw"`
	Hookscript   string `json:"hookscript"`
	Machine      string `json:"machine"`
	Ide2         string `json:"ide2,omitempty"`
	Ciuser       string `json:"ciuser"`
	Cipassword   string `json:"cipassword"`
	Cicustom     string `json:"cicustom"`
	Searchdomain string `json:"searchdomain"`
	Nameserver   string `json:"nameserver"`
	Sshkeys      string `json:"sshkeys"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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