proxmox

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the Proxmox REST API client

func New

func New(c Config, ctx context.Context) (*Client, error)

New initializes a new Proxmox client

func (*Client) Create

func (c *Client) Create(ctx context.Context, imageURL string, imageName string, loc string) error

Create imports a qcow2 image and creates a VM template in Proxmox

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, name string, loc string) error

Delete removes a template from Proxmox

func (*Client) Exists

func (c *Client) Exists(ctx context.Context, name string, loc string) (bool, error)

Exists checks if a template with the given name already exists in Proxmox

func (*Client) GetLocations

func (c *Client) GetLocations() map[string]interface{}

GetLocations returns all configured Proxmox locations

type Config

type Config struct {
	CredentialsFile string
	LocationsFile   string
}

Config holds the configuration for the Proxmox client

type Credentials

type Credentials struct {
	URL      string `yaml:"url"`      // e.g. "proxmox.example.com:8006"
	User     string `yaml:"user"`     // e.g. "root"
	Realm    string `yaml:"realm"`    // e.g. "pam" (defaults to "pam")
	TokenID  string `yaml:"tokenId"`  // e.g. "mytoken"
	Secret   string `yaml:"secret"`   // the API token secret
	Insecure bool   `yaml:"insecure"` // skip TLS verification
}

Credentials holds the authentication details for the Proxmox API

type Location

type Location struct {
	Node          string `yaml:"node"`          // Proxmox node name (e.g. "pve")
	StoragePool   string `yaml:"storagePool"`   // target storage for VM disk (e.g. "local-lvm")
	ImportStorage string `yaml:"importStorage"` // storage for downloaded images (defaults to "local")
	Bridge        string `yaml:"bridge"`        // network bridge (e.g. "vmbr0")
}

Location holds a single Proxmox location configuration

Jump to

Keyboard shortcuts

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