Documentation ¶
Index ¶
- Constants
- func CheckVmidRange(vmid uint64) error
- func DestroyVm(ctx context.Context, vm *proxmox.VirtualMachine) (proxmox.Task, error)
- func DestroyVmWithForce(ctx context.Context, vm *proxmox.VirtualMachine) (proxmox.Task, error)
- func GetPveUrl(c *cli.Context) string
- func GetResourceList(ctx context.Context, client proxmox.Client, opts ...GetResourceListOption) (rsList []*proxmox.ClusterResource, err error)
- func GetVirtualMachineByVMID(ctx context.Context, vmid uint64, client proxmox.Client) (vm *proxmox.VirtualMachine, err error)
- func GetVirtualMachineList(ctx context.Context, client proxmox.Client, furtherFilterList ...string) (vmList []proxmox.VirtualMachine, err error)
- func GetVmidArg(args []string) (uint64, error)
- func InstantiateClient(pveUrl string, credentials proxmox.Credentials) proxmox.Client
- func RequestState(ctx context.Context, params StateRequestParams) (*proxmox.Task, error)
- func VmidOutOfRangeError() error
- type GetResourceListOption
- func WithAll() GetResourceListOption
- func WithLxc() GetResourceListOption
- func WithNode() GetResourceListOption
- func WithPool() GetResourceListOption
- func WithQemu() GetResourceListOption
- func WithSdn() GetResourceListOption
- func WithStorage() GetResourceListOption
- func WithVm() GetResourceListOption
- type RequestableState
- type ResourceList
- type StateRequestParams
Constants ¶
View Source
const ( VmFilter = "vm" StorageFilter = "storage" NodeFilter = "node" SdnFilter = "sdn" )
View Source
const ( NodeResource = "node" StorageResource = "storage" PoolResource = "pool" QemuResource = "qemu" LxcResource = "lxc" OpenVzResource = "openvz" // deprecated SdnResource = "sdn" )
View Source
const ( RunningState = RequestableState(proxmox.StatusVirtualMachineRunning) StoppedState = RequestableState(proxmox.StatusVirtualMachineStopped) PausedState = RequestableState(proxmox.StatusVirtualMachinePaused) )
View Source
const ( MaxVmid = 999999999 MinVmid = 100 )
View Source
const ApiUrlSuffix = "/api2/json"
Variables ¶
This section is empty.
Functions ¶
func CheckVmidRange ¶
func DestroyVmWithForce ¶
func GetPveUrl ¶
func GetPveUrl(c *cli.Context) string
GetPveUrl returns either the URL as specified by the `pveurl` arg, or builds a URL from the `scheme`, `pvehost`, and `pveport` args.
func GetResourceList ¶
func GetResourceList( ctx context.Context, client proxmox.Client, opts ...GetResourceListOption, ) ( rsList []*proxmox.ClusterResource, err error, )
func GetVirtualMachineByVMID ¶
func GetVirtualMachineList ¶
func GetVmidArg ¶
func InstantiateClient ¶
func InstantiateClient(pveUrl string, credentials proxmox.Credentials) proxmox.Client
func RequestState ¶
func RequestState(ctx context.Context, params StateRequestParams) (*proxmox.Task, error)
RequestState requests Proxmox change the state of a virtual machine.
func VmidOutOfRangeError ¶
func VmidOutOfRangeError() error
Types ¶
type GetResourceListOption ¶
type GetResourceListOption func(c *getResourceListConfig)
GetResourceListOption specifies the type of Resources for GetResource to get.
func WithAll ¶
func WithAll() GetResourceListOption
WithAll makes GetResourceList return VMs, Storage, Nodes, and SDNs.
func WithLxc ¶
func WithLxc() GetResourceListOption
WithLxc further filters GetResourceList for Qemu VMs.
func WithPool ¶
func WithPool() GetResourceListOption
WithPool further filters GetResourceList for Pools.
func WithQemu ¶
func WithQemu() GetResourceListOption
WithQemu further filters GetResourceList for Qemu VMs.
func WithStorage ¶
func WithStorage() GetResourceListOption
WithStorage makes GetResourceList return Storages.
type RequestableState ¶
type RequestableState string
type ResourceList ¶
type ResourceList struct { NodeResources []*proxmox.Node StorageResources []*proxmox.Storage PoolResources []*proxmox.Pool QemuResources []*proxmox.VirtualMachine LxcResources []*proxmox.Container OpenVzResources []*proxmox.Container }
type StateRequestParams ¶
type StateRequestParams struct { RequestedState RequestableState Vm *proxmox.VirtualMachine }
Click to show internal directories.
Click to hide internal directories.