proxmox

package
v0.0.0-...-6054725 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "proxmox"

ProviderName of the cloud platform provider

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageInfo

type ImageInfo struct {
	Volid string `json:"volid"`
	Size  int    `json:"size"`
}

ImageInfo contains information on the uploaded disk images.

type ImageResponse

type ImageResponse struct {
	Data []ImageInfo `json:"data"`
}

ImageResponse contains a list of Image info structs.

type InstanceInfo

type InstanceInfo struct {
	Name   string `json:"name"`
	VMID   int    `json:"vmid"`
	Status string `json:"status"`
}

InstanceInfo is a single response type of Instance.

type InstanceResponse

type InstanceResponse struct {
	Data []InstanceInfo `json:"data"`
}

InstanceResponse holds a list of instances info.

type NextIDResponse

type NextIDResponse struct {
	Data string `json:"data"`
}

NextIDResponse contains the next available id.

type Objects

type Objects struct{}

Objects provides ProxMoxr Object Storage related operations

func (*Objects) CopyToBucket

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

CopyToBucket copies archive to bucket

func (*Objects) DeleteFromBucket

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

DeleteFromBucket deletes key from config's bucket

type ProxMox

type ProxMox struct {
	Storage *Objects
	// contains filtered or unexported fields
}

ProxMox provides access to the ProxMox API.

func NewProvider

func NewProvider() *ProxMox

NewProvider ProxMox

func (*ProxMox) AttachVolume

func (p *ProxMox) AttachVolume(ctx *lepton.Context, image, name string, attachID int) error

AttachVolume is a stub to satisfy VolumeService interface

func (*ProxMox) BuildImage

func (p *ProxMox) BuildImage(ctx *lepton.Context) (string, error)

BuildImage to be upload on v

func (*ProxMox) BuildImageWithPackage

func (p *ProxMox) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on ProxMox.

func (*ProxMox) CheckBridge

func (p *ProxMox) CheckBridge(bridge string) error

CheckBridge return error when not found configured bridge any network interfaces via ProxMox API

func (*ProxMox) CheckInit

func (p *ProxMox) CheckInit() error

CheckInit return custom error on {"data": null} or {"data": []} result come from ProxMox API /api2/json/pools

func (*ProxMox) CheckResult

func (p *ProxMox) CheckResult(body []byte) error

CheckResult return error or custom error when {"data": null} or {"data": []} result come from ProxMox API (Not used yet)

func (*ProxMox) CheckResultType

func (p *ProxMox) CheckResultType(body []byte, rtype string, rname string) error

CheckResultType return error or custom error based on type of check, when {"data": null} or {"data": []} result come from ProxMox API

func (*ProxMox) CheckStorage

func (p *ProxMox) CheckStorage(storage string, stype string) error

CheckStorage return error when not found configured storage or any storages via ProxMox API

func (*ProxMox) CreateImage

func (p *ProxMox) CreateImage(ctx *lepton.Context, imagePath string) error

CreateImage - Creates image on v using nanos images

func (*ProxMox) CreateInstance

func (p *ProxMox) CreateInstance(ctx *lepton.Context) error

CreateInstance - Creates instance on Proxmox.

func (*ProxMox) CreateVolume

func (p *ProxMox) CreateVolume(ctx *lepton.Context, name, data, provider string) (lepton.NanosVolume, error)

CreateVolume is a stub to satisfy VolumeService interface

func (*ProxMox) CustomizeImage

func (p *ProxMox) CustomizeImage(ctx *lepton.Context) (string, error)

CustomizeImage returns image path with adaptations needed by cloud provider

func (*ProxMox) DeleteImage

func (p *ProxMox) DeleteImage(ctx *lepton.Context, snapshotID string) error

DeleteImage deletes image from v

func (*ProxMox) DeleteInstance

func (p *ProxMox) DeleteInstance(ctx *lepton.Context, instanceID string) error

DeleteInstance deletes instance from Proxmox.

func (*ProxMox) DeleteVolume

func (p *ProxMox) DeleteVolume(ctx *lepton.Context, name string) error

DeleteVolume is a stub to satisfy VolumeService interface

func (*ProxMox) DetachVolume

func (p *ProxMox) DetachVolume(ctx *lepton.Context, image, name string) error

DetachVolume is a stub to satisfy VolumeService interface

func (*ProxMox) GetAllVolumes

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

GetAllVolumes is a stub to satisfy VolumeService interface

func (*ProxMox) GetImages

func (p *ProxMox) GetImages(ctx *lepton.Context) ([]lepton.CloudImage, error)

GetImages return all images on ProxMox

func (*ProxMox) GetInstanceByName

func (p *ProxMox) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)

GetInstanceByName returns instance with given name

func (*ProxMox) GetInstanceLogs

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

GetInstanceLogs gets instance related logs

func (*ProxMox) GetInstances

func (p *ProxMox) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)

GetInstances return all instances on ProxMox

func (*ProxMox) GetStorage

func (p *ProxMox) GetStorage() lepton.Storage

GetStorage returns storage interface for cloud provider

func (*ProxMox) Initialize

func (p *ProxMox) Initialize(config *types.ProviderConfig) error

Initialize provider

func (*ProxMox) ListImages

func (p *ProxMox) ListImages(ctx *lepton.Context) error

ListImages lists images on ProxMox

func (*ProxMox) ListInstances

func (p *ProxMox) ListInstances(ctx *lepton.Context) error

ListInstances lists instances on Proxmox.

func (*ProxMox) PrintInstanceLogs

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

PrintInstanceLogs writes instance logs to console

func (*ProxMox) RebootInstance

func (p *ProxMox) RebootInstance(ctx *lepton.Context, instanceName string) error

RebootInstance reboots the instance.

func (*ProxMox) ResizeImage

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

ResizeImage is not supported on ProxMox.

func (*ProxMox) StartInstance

func (p *ProxMox) StartInstance(ctx *lepton.Context, instanceID string) error

StartInstance starts an instance in Proxmox

func (*ProxMox) StopInstance

func (p *ProxMox) StopInstance(ctx *lepton.Context, instanceID string) error

StopInstance halts instance from Proxmox.

func (*ProxMox) SyncImage

func (p *ProxMox) SyncImage(config *types.Config, target lepton.Provider, image string) error

SyncImage syncs image from provider to another provider

Jump to

Keyboard shortcuts

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