hetzner

package
v0.0.0-...-bb2d9ce Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "hetzner"

ProviderName of the cloud platform provider

Variables

This section is empty.

Functions

func GenerateSSHKeyPair

func GenerateSSHKeyPair() (string, string, error)

GenerateSSHKeyPair generates a new RSA key pair and returns the PEM-encoded private key and the OpenSSH-formatted public key as strings.

Types

type Hetzner

type Hetzner struct {
	Client  *hcloud.Client
	Storage *ObjectStorage
}

Hetzner Provider to interact with Hetzner cloud infrastructure

func NewProvider

func NewProvider() *Hetzner

NewProvider Hetzner

func (*Hetzner) AttachVolume

func (*Hetzner) AttachVolume(ctx *lepton.Context, instanceName, volumeName string, attachID int) error

AttachVolume is a stub because Hetzner volume attachment is not implemented.

func (*Hetzner) BuildImage

func (h *Hetzner) BuildImage(ctx *lepton.Context) (string, error)

BuildImage creates a Hetzner-compatible image from the active configuration.

func (*Hetzner) BuildImageWithPackage

func (h *Hetzner) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)

BuildImageWithPackage builds a Hetzner-compatible image that includes the provided package.

func (*Hetzner) CreateImage

func (h *Hetzner) CreateImage(ctx *lepton.Context, imagePath string) error

CreateImage uploads the image to object storage and registers a Hetzner snapshot.

func (*Hetzner) CreateInstance

func (h *Hetzner) CreateInstance(ctx *lepton.Context) error

CreateInstance launches a server in Hetzner Cloud using the configured snapshot.

func (*Hetzner) CreateVolume

func (*Hetzner) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)

CreateVolume is currently a stub for Hetzner volume creation.

func (*Hetzner) CustomizeImage

func (h *Hetzner) CustomizeImage(ctx *lepton.Context) (string, error)

CustomizeImage returns image path with adaptations needed by cloud provider

func (*Hetzner) DeleteImage

func (h *Hetzner) DeleteImage(ctx *lepton.Context, imagename string) error

DeleteImage removes the Hetzner snapshot and associated object storage artifact.

func (*Hetzner) DeleteInstance

func (h *Hetzner) DeleteInstance(ctx *lepton.Context, instancename string) error

DeleteInstance removes the specified Hetzner server.

func (*Hetzner) DeleteVolume

func (*Hetzner) DeleteVolume(ctx *lepton.Context, volumeName string) error

DeleteVolume is a stub; Hetzner volume deletion is not implemented.

func (*Hetzner) DetachVolume

func (*Hetzner) DetachVolume(ctx *lepton.Context, instanceName, volumeName string) error

DetachVolume is a stub because Hetzner volume detachment is not implemented.

func (*Hetzner) GetAllVolumes

func (*Hetzner) GetAllVolumes(ctx *lepton.Context) (*[]lepton.NanosVolume, error)

GetAllVolumes returns an empty list because Hetzner volumes are not supported yet.

func (*Hetzner) GetImages

func (h *Hetzner) GetImages(ctx *lepton.Context, filter string) ([]lepton.CloudImage, error)

GetImages retrieves all managed Hetzner snapshots optionally filtered by name.

func (*Hetzner) GetInstanceByName

func (h *Hetzner) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)

GetInstanceByName looks up a managed Hetzner instance by its name label.

func (*Hetzner) GetInstanceLogs

func (*Hetzner) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)

GetInstanceLogs returns an error because Hetzner log streaming is not implemented.

func (*Hetzner) GetInstances

func (h *Hetzner) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)

GetInstances retrieves all instances managed by Ops on Hetzner Cloud.

func (*Hetzner) GetStorage

func (h *Hetzner) GetStorage() lepton.Storage

GetStorage returns storage interface for cloud provider

func (*Hetzner) Initialize

func (h *Hetzner) Initialize(c *types.ProviderConfig) error

Initialize Hetzner client

func (*Hetzner) InstanceStats

func (h *Hetzner) InstanceStats(ctx *lepton.Context, instancename string, watch bool) error

InstanceStats returns an error because Hetzner metrics are not yet implemented.

func (*Hetzner) ListImages

func (h *Hetzner) ListImages(ctx *lepton.Context, filter string) error

ListImages prints managed Hetzner snapshots using table or JSON output.

func (*Hetzner) ListInstances

func (h *Hetzner) ListInstances(ctx *lepton.Context) error

ListInstances prints all managed Hetzner instances in table or JSON form.

func (*Hetzner) PrintInstanceLogs

func (*Hetzner) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error

PrintInstanceLogs returns an error because Hetzner log streaming is not implemented.

func (*Hetzner) RebootInstance

func (h *Hetzner) RebootInstance(ctx *lepton.Context, instancename string) error

RebootInstance restarts the target Hetzner server.

func (*Hetzner) ResizeImage

func (*Hetzner) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error

ResizeImage reports that resizing Hetzner snapshots is unsupported.

func (*Hetzner) StartInstance

func (h *Hetzner) StartInstance(ctx *lepton.Context, instancename string) error

StartInstance powers on the target Hetzner server.

func (*Hetzner) StopInstance

func (h *Hetzner) StopInstance(ctx *lepton.Context, instancename string) error

StopInstance powers off the target Hetzner server.

func (*Hetzner) SyncImage

func (*Hetzner) SyncImage(config *types.Config, target lepton.Provider, imagename string) error

SyncImage logs that Hetzner image synchronization is not implemented.

type ObjectStorage

type ObjectStorage struct{}

ObjectStorage provides Hetzner object storage related operations.

func (*ObjectStorage) CopyToBucket

func (s *ObjectStorage) CopyToBucket(config *types.Config, archPath string) error

CopyToBucket copies archive to bucket.

func (*ObjectStorage) DeleteFromBucket

func (s *ObjectStorage) DeleteFromBucket(config *types.Config, key string) error

DeleteFromBucket deletes key from config's bucket.

Jump to

Keyboard shortcuts

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