Documentation
¶
Index ¶
- Constants
- Variables
- func AddToList(list, newItem string) string
- func ArrayToCSV(array interface{}) (csv string)
- func ArrayToStringType(inputarray []interface{}) (array []string)
- func BoolInvert(b bool) bool
- func CSVtoArray(csv string) []string
- func DiskSizeGB(dcSize interface{}) float64
- func ErrorItemExists(item, text string) error
- func ErrorItemNotExists(item, text string) error
- func ErrorKeyEmpty(text string) error
- func ErrorKeyNotSet(text string) error
- func FormatDiskParam(disk QemuDevice) string
- func FormatUsbParam(usb QemuDevice) string
- func ItemInKeyOfArray(array []interface{}, key, value string) (existance bool)
- func Itob(i int) bool
- func MaxVmId(client *Client) (max int, err error)
- func ParamsToBody(params map[string]interface{}) (body []byte)
- func ParamsToBodyWithAllEmpty(params map[string]interface{}) (body []byte)
- func ParamsToBodyWithEmpty(params map[string]interface{}, allowedEmpty []string) (body []byte)
- func ParamsToValues(params map[string]interface{}) (vals url.Values)
- func ParamsToValuesWithAllEmpty(params map[string]interface{}, allowedEmpty []string, allowEmpty bool) (vals url.Values)
- func ParamsToValuesWithEmpty(params map[string]interface{}, allowedEmpty []string) (vals url.Values)
- func ParseSubConf(element string, separator string) (key string, value interface{})
- func PointerBool(boolean bool) *bool
- func PointerInt(number int) *int
- func PointerString(text string) *string
- func RemoveSshForwardUsernet(vmr *VmRef, client *Client) (err error)
- func ResponseJSON(resp *http.Response) (jbody map[string]interface{}, err error)
- func SendKeysString(vmr *VmRef, client *Client, keys string) (err error)
- func SshForwardUsernet(vmr *VmRef, client *Client) (sshPort string, err error)
- func TypedResponse(resp *http.Response, v interface{}) error
- func ValidateArrayNotEmpty(array interface{}, text string) error
- func ValidateFilePath(path, text string) error
- func ValidateIntGreater(min, value int, text string) error
- func ValidateIntGreaterOrEquals(min, value int, text string) error
- func ValidateIntInRange(min, max, value int, text string) error
- func ValidateStringInArray(array []string, value, text string) error
- func ValidateStringNotEmpty(value, text string) error
- func ValidateStringsEqual(value1, value2, text string) error
- func ValidateUserPassword(password string) error
- func WaitForShutdown(vmr *VmRef, client *Client) (err error)
- type AgentNetworkInterface
- type Client
- func (c *Client) AddQemuIPSet(vmr *VmRef, name string, params map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) CheckAcmePluginExistance(id string) (existance bool, err error)
- func (c *Client) CheckMetricServerExistance(id string) (existance bool, err error)
- func (c *Client) CheckStorageExistance(id string) (existance bool, err error)
- func (c *Client) CheckTask(resp *http.Response) (exitStatus string, err error)
- func (c *Client) CheckUserExistance(id string) (existance bool, err error)
- func (c *Client) CheckVmRef(vmr *VmRef) (err error)
- func (c *Client) CloneLxcContainer(vmr *VmRef, vmParams map[string]interface{}) (exitStatus string, err error)
- func (c *Client) CloneQemuVm(vmr *VmRef, vmParams map[string]interface{}) (exitStatus string, err error)
- func (c *Client) CreateAcmeAccount(params map[string]interface{}) (exitStatus string, err error)
- func (c *Client) CreateAcmePlugin(params map[string]interface{}) error
- func (c *Client) CreateItem(Params map[string]interface{}, url string) (err error)
- func (c *Client) CreateItemWithTask(Params map[string]interface{}, url string) (exitStatus string, err error)
- func (c *Client) CreateLxcContainer(node string, vmParams map[string]interface{}) (exitStatus string, err error)
- func (c *Client) CreateMetricServer(id string, params map[string]interface{}) error
- func (c *Client) CreatePool(poolid string, comment string) error
- func (c *Client) CreateQemuIPSet(vmr *VmRef, params map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) CreateQemuSnapshot(vmr *VmRef, snapshotName string) (exitStatus string, err error)
- func (c *Client) CreateQemuVm(node string, vmParams map[string]interface{}) (exitStatus string, err error)
- func (c *Client) CreateStorage(id string, params map[string]interface{}) error
- func (c *Client) CreateTemplate(vmr *VmRef) error
- func (c *Client) CreateUser(params map[string]interface{}) (err error)
- func (c *Client) CreateVMDisk(nodeName string, storageName string, fullDiskName string, ...) error
- func (c *Client) CreateVNCProxy(vmr *VmRef, params map[string]interface{}) (vncProxyRes map[string]interface{}, err error)
- func (c *Client) DeleteAcmeAccount(id string) (exitStatus string, err error)
- func (c *Client) DeleteAcmePlugin(id string) (err error)
- func (c *Client) DeleteMetricServer(id string) error
- func (c *Client) DeletePool(poolid string) error
- func (c *Client) DeleteQemuIPSet(vmr *VmRef, IPSetName string) (exitStatus interface{}, err error)
- func (c *Client) DeleteQemuIPSetNetwork(vmr *VmRef, IPSetName string, network string, params map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) DeleteQemuSnapshot(vmr *VmRef, snapshotName string) (exitStatus string, err error)
- func (c *Client) DeleteStorage(id string) error
- func (c *Client) DeleteUrl(url string) (err error)
- func (c *Client) DeleteUrlWithTask(url string) (exitStatus string, err error)
- func (c *Client) DeleteUser(id string) (err error)
- func (c *Client) DeleteVMDisks(node string, disks []string) error
- func (c *Client) DeleteVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) DeleteVmParams(vmr *VmRef, params map[string]interface{}) (exitStatus string, err error)
- func (c *Client) DeleteVolume(vmr *VmRef, storageName string, volumeName string) (exitStatus interface{}, err error)
- func (c *Client) EnableStorage(id string) error
- func (c *Client) GetAcmeAccountConfig(id string) (config map[string]interface{}, err error)
- func (c *Client) GetAcmeAccountList() (accounts map[string]interface{}, err error)
- func (c *Client) GetAcmeDirectoriesUrl() (url []string, err error)
- func (c *Client) GetAcmePluginConfig(id string) (config map[string]interface{}, err error)
- func (c *Client) GetAcmePluginList() (accounts map[string]interface{}, err error)
- func (c *Client) GetAcmeTosUrl() (url string, err error)
- func (c *Client) GetExecStatus(vmr *VmRef, pid string) (status map[string]interface{}, err error)
- func (c *Client) GetItemConfig(url, text string) (config map[string]interface{}, err error)
- func (c *Client) GetItemConfigInterfaceArray(url, text string) ([]interface{}, error)
- func (c *Client) GetItemConfigMapStringInterface(url, text string) (map[string]interface{}, error)
- func (c *Client) GetItemConfigString(url, text string) (string, error)
- func (c *Client) GetItemList(url string) (list map[string]interface{}, err error)
- func (c *Client) GetJsonRetryable(url string, data *map[string]interface{}, tries int) error
- func (c *Client) GetMetricServerConfig(id string) (config map[string]interface{}, err error)
- func (c *Client) GetMetricsServerList() (metricServers map[string]interface{}, err error)
- func (c *Client) GetNextID(currentID int) (nextID int, err error)
- func (c *Client) GetNodeList() (list map[string]interface{}, err error)
- func (c *Client) GetPoolInfo(poolid string) (poolInfo map[string]interface{}, err error)
- func (c *Client) GetPoolList() (pools map[string]interface{}, err error)
- func (c *Client) GetQemuFirewallOptions(vmr *VmRef) (firewallOptions map[string]interface{}, err error)
- func (c *Client) GetQemuIPSet(vmr *VmRef) (ipsets map[string]interface{}, err error)
- func (c *Client) GetResourceList(resourceType string) (list map[string]interface{}, err error)
- func (c *Client) GetStorageConfig(id string) (config map[string]interface{}, err error)
- func (c *Client) GetStorageContent(vmr *VmRef, storageName string) (data map[string]interface{}, err error)
- func (c *Client) GetStorageList() (metricServers map[string]interface{}, err error)
- func (c *Client) GetStorageStatus(vmr *VmRef, storageName string) (storageStatus map[string]interface{}, err error)
- func (c *Client) GetTaskExitstatus(taskUpid string) (exitStatus interface{}, err error)
- func (c *Client) GetUserConfig(id string) (config map[string]interface{}, err error)
- func (c *Client) GetUserList() (users map[string]interface{}, err error)
- func (c *Client) GetVersion() (data map[string]interface{}, err error)
- func (c *Client) GetVmAgentNetworkInterfaces(vmr *VmRef) ([]AgentNetworkInterface, error)
- func (c *Client) GetVmConfig(vmr *VmRef) (vmConfig map[string]interface{}, err error)
- func (c *Client) GetVmInfo(vmr *VmRef) (vmInfo map[string]interface{}, err error)
- func (c *Client) GetVmList() (list map[string]interface{}, err error)
- func (c *Client) GetVmRefByName(vmName string) (vmr *VmRef, err error)
- func (c *Client) GetVmRefsByName(vmName string) (vmrs []*VmRef, err error)
- func (c *Client) GetVmRrdData(vmr *VmRef, data map[string]interface{}) (rrdData map[string]interface{}, err error)
- func (c *Client) GetVmSpiceProxy(vmr *VmRef) (vmSpiceProxy map[string]interface{}, err error)
- func (c *Client) GetVmState(vmr *VmRef) (vmState map[string]interface{}, err error)
- func (c *Client) HandleTaskError(resp *http.Response) (exitStatus string, err error)
- func (c *Client) ListQemuSnapshot(vmr *VmRef) (taskResponse map[string]interface{}, exitStatus string, err error)
- func (c *Client) Login(username string, password string, otp string) (err error)
- func (c *Client) MigrateNode(vmr *VmRef, newTargetNode string, online bool) (exitStatus interface{}, err error)
- func (c *Client) MonitorCmd(vmr *VmRef, command string) (monitorRes map[string]interface{}, err error)
- func (c *Client) MoveLxcDisk(vmr *VmRef, disk string, storage string) (exitStatus interface{}, err error)
- func (c *Client) MoveQemuDisk(vmr *VmRef, disk string, storage string) (exitStatus interface{}, err error)
- func (c *Client) QemuAgentExec(vmr *VmRef, params map[string]interface{}) (result map[string]interface{}, err error)
- func (c *Client) QemuAgentFileWrite(vmr *VmRef, params map[string]interface{}) (err error)
- func (c *Client) QemuAgentPing(vmr *VmRef) (pingRes map[string]interface{}, err error)
- func (c *Client) QemuAgentSetUserPassword(vmr *VmRef, params map[string]interface{}) (result map[string]interface{}, err error)
- func (c *Client) ReadVMHA(vmr *VmRef) (err error)
- func (c *Client) ResetVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) ResizeQemuDisk(vmr *VmRef, disk string, moreSizeGB int) (exitStatus interface{}, err error)
- func (c *Client) ResizeQemuDiskRaw(vmr *VmRef, disk string, size string) (exitStatus interface{}, err error)
- func (c *Client) ResumeVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) RollbackQemuVm(vmr *VmRef, snapshot string) (exitStatus string, err error)
- func (c *Client) Sendkey(vmr *VmRef, qmKey string) error
- func (c *Client) SetAPIToken(userID, token string)
- func (c *Client) SetLxcConfig(vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) SetQemuFirewallOptions(vmr *VmRef, fwOptions map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) SetVmConfig(vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) ShutdownVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) StartVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) StatusChangeVm(vmr *VmRef, setStatus string) (exitStatus string, err error)
- func (c *Client) StopVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) SuspendVm(vmr *VmRef) (exitStatus string, err error)
- func (c *Client) UpdateAcmeAccountEmails(id, emails string) (exitStatus string, err error)
- func (c *Client) UpdateAcmePlugin(id string, params map[string]interface{}) error
- func (c *Client) UpdateItem(Params map[string]interface{}, url string) (err error)
- func (c *Client) UpdateItemWithTask(Params map[string]interface{}, url string) (exitStatus string, err error)
- func (c *Client) UpdateMetricServer(id string, params map[string]interface{}) error
- func (c *Client) UpdatePoolComment(poolid string, comment string) error
- func (c *Client) UpdateStorage(id string, params map[string]interface{}) error
- func (c *Client) UpdateUser(id string, params map[string]interface{}) error
- func (c *Client) UpdateUserPassword(userid string, password string) error
- func (c *Client) UpdateVMHA(vmr *VmRef, haState string, haGroup string) (exitStatus interface{}, err error)
- func (c *Client) UpdateVMPool(vmr *VmRef, pool string) (exitStatus interface{}, err error)
- func (c *Client) Upload(node string, storage string, contentType string, filename string, ...) error
- func (c *Client) VMIdExists(vmID int) (id int, err error)
- func (c *Client) VzDump(vmr *VmRef, params map[string]interface{}) (exitStatus interface{}, err error)
- func (c *Client) WaitForCompletion(taskResponse map[string]interface{}) (waitExitStatus string, err error)
- type ConfigAcmeAccount
- type ConfigAcmePlugin
- func (config ConfigAcmePlugin) CreateAcmePlugin(client *Client) (err error)
- func (config ConfigAcmePlugin) MapAcmePluginValues() (params map[string]interface{})
- func (config ConfigAcmePlugin) SetAcmePlugin(pluginid string, client *Client) (err error)
- func (config ConfigAcmePlugin) UpdateAcmePlugin(client *Client) (err error)
- type ConfigLxc
- type ConfigMetrics
- func (config *ConfigMetrics) CreateMetrics(client *Client) (err error)
- func (config *ConfigMetrics) MapMetricsToApiValues(create bool) (params map[string]interface{})
- func (config *ConfigMetrics) RemoveMetricsNestedStructs()
- func (config *ConfigMetrics) SetMetrics(metricsid string, client *Client) (err error)
- func (config *ConfigMetrics) UpdateMetrics(client *Client) (err error)
- func (config *ConfigMetrics) ValidateMetrics() (err error)
- type ConfigMetricsGraphite
- type ConfigMetricsInfluxDB
- type ConfigQemu
- func (config ConfigQemu) CloneVm(sourceVmr *VmRef, vmr *VmRef, client *Client) (err error)
- func (c ConfigQemu) CreateQemuDisksParams(vmID int, params map[string]interface{}, cloned bool) error
- func (c ConfigQemu) CreateQemuEfiParams(params map[string]interface{}) error
- func (c ConfigQemu) CreateQemuMachineParam(params map[string]interface{}) error
- func (c ConfigQemu) CreateQemuNetworksParams(vmID int, params map[string]interface{}) error
- func (c ConfigQemu) CreateQemuSerialsParams(vmID int, params map[string]interface{}) error
- func (c ConfigQemu) CreateQemuUsbsParams(vmID int, params map[string]interface{}) error
- func (config ConfigQemu) CreateVm(vmr *VmRef, client *Client) (err error)
- func (config ConfigQemu) HasCloudInit() bool
- func (c ConfigQemu) String() string
- func (config ConfigQemu) UpdateConfig(vmr *VmRef, client *Client) (err error)
- type ConfigStorage
- func (config *ConfigStorage) Create(id string, errorSupression bool, client *Client) (err error)
- func (config *ConfigStorage) CreateWithValidate(id string, client *Client) (err error)
- func (config *ConfigStorage) MapToApiValues(create bool) (params map[string]interface{})
- func (config *ConfigStorage) RemapFromAPI()
- func (config *ConfigStorage) RemapToAPI()
- func (config *ConfigStorage) Update(id string, client *Client) (err error)
- func (config *ConfigStorage) UpdateWithValidate(id string, client *Client) (err error)
- func (newConfig *ConfigStorage) Validate(id string, create bool, client *Client) (err error)
- type ConfigStorageBackupRetention
- type ConfigStorageCephFS
- type ConfigStorageContent
- type ConfigStorageDirectory
- type ConfigStorageGlusterFS
- type ConfigStorageISCSI
- type ConfigStorageLVM
- type ConfigStorageLVMThin
- type ConfigStorageNFS
- type ConfigStoragePBS
- type ConfigStorageRBD
- type ConfigStorageSMB
- type ConfigStorageZFS
- type ConfigStorageZFSoverISCSI
- type ConfigStorageZFSoverISCSI_Comstar
- type ConfigStorageZFSoverISCSI_LIO
- type ConfigStorageZFSoverISCSI_istgt
- type ConfigUser
- func (config ConfigUser) CreateUser(password string, client *Client) (err error)
- func (config ConfigUser) MapUserValues() (params map[string]interface{})
- func (config ConfigUser) SetUser(userid string, password string, client *Client) (err error)
- func (config ConfigUser) UpdateUser(client *Client) (err error)
- type QemuDevice
- type QemuDeviceParam
- type QemuDevices
- type Response
- type Session
- func (s *Session) Delete(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func (s *Session) Do(req *http.Request) (*http.Response, error)
- func (s *Session) Get(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func (s *Session) GetJSON(url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- func (s *Session) Head(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func (s *Session) Login(username string, password string, otp string) (err error)
- func (s *Session) NewRequest(method, url string, headers *http.Header, body io.Reader) (req *http.Request, err error)
- func (s *Session) Post(url string, params *url.Values, headers *http.Header, body *[]byte) (resp *http.Response, err error)
- func (s *Session) PostJSON(url string, params *url.Values, headers *http.Header, body interface{}, ...) (resp *http.Response, err error)
- func (s *Session) Put(url string, params *url.Values, headers *http.Header, body *[]byte) (resp *http.Response, err error)
- func (s *Session) Request(method string, url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- func (s *Session) RequestJSON(method string, url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- func (s *Session) SetAPIToken(userID, token string)
- type VmRef
- func (vmr *VmRef) GetVmType() string
- func (vmr *VmRef) HaGroup() string
- func (vmr *VmRef) HaState() string
- func (vmr *VmRef) Node() string
- func (vmr *VmRef) Pool() string
- func (vmr *VmRef) SetNode(node string)
- func (vmr *VmRef) SetPool(pool string)
- func (vmr *VmRef) SetVmType(vmType string)
- func (vmr *VmRef) VmId() int
Constants ¶
const TaskStatusCheckInterval = 2
TaskStatusCheckInterval - time between async checks in seconds
Variables ¶
var Debug = new(bool)
Functions ¶
func ArrayToCSV ¶
func ArrayToCSV(array interface{}) (csv string)
Convert Array to a comma (,) delimited list
func ArrayToStringType ¶
func ArrayToStringType(inputarray []interface{}) (array []string)
Convert Array of type []interface{} to array of type []string
func BoolInvert ¶
func CSVtoArray ¶
func DiskSizeGB ¶
func DiskSizeGB(dcSize interface{}) float64
Convert a disk-size string to a GB float
func ErrorItemExists ¶
func ErrorItemNotExists ¶
func ErrorKeyEmpty ¶
func ErrorKeyNotSet ¶
func FormatDiskParam ¶
func FormatDiskParam(disk QemuDevice) string
Given a QemuDevice (represesting a disk), return a param string to give to ProxMox
func FormatUsbParam ¶
func FormatUsbParam(usb QemuDevice) string
Given a QemuDevice (represesting a usb), return a param string to give to ProxMox
func ItemInKeyOfArray ¶
Check the value of a key in a nested array of map[string]interface{}
func ParamsToBody ¶
func ParamsToBodyWithEmpty ¶
func ParamsToValues ¶
func ParamsToValuesWithEmpty ¶
func ParseSubConf ¶
ParseSubConf - Parse standard sub-conf strings `key=value`.
func RemoveSshForwardUsernet ¶
device_del net1 netdev_del net1
func ResponseJSON ¶
func SshForwardUsernet ¶
This is because proxmox create/config API won't let us make usernet devices
func TypedResponse ¶
func ValidateArrayNotEmpty ¶
func ValidateFilePath ¶
func ValidateIntGreater ¶
func ValidateIntInRange ¶
func ValidateStringInArray ¶
func ValidateStringNotEmpty ¶
func ValidateStringsEqual ¶
func ValidateUserPassword ¶
func WaitForShutdown ¶
Useful waiting for ISO install to complete
Types ¶
type AgentNetworkInterface ¶
type AgentNetworkInterface struct { MACAddress string IPAddresses []net.IP Name string Statistics map[string]int64 }
func (*AgentNetworkInterface) UnmarshalJSON ¶
func (a *AgentNetworkInterface) UnmarshalJSON(b []byte) error
type Client ¶
type Client struct { ApiUrl string Username string Password string Otp string TaskTimeout int // contains filtered or unexported fields }
Client - URL, user and password to specifc Proxmox node
func (*Client) AddQemuIPSet ¶
func (c *Client) AddQemuIPSet(vmr *VmRef, name string, params map[string]interface{}) (exitStatus interface{}, err error)
AddQemuIPSet - Add IP or Network to IPSet.
func (*Client) CheckAcmePluginExistance ¶
func (*Client) CheckMetricServerExistance ¶
func (*Client) CheckStorageExistance ¶
func (*Client) CheckUserExistance ¶
func (*Client) CheckVmRef ¶
func (*Client) CloneLxcContainer ¶
func (*Client) CloneQemuVm ¶
func (*Client) CreateAcmeAccount ¶
func (*Client) CreateAcmePlugin ¶
func (*Client) CreateItem ¶
func (*Client) CreateItemWithTask ¶
func (c *Client) CreateItemWithTask(Params map[string]interface{}, url string) (exitStatus string, err error)
Create Item and wait on proxmox for the task to complete
func (*Client) CreateLxcContainer ¶
func (*Client) CreateMetricServer ¶
func (*Client) CreateQemuIPSet ¶
func (c *Client) CreateQemuIPSet(vmr *VmRef, params map[string]interface{}) (exitStatus interface{}, err error)
CreateQemuIPSet - Create new IPSet
func (*Client) CreateQemuSnapshot ¶
func (*Client) CreateQemuVm ¶
func (*Client) CreateStorage ¶
func (*Client) CreateTemplate ¶
func (*Client) CreateUser ¶
func (*Client) CreateVMDisk ¶
func (c *Client) CreateVMDisk( nodeName string, storageName string, fullDiskName string, diskParams map[string]interface{}, ) error
CreateVMDisk - Create single disk for VM on host node.
func (*Client) CreateVNCProxy ¶
func (*Client) DeleteAcmeAccount ¶
func (*Client) DeleteAcmePlugin ¶
func (*Client) DeleteMetricServer ¶
func (*Client) DeletePool ¶
func (*Client) DeleteQemuIPSet ¶
DeleteQemuIPSet - Delete IPSet
func (*Client) DeleteQemuIPSetNetwork ¶
func (c *Client) DeleteQemuIPSetNetwork(vmr *VmRef, IPSetName string, network string, params map[string]interface{}) (exitStatus interface{}, err error)
DeleteQemuIPSetNetwork - Remove IP or Network from IPSet.
func (*Client) DeleteQemuSnapshot ¶
func (*Client) DeleteStorage ¶
func (*Client) DeleteUrlWithTask ¶
Delete Item and wait on proxmox for the task to complete
func (*Client) DeleteUser ¶
func (*Client) DeleteVMDisks ¶
DeleteVMDisks - Delete VM disks from host node. By default the VM disks are deteled when the VM is deleted, so mainly this is used to delete the disks in case VM creation didn't complete.
func (*Client) DeleteVmParams ¶
func (*Client) DeleteVolume ¶
func (c *Client) DeleteVolume(vmr *VmRef, storageName string, volumeName string) (exitStatus interface{}, err error)
DeleteVolume - Delete volume
func (*Client) GetAcmeAccountConfig ¶
func (*Client) GetAcmeAccountList ¶
ACME Account
func (*Client) GetAcmeDirectoriesUrl ¶
ACME
func (*Client) GetAcmePluginConfig ¶
func (*Client) GetAcmePluginList ¶
ACME Plugin
func (*Client) GetAcmeTosUrl ¶
func (*Client) GetExecStatus ¶
GetExecStatus - Gets the status of the given pid started by the guest-agent
func (*Client) GetItemConfig ¶
func (*Client) GetItemConfigInterfaceArray ¶
func (*Client) GetItemConfigMapStringInterface ¶
Shared
func (*Client) GetItemConfigString ¶
func (*Client) GetItemList ¶
func (*Client) GetJsonRetryable ¶
func (*Client) GetMetricServerConfig ¶
Metrics
func (*Client) GetMetricsServerList ¶
func (*Client) GetNodeList ¶
func (*Client) GetPoolInfo ¶
func (*Client) GetPoolList ¶
func (*Client) GetQemuFirewallOptions ¶
func (c *Client) GetQemuFirewallOptions(vmr *VmRef) (firewallOptions map[string]interface{}, err error)
GetQemuFirewallOptions - Get VM firewall options.
func (*Client) GetQemuIPSet ¶
GetQemuIPSet - List IPSets
func (*Client) GetResourceList ¶
GetResourceList returns a list of all enabled proxmox resources. For resource types that can be in a disabled state, disabled resources will not be returned
func (*Client) GetStorageConfig ¶
func (*Client) GetStorageContent ¶
func (*Client) GetStorageList ¶
func (*Client) GetStorageStatus ¶
func (*Client) GetTaskExitstatus ¶
func (*Client) GetUserConfig ¶
User
func (*Client) GetUserList ¶
func (*Client) GetVersion ¶
func (*Client) GetVmAgentNetworkInterfaces ¶
func (c *Client) GetVmAgentNetworkInterfaces(vmr *VmRef) ([]AgentNetworkInterface, error)
func (*Client) GetVmConfig ¶
func (*Client) GetVmRefByName ¶
func (*Client) GetVmRefsByName ¶
func (*Client) GetVmRrdData ¶
func (*Client) GetVmSpiceProxy ¶
func (*Client) GetVmState ¶
func (*Client) HandleTaskError ¶
Close task responce
func (*Client) ListQemuSnapshot ¶
func (*Client) MigrateNode ¶
func (c *Client) MigrateNode(vmr *VmRef, newTargetNode string, online bool) (exitStatus interface{}, err error)
MigrateNode - Migrate a VM
func (*Client) MonitorCmd ¶
func (*Client) MoveLxcDisk ¶
func (*Client) MoveQemuDisk ¶
func (*Client) QemuAgentExec ¶
func (c *Client) QemuAgentExec(vmr *VmRef, params map[string]interface{}) (result map[string]interface{}, err error)
QemuAgentExec - Executes the given command in the vm via the guest-agent and returns an object with the pid.
func (*Client) QemuAgentFileWrite ¶
QemuAgentFileWrite - Writes the given file via guest agent.
func (*Client) QemuAgentPing ¶
QemuAgentPing - Execute ping.
func (*Client) QemuAgentSetUserPassword ¶
func (c *Client) QemuAgentSetUserPassword(vmr *VmRef, params map[string]interface{}) (result map[string]interface{}, err error)
QemuAgentSetUserPassword - Sets the password for the given user to the given password.
func (*Client) ResizeQemuDisk ¶
func (c *Client) ResizeQemuDisk(vmr *VmRef, disk string, moreSizeGB int) (exitStatus interface{}, err error)
ResizeQemuDisk allows the caller to increase the size of a disk by the indicated number of gigabytes
func (*Client) ResizeQemuDiskRaw ¶
func (c *Client) ResizeQemuDiskRaw(vmr *VmRef, disk string, size string) (exitStatus interface{}, err error)
ResizeQemuDiskRaw allows the caller to provide the raw resize string to be send to proxmox. See the proxmox API documentation for full information, but the short version is if you prefix your desired size with a '+' character it will ADD size to the disk. If you just specify the size by itself it will do an absolute resizing to the specified size. Permitted suffixes are K, M, G, T to indicate order of magnitude (kilobyte, megabyte, etc). Decrease of disk size is not permitted.
func (*Client) RollbackQemuVm ¶
func (*Client) SetAPIToken ¶
SetAPIToken specifies a pair of user identifier and token UUID to use for authenticating API calls. If this is set, a ticket from calling `Login` will not be used.
- `userID` is expected to be in the form `USER@REALM!TOKENID` - `token` is just the UUID you get when initially creating the token
See https://pve.proxmox.com/wiki/User_Management#pveum_tokens
func (*Client) SetLxcConfig ¶
func (c *Client) SetLxcConfig(vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error)
SetLxcConfig - send config options
func (*Client) SetQemuFirewallOptions ¶
func (c *Client) SetQemuFirewallOptions(vmr *VmRef, fwOptions map[string]interface{}) (exitStatus interface{}, err error)
SetQemuFirewallOptions - Set Firewall options.
func (*Client) SetVmConfig ¶
func (c *Client) SetVmConfig(vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error)
SetVmConfig - send config options
func (*Client) StatusChangeVm ¶
func (*Client) UpdateAcmeAccountEmails ¶
func (*Client) UpdateAcmePlugin ¶
func (*Client) UpdateItem ¶
func (*Client) UpdateItemWithTask ¶
func (c *Client) UpdateItemWithTask(Params map[string]interface{}, url string) (exitStatus string, err error)
Update Item and wait on proxmox for the task to complete
func (*Client) UpdateMetricServer ¶
func (*Client) UpdatePoolComment ¶
func (*Client) UpdateStorage ¶
func (*Client) UpdateUser ¶
func (*Client) UpdateUserPassword ¶
func (*Client) UpdateVMHA ¶
func (*Client) UpdateVMPool ¶
func (*Client) VMIdExists ¶
VMIdExists - If you pass an VMID that exists it will raise an error otherwise it will return the vmID
type ConfigAcmeAccount ¶
type ConfigAcmeAccount struct { Name string `json:"name"` Contact []string `json:"contact"` Directory string `json:"directory"` Tos bool `json:"tos,omitempty"` }
Acme Account options for the Proxmox API
func NewConfigAcmeAccountFromApi ¶
func NewConfigAcmeAccountFromApi(id string, client *Client) (config *ConfigAcmeAccount, err error)
func NewConfigAcmeAccountFromJson ¶
func NewConfigAcmeAccountFromJson(input []byte) (config *ConfigAcmeAccount, err error)
func (ConfigAcmeAccount) CreateAcmeAccount ¶
func (config ConfigAcmeAccount) CreateAcmeAccount(acmeid string, client *Client) (err error)
type ConfigAcmePlugin ¶
type ConfigAcmePlugin struct { ID string `json:"pluginid"` API string `json:"api"` Data string `json:"data,omitempty"` Enable bool `json:"enable"` Nodes []string `json:"nodes,omitempty"` ValidationDelay int `json:"validation-delay"` }
Acme Plugin options for the Proxmox API
func NewConfigAcmePluginFromApi ¶
func NewConfigAcmePluginFromApi(id string, client *Client) (config *ConfigAcmePlugin, err error)
func NewConfigAcmePluginFromJson ¶
func NewConfigAcmePluginFromJson(input []byte) (config *ConfigAcmePlugin, err error)
func (ConfigAcmePlugin) CreateAcmePlugin ¶
func (config ConfigAcmePlugin) CreateAcmePlugin(client *Client) (err error)
func (ConfigAcmePlugin) MapAcmePluginValues ¶
func (config ConfigAcmePlugin) MapAcmePluginValues() (params map[string]interface{})
func (ConfigAcmePlugin) SetAcmePlugin ¶
func (config ConfigAcmePlugin) SetAcmePlugin(pluginid string, client *Client) (err error)
func (ConfigAcmePlugin) UpdateAcmePlugin ¶
func (config ConfigAcmePlugin) UpdateAcmePlugin(client *Client) (err error)
type ConfigLxc ¶
type ConfigLxc struct { Ostemplate string `json:"ostemplate"` Arch string `json:"arch"` BWLimit int `json:"bwlimit,omitempty"` Clone string `json:"clone,omitempty"` CloneStorage string `json:"clone-storage,omitempty"` CMode string `json:"cmode"` Console bool `json:"console"` Cores int `json:"cores,omitempty"` CPULimit int `json:"cpulimit"` CPUUnits int `json:"cpuunits"` Description string `json:"description,omitempty"` Features QemuDevice `json:"features,omitempty"` Force bool `json:"force,omitempty"` Full bool `json:"full,omitempty"` HaState string `json:"hastate,omitempty"` HaGroup string `json:"hagroup,omitempty"` Hookscript string `json:"hookscript,omitempty"` Hostname string `json:"hostname,omitempty"` IgnoreUnpackErrors bool `json:"ignore-unpack-errors,omitempty"` Lock string `json:"lock,omitempty"` Memory int `json:"memory"` Mountpoints QemuDevices `json:"mountpoints,omitempty"` Nameserver string `json:"nameserver,omitempty"` Networks QemuDevices `json:"networks,omitempty"` OnBoot bool `json:"onboot"` OsType string `json:"ostype,omitempty"` Password string `json:"password,omitempty"` Pool string `json:"pool,omitempty"` Protection bool `json:"protection"` Restore bool `json:"restore,omitempty"` RootFs QemuDevice `json:"rootfs,omitempty"` SearchDomain string `json:"searchdomain,omitempty"` Snapname string `json:"snapname,omitempty"` SSHPublicKeys string `json:"ssh-public-keys,omitempty"` Start bool `json:"start"` Startup string `json:"startup,omitempty"` Storage string `json:"storage"` Swap int `json:"swap"` Template bool `json:"template,omitempty"` Tty int `json:"tty"` Unique bool `json:"unique,omitempty"` Unprivileged bool `json:"unprivileged"` Tags string `json:"tags"` Unused []string `json:"unused,omitempty"` }
LXC options for the Proxmox API
func NewConfigLxc ¶
func NewConfigLxc() ConfigLxc
func NewConfigLxcFromApi ¶
func NewConfigLxcFromJson ¶
type ConfigMetrics ¶
type ConfigMetrics struct { Name string `json:"name"` Port int `json:"port"` Server string `json:"server"` Type string `json:"type"` //type key is only used on create Enable bool `json:"enable"` MTU int `json:"mtu"` Timeout int `json:"timeout,omitempty"` Graphite *ConfigMetricsGraphite `json:"graphite,omitempty"` InfluxDB *ConfigMetricsInfluxDB `json:"influxdb,omitempty"` }
Metrics options for the Proxmox API
func InstantiateConfigMetrics ¶
func InstantiateConfigMetrics() *ConfigMetrics
func NewConfigMetricsFromApi ¶
func NewConfigMetricsFromApi(metricsid string, client *Client) (config *ConfigMetrics, err error)
func NewConfigMetricsFromJson ¶
func NewConfigMetricsFromJson(input []byte) (config *ConfigMetrics, err error)
func (*ConfigMetrics) CreateMetrics ¶
func (config *ConfigMetrics) CreateMetrics(client *Client) (err error)
func (*ConfigMetrics) MapMetricsToApiValues ¶
func (config *ConfigMetrics) MapMetricsToApiValues(create bool) (params map[string]interface{})
func (*ConfigMetrics) RemoveMetricsNestedStructs ¶
func (config *ConfigMetrics) RemoveMetricsNestedStructs()
func (*ConfigMetrics) SetMetrics ¶
func (config *ConfigMetrics) SetMetrics(metricsid string, client *Client) (err error)
func (*ConfigMetrics) UpdateMetrics ¶
func (config *ConfigMetrics) UpdateMetrics(client *Client) (err error)
func (*ConfigMetrics) ValidateMetrics ¶
func (config *ConfigMetrics) ValidateMetrics() (err error)
type ConfigMetricsGraphite ¶
type ConfigMetricsInfluxDB ¶
type ConfigMetricsInfluxDB struct { ApiPathPrefix string `json:"api-path-prefix,omitempty"` Bucket string `json:"bucket,omitempty"` Protocol string `json:"protocol"` MaxBodySize int `json:"max-body-size,omitempty"` Organization string `json:"organization,omitempty"` Token string `json:"token,omitempty"` //token key is never returned from api VerifyCertificate bool `json:"verify-certificate"` }
type ConfigQemu ¶
type ConfigQemu struct { 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:"os"` 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 QemuDevices `json:"disk"` QemuUnusedDisks QemuDevices `json:"unused_disk"` QemuVga QemuDevice `json:"vga,omitempty"` QemuNetworks QemuDevices `json:"network"` QemuSerials QemuDevices `json:"serial,omitempty"` QemuUsbs QemuDevices `json:"usb,omitempty"` HaState string `json:"hastate,omitempty"` HaGroup string `json:"hagroup,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"` QemuBrige 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"` // arrays are hard, support 16 interfaces for now Ipconfig0 string `json:"ipconfig0"` Ipconfig1 string `json:"ipconfig1"` Ipconfig2 string `json:"ipconfig2"` Ipconfig3 string `json:"ipconfig3"` Ipconfig4 string `json:"ipconfig4"` Ipconfig5 string `json:"ipconfig5"` Ipconfig6 string `json:"ipconfig6"` Ipconfig7 string `json:"ipconfig7"` Ipconfig8 string `json:"ipconfig8"` Ipconfig9 string `json:"ipconfig9"` Ipconfig10 string `json:"ipconfig10"` Ipconfig11 string `json:"ipconfig11"` Ipconfig12 string `json:"ipconfig12"` Ipconfig13 string `json:"ipconfig13"` Ipconfig14 string `json:"ipconfig14"` Ipconfig15 string `json:"ipconfig15"` }
ConfigQemu - Proxmox API QEMU options
func NewConfigQemuFromApi ¶
func NewConfigQemuFromApi(vmr *VmRef, client *Client) (config *ConfigQemu, err error)
func NewConfigQemuFromJson ¶
func NewConfigQemuFromJson(input []byte) (config *ConfigQemu, err error)
func (ConfigQemu) CloneVm ¶
func (config ConfigQemu) CloneVm(sourceVmr *VmRef, vmr *VmRef, client *Client) (err error)
CloneVm Example: Request
nodes/proxmox1-xx/qemu/1012/clone
newid:145 name:tf-clone1 target:proxmox1-xx full:1 storage:xxx
func (ConfigQemu) CreateQemuDisksParams ¶
func (c ConfigQemu) CreateQemuDisksParams( vmID int, params map[string]interface{}, cloned bool, ) error
Create parameters for each disk.
func (ConfigQemu) CreateQemuEfiParams ¶
func (c ConfigQemu) CreateQemuEfiParams( params map[string]interface{}, ) error
Create efi parameter.
func (ConfigQemu) CreateQemuMachineParam ¶
func (c ConfigQemu) CreateQemuMachineParam( params map[string]interface{}, ) error
Create parameters for serial interface
func (ConfigQemu) CreateQemuNetworksParams ¶
func (c ConfigQemu) CreateQemuNetworksParams(vmID int, params map[string]interface{}) error
Create parameters for each Nic device.
func (ConfigQemu) CreateQemuSerialsParams ¶
func (c ConfigQemu) CreateQemuSerialsParams( vmID int, params map[string]interface{}, ) error
Create parameters for serial interface
func (ConfigQemu) CreateQemuUsbsParams ¶
func (c ConfigQemu) CreateQemuUsbsParams( vmID int, params map[string]interface{}, ) error
Create parameters for usb interface
func (ConfigQemu) CreateVm ¶
func (config ConfigQemu) CreateVm(vmr *VmRef, client *Client) (err error)
CreateVm - Tell Proxmox API to make the VM
func (ConfigQemu) HasCloudInit ¶
func (config ConfigQemu) HasCloudInit() bool
HasCloudInit - are there cloud-init options?
func (ConfigQemu) String ¶
func (c ConfigQemu) String() string
func (ConfigQemu) UpdateConfig ¶
func (config ConfigQemu) UpdateConfig(vmr *VmRef, client *Client) (err error)
type ConfigStorage ¶
type ConfigStorage struct { ID string `json:"id"` Enable bool `json:"enable"` Nodes []string `json:"nodes,omitempty"` Type string `json:"type,omitempty"` Directory *ConfigStorageDirectory `json:"directory,omitempty"` LVM *ConfigStorageLVM `json:"lvm,omitempty"` LVMThin *ConfigStorageLVMThin `json:"lvm-thin,omitempty"` NFS *ConfigStorageNFS `json:"nfs,omitempty"` SMB *ConfigStorageSMB `json:"smb,omitempty"` GlusterFS *ConfigStorageGlusterFS `json:"glusterfs,omitempty"` ISCSI *ConfigStorageISCSI `json:"iscsi,omitempty"` CephFS *ConfigStorageCephFS `json:"cephfs,omitempty"` RBD *ConfigStorageRBD `json:"rbd,omitempty"` ZFSoverISCSI *ConfigStorageZFSoverISCSI `json:"zfs-over-iscsi,omitempty"` ZFS *ConfigStorageZFS `json:"zfs,omitempty"` PBS *ConfigStoragePBS `json:"pbs,omitempty"` Content *ConfigStorageContent `json:"content,omitempty"` BackupRetention *ConfigStorageBackupRetention `json:"backupretention,omitempty"` }
Storage options for the Proxmox API
func NewConfigStorageFromApi ¶
func NewConfigStorageFromApi(storageid string, client *Client) (config *ConfigStorage, err error)
func NewConfigStorageFromJson ¶
func NewConfigStorageFromJson(input []byte) (config *ConfigStorage, err error)
func (*ConfigStorage) Create ¶
func (config *ConfigStorage) Create(id string, errorSupression bool, client *Client) (err error)
func (*ConfigStorage) CreateWithValidate ¶
func (config *ConfigStorage) CreateWithValidate(id string, client *Client) (err error)
func (*ConfigStorage) MapToApiValues ¶
func (config *ConfigStorage) MapToApiValues(create bool) (params map[string]interface{})
func (*ConfigStorage) RemapFromAPI ¶
func (config *ConfigStorage) RemapFromAPI()
func (*ConfigStorage) RemapToAPI ¶
func (config *ConfigStorage) RemapToAPI()
func (*ConfigStorage) Update ¶
func (config *ConfigStorage) Update(id string, client *Client) (err error)
func (*ConfigStorage) UpdateWithValidate ¶
func (config *ConfigStorage) UpdateWithValidate(id string, client *Client) (err error)
type ConfigStorageBackupRetention ¶
type ConfigStorageBackupRetention struct { Last *int `json:"last,omitempty"` Hourly *int `json:"hourly,omitempty"` Daily *int `json:"daily,omitempty"` Monthly *int `json:"monthly,omitempty"` Weekly *int `json:"weekly,omitempty"` Yearly *int `json:"yearly,omitempty"` }
func (*ConfigStorageBackupRetention) AllNil ¶
func (b *ConfigStorageBackupRetention) AllNil() bool
func (*ConfigStorageBackupRetention) MapStorageBackupRetention ¶
func (b *ConfigStorageBackupRetention) MapStorageBackupRetention() string
func (*ConfigStorageBackupRetention) Validate ¶
func (b *ConfigStorageBackupRetention) Validate() (err error)
type ConfigStorageCephFS ¶
type ConfigStorageContent ¶
type ConfigStorageContent struct { Backup *bool `json:"backup,omitempty"` //backup Iso *bool `json:"iso,omitempty"` //iso Template *bool `json:"template,omitempty"` //vztmpl DiskImage *bool `json:"diskimage,omitempty"` //images Container *bool `json:"container,omitempty"` //rootdir Snippets *bool `json:"snippets,omitempty"` //snippets }
func (*ConfigStorageContent) MapStorageContent ¶
func (c *ConfigStorageContent) MapStorageContent(array []bool) (list string)
func (*ConfigStorageContent) Validate ¶
func (c *ConfigStorageContent) Validate(array []bool) error
type ConfigStorageDirectory ¶
type ConfigStorageDirectory struct { Path string `json:"Path"` Preallocation *string `json:"preallocation,omitempty"` }
Storage Types
func (*ConfigStorageDirectory) SetDefaults ¶
func (directory *ConfigStorageDirectory) SetDefaults()
type ConfigStorageGlusterFS ¶
type ConfigStorageGlusterFS struct { Server1 string `json:"server1"` Server2 string `json:"server2,omitempty"` Preallocation *string `json:"preallocation,omitempty"` Volume string `json:"volume"` }
func (*ConfigStorageGlusterFS) SetDefaults ¶
func (glusterfs *ConfigStorageGlusterFS) SetDefaults()
type ConfigStorageISCSI ¶
type ConfigStorageLVM ¶
type ConfigStorageLVM struct { VGname string `json:"vgname"` }
type ConfigStorageLVMThin ¶
type ConfigStorageNFS ¶
type ConfigStorageNFS struct { Server string `json:"server"` Export string `json:"export"` Preallocation *string `json:"preallocation,omitempty"` Version *string `json:"version,omitempty"` }
func (*ConfigStorageNFS) SetDefaults ¶
func (nfs *ConfigStorageNFS) SetDefaults()
type ConfigStoragePBS ¶
type ConfigStoragePBS struct { Server string `json:"server"` Datastore string `json:"datastore"` Username string `json:"username"` Password *string `json:"password,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Port *int `json:"port,omitempty"` }
func (*ConfigStoragePBS) SetDefaults ¶
func (pbs *ConfigStoragePBS) SetDefaults()
type ConfigStorageRBD ¶
type ConfigStorageSMB ¶
type ConfigStorageSMB struct { Username string `json:"username"` Preallocation *string `json:"preallocation,omitempty"` Domain string `json:"domain"` Server string `json:"server"` Password *string `json:"password,omitempty"` Version *string `json:"version,omitempty"` }
func (*ConfigStorageSMB) SetDefaults ¶
func (smb *ConfigStorageSMB) SetDefaults()
type ConfigStorageZFS ¶
type ConfigStorageZFS struct { Pool string `json:"pool"` Blocksize *string `json:"blocksize,omitempty"` Thinprovision bool `json:"thinprovision,omitempty"` }
func (*ConfigStorageZFS) SetDefaults ¶
func (zfs *ConfigStorageZFS) SetDefaults()
type ConfigStorageZFSoverISCSI ¶
type ConfigStorageZFSoverISCSI struct { Portal string `json:"portal"` Pool string `json:"pool"` Blocksize *string `json:"blocksize"` Target string `json:"target"` ISCSIprovider string `json:"iscsiprovider"` Thinprovision bool `json:"thinprovision"` Comstar *ConfigStorageZFSoverISCSI_Comstar `json:"comstar,omitempty"` Istgt *ConfigStorageZFSoverISCSI_istgt `json:"istgt,omitempty"` LIO *ConfigStorageZFSoverISCSI_LIO `json:"lio,omitempty"` }
func (*ConfigStorageZFSoverISCSI) RemapFromAPI ¶
func (zfsoveriscsi *ConfigStorageZFSoverISCSI) RemapFromAPI()
func (*ConfigStorageZFSoverISCSI) RemapToAPI ¶
func (zfsoveriscsi *ConfigStorageZFSoverISCSI) RemapToAPI()
func (*ConfigStorageZFSoverISCSI) SetDefaults ¶
func (zfsoveriscsi *ConfigStorageZFSoverISCSI) SetDefaults()
type ConfigStorageZFSoverISCSI_LIO ¶
type ConfigStorageZFSoverISCSI_LIO struct {
TargetPortalGroup string `json:"targetportal-group"`
}
type ConfigStorageZFSoverISCSI_istgt ¶
type ConfigStorageZFSoverISCSI_istgt struct {
Writecache bool `json:"writecache"`
}
type ConfigUser ¶
type ConfigUser struct { UserID string `json:"userid"` Comment string `json:"comment,omitempty"` Email string `json:"email,omitempty"` Enable bool `json:"enable"` Expire int `json:"expire"` Firstname string `json:"firstname,omitempty"` Groups []string `json:"groups,omitempty"` Keys string `json:"keys,omitempty"` Lastname string `json:"lastname,omitempty"` }
User options for the Proxmox API
func NewConfigUserFromApi ¶
func NewConfigUserFromApi(userid string, client *Client) (config *ConfigUser, err error)
func NewConfigUserFromJson ¶
func NewConfigUserFromJson(input []byte) (config *ConfigUser, err error)
func (ConfigUser) CreateUser ¶
func (config ConfigUser) CreateUser(password string, client *Client) (err error)
func (ConfigUser) MapUserValues ¶
func (config ConfigUser) MapUserValues() (params map[string]interface{})
func (ConfigUser) SetUser ¶
func (config ConfigUser) SetUser(userid string, password string, client *Client) (err error)
func (ConfigUser) UpdateUser ¶
func (config ConfigUser) UpdateUser(client *Client) (err 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 ParseLxcDisk ¶
func ParseLxcDisk(diskStr string) QemuDevice
func ParsePMConf ¶
func ParsePMConf( kvString string, implicitFirstKey string, ) QemuDevice
type QemuDeviceParam ¶
type QemuDeviceParam []string
type QemuDevices ¶
type Session ¶
type Session struct { ApiUrl string AuthTicket string CsrfToken string AuthToken string // Combination of user, realm, token ID and UUID Headers http.Header // contains filtered or unexported fields }
func NewSession ¶
func (*Session) NewRequest ¶
func (*Session) Request ¶
func (s *Session) Request( method string, url string, params *url.Values, headers *http.Header, body *[]byte, ) (resp *http.Response, err error)
Perform a simple get to an endpoint
func (*Session) RequestJSON ¶
func (s *Session) RequestJSON( method string, url string, params *url.Values, headers *http.Header, body interface{}, responseContainer interface{}, ) (resp *http.Response, err error)
Perform a simple get to an endpoint and unmarshall returned JSON
func (*Session) SetAPIToken ¶
type VmRef ¶
type VmRef struct {
// contains filtered or unexported fields
}
VmRef - virtual machine ref parts map[type:qemu node:proxmox1-xx id:qemu/132 diskread:5.57424738e+08 disk:0 netin:5.9297450593e+10 mem:3.3235968e+09 uptime:1.4567097e+07 vmid:132 template:0 maxcpu:2 netout:6.053310416e+09 maxdisk:3.4359738368e+10 maxmem:8.592031744e+09 diskwrite:1.49663619584e+12 status:running cpu:0.00386980694947209 name:appt-app1-dev.xxx.xx]