Documentation ¶
Overview ¶
Package goproxmox implements a client for Proxmox resource lifecycle management.
Index ¶
- Variables
- type APIClient
- func (c *APIClient) CheckID(ctx context.Context, vmid int64) (bool, error)
- func (c *APIClient) CloneVM(ctx context.Context, templateID int, clone capmox.VMCloneRequest) (capmox.VMCloneResponse, error)
- func (c *APIClient) CloudInitStatus(ctx context.Context, vm *proxmox.VirtualMachine) (running bool, err error)
- func (c *APIClient) ConfigureVM(ctx context.Context, vm *proxmox.VirtualMachine, ...) (*proxmox.Task, error)
- func (c *APIClient) DeleteVM(ctx context.Context, nodeName string, vmID int64) (*proxmox.Task, error)
- func (c *APIClient) FindVMResource(ctx context.Context, vmID uint64) (*proxmox.ClusterResource, error)
- func (c *APIClient) GetReservableMemoryBytes(ctx context.Context, nodeName string, nodeMemoryAdjustment uint64) (uint64, error)
- func (c *APIClient) GetTask(ctx context.Context, upID string) (*proxmox.Task, error)
- func (c *APIClient) GetVM(ctx context.Context, nodeName string, vmID int64) (*proxmox.VirtualMachine, error)
- func (c *APIClient) QemuAgentStatus(ctx context.Context, vm *proxmox.VirtualMachine) error
- func (c *APIClient) ResizeDisk(ctx context.Context, vm *proxmox.VirtualMachine, disk, size string) error
- func (c *APIClient) ResumeVM(ctx context.Context, vm *proxmox.VirtualMachine) (*proxmox.Task, error)
- func (c *APIClient) StartVM(ctx context.Context, vm *proxmox.VirtualMachine) (*proxmox.Task, error)
- func (c *APIClient) TagVM(ctx context.Context, vm *proxmox.VirtualMachine, tag string) (*proxmox.Task, error)
- func (c *APIClient) UnmountCloudInitISO(ctx context.Context, vm *proxmox.VirtualMachine, device string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCloudInitFailed is returned when cloud-init failed execution. ErrCloudInitFailed = errors.New("cloud-init failed execution") )
var ErrVMIDFree = errors.New("VMID is free")
ErrVMIDFree is returned if the VMID is free.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { *proxmox.Client // contains filtered or unexported fields }
APIClient Proxmox API client object.
func NewAPIClient ¶
func NewAPIClient(ctx context.Context, logger logr.Logger, baseURL string, options ...proxmox.Option) (*APIClient, error)
NewAPIClient initializes a Proxmox API client. If the client is misconfigured, an error is returned.
func (*APIClient) CheckID ¶ added in v0.6.0
CheckID checks if the vmid is available on the cluster. Returns true if the vmid is available, false if it is taken.
func (*APIClient) CloneVM ¶
func (c *APIClient) CloneVM(ctx context.Context, templateID int, clone capmox.VMCloneRequest) (capmox.VMCloneResponse, error)
CloneVM clones a VM based on templateID and VMCloneRequest.
func (*APIClient) CloudInitStatus ¶ added in v0.4.0
func (c *APIClient) CloudInitStatus(ctx context.Context, vm *proxmox.VirtualMachine) (running bool, err error)
CloudInitStatus returns the cloud-init status of the VM.
func (*APIClient) ConfigureVM ¶
func (c *APIClient) ConfigureVM(ctx context.Context, vm *proxmox.VirtualMachine, options ...capmox.VirtualMachineOption) (*proxmox.Task, error)
ConfigureVM updates a VMs settings.
func (*APIClient) DeleteVM ¶
func (c *APIClient) DeleteVM(ctx context.Context, nodeName string, vmID int64) (*proxmox.Task, error)
DeleteVM deletes a VM based on the nodeName and vmID.
func (*APIClient) FindVMResource ¶
func (c *APIClient) FindVMResource(ctx context.Context, vmID uint64) (*proxmox.ClusterResource, error)
FindVMResource tries to find a VM by its ID on the whole cluster.
func (*APIClient) GetReservableMemoryBytes ¶
func (c *APIClient) GetReservableMemoryBytes(ctx context.Context, nodeName string, nodeMemoryAdjustment uint64) (uint64, error)
GetReservableMemoryBytes returns the memory that can be reserved by a new VM, in bytes.
func (*APIClient) GetVM ¶
func (c *APIClient) GetVM(ctx context.Context, nodeName string, vmID int64) (*proxmox.VirtualMachine, error)
GetVM returns a VM based on nodeName and vmID.
func (*APIClient) QemuAgentStatus ¶ added in v0.6.0
QemuAgentStatus returns the qemu-agent status of the VM.
func (*APIClient) ResizeDisk ¶
func (c *APIClient) ResizeDisk(ctx context.Context, vm *proxmox.VirtualMachine, disk, size string) error
ResizeDisk resizes a VM disk to the specified size.
func (*APIClient) ResumeVM ¶
func (c *APIClient) ResumeVM(ctx context.Context, vm *proxmox.VirtualMachine) (*proxmox.Task, error)
ResumeVM resumes the VM.