util

package
v0.0.0-...-20d0dac Latest Latest
Warning

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

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

Documentation

Index

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 DestroyVm

func DestroyVm(ctx context.Context, vm *proxmox.VirtualMachine) (proxmox.Task, error)

func DestroyVmWithForce

func DestroyVmWithForce(ctx context.Context, vm *proxmox.VirtualMachine) (proxmox.Task, error)

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, filter string) (
	rsList []*proxmox.ClusterResource,
	err error,
)

func GetVirtualMachineByVMID

func GetVirtualMachineByVMID(ctx context.Context, vmid uint64, client proxmox.Client) (
	vm *proxmox.VirtualMachine,
	err error,
)

func GetVirtualMachineList

func GetVirtualMachineList(ctx context.Context, client proxmox.Client) (vmList []*proxmox.VirtualMachine, err error)

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
}

Jump to

Keyboard shortcuts

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