Documentation ¶
Index ¶
- Constants
- 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, filter string) (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) (vmList []*proxmox.VirtualMachine, err error)
- func InstantiateClient(pveUrl string, credentials proxmox.Credentials) proxmox.Client
- func RequestState(ctx context.Context, params StateRequestParams) (*proxmox.Task, error)
- type RequestableState
- 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 ApiUrlSuffix = "/api2/json"
Variables ¶
This section is empty.
Functions ¶
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 GetVirtualMachineByVMID ¶
func GetVirtualMachineList ¶
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.
Types ¶
type RequestableState ¶
type RequestableState string
type StateRequestParams ¶
type StateRequestParams struct { RequestedState RequestableState Vm *proxmox.VirtualMachine }
Click to show internal directories.
Click to hide internal directories.