goproxmox

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package goproxmox implements a client for Proxmox resource lifecycle management.

Index

Constants

This section is empty.

Variables

This section is empty.

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) 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) 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) (uint64, error)

GetReservableMemoryBytes returns the memory that can be reserved by a new VM, in bytes.

func (*APIClient) GetTask

func (c *APIClient) GetTask(ctx context.Context, upID string) (*proxmox.Task, error)

GetTask returns a task associated with upID.

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) 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.

func (*APIClient) StartVM

func (c *APIClient) StartVM(ctx context.Context, vm *proxmox.VirtualMachine) (*proxmox.Task, error)

StartVM starts the VM.

func (*APIClient) TagVM

func (c *APIClient) TagVM(ctx context.Context, vm *proxmox.VirtualMachine, tag string) (*proxmox.Task, error)

TagVM tags the VM.

Jump to

Keyboard shortcuts

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