Documentation ¶
Index ¶
- Constants
- type ImageInfo
- type ImageResponse
- type InstanceInfo
- type InstanceResponse
- type NextIDResponse
- type Objects
- type ProxMox
- func (p *ProxMox) AttachVolume(ctx *lepton.Context, image, name string, attachID int) error
- func (p *ProxMox) BuildImage(ctx *lepton.Context) (string, error)
- func (p *ProxMox) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)
- func (p *ProxMox) CheckBridge(bridge string) error
- func (p *ProxMox) CheckInit() error
- func (p *ProxMox) CheckResult(body []byte) error
- func (p *ProxMox) CheckResultType(body []byte, rtype string, rname string) error
- func (p *ProxMox) CheckStorage(storage string, stype string) error
- func (p *ProxMox) CreateImage(ctx *lepton.Context, imagePath string) error
- func (p *ProxMox) CreateInstance(ctx *lepton.Context) error
- func (p *ProxMox) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
- func (p *ProxMox) CustomizeImage(ctx *lepton.Context) (string, error)
- func (p *ProxMox) DeleteImage(ctx *lepton.Context, snapshotID string) error
- func (p *ProxMox) DeleteInstance(ctx *lepton.Context, instanceID string) error
- func (p *ProxMox) DeleteVolume(ctx *lepton.Context, name string) error
- func (p *ProxMox) DetachVolume(ctx *lepton.Context, image, name string) error
- func (p *ProxMox) GetAllVolumes(ctx *lepton.Context) (*[]lepton.NanosVolume, error)
- func (p *ProxMox) GetImages(ctx *lepton.Context, filter string) ([]lepton.CloudImage, error)
- func (p *ProxMox) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)
- func (p *ProxMox) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)
- func (p *ProxMox) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)
- func (p *ProxMox) GetStorage() lepton.Storage
- func (p *ProxMox) Initialize(config *types.ProviderConfig) error
- func (p *ProxMox) InstanceStats(ctx *lepton.Context, instancename string, watch bool) error
- func (p *ProxMox) ListImages(ctx *lepton.Context, filter string) error
- func (p *ProxMox) ListInstances(ctx *lepton.Context) error
- func (p *ProxMox) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error
- func (p *ProxMox) RebootInstance(ctx *lepton.Context, instanceName string) error
- func (p *ProxMox) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error
- func (p *ProxMox) StartInstance(ctx *lepton.Context, instanceID string) error
- func (p *ProxMox) StopInstance(ctx *lepton.Context, instanceID string) error
- func (p *ProxMox) SyncImage(config *types.Config, target lepton.Provider, image string) error
Constants ¶
const ProviderName = "proxmox"
ProviderName of the cloud platform provider
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
CopyToBucket copies archive to bucket
type ProxMox ¶
type ProxMox struct { Storage *Objects // contains filtered or unexported fields }
ProxMox provides access to the ProxMox API.
func (*ProxMox) AttachVolume ¶
AttachVolume is a stub to satisfy VolumeService interface
func (*ProxMox) BuildImage ¶
BuildImage to be upload on v
func (*ProxMox) BuildImageWithPackage ¶
BuildImageWithPackage to upload on ProxMox.
func (*ProxMox) CheckBridge ¶
CheckBridge return error when not found configured bridge any network interfaces via ProxMox API
func (*ProxMox) CheckInit ¶
CheckInit return custom error on {"data": null} or {"data": []} result come from ProxMox API /api2/json/pools
func (*ProxMox) CheckResult ¶
CheckResult return error or custom error when {"data": null} or {"data": []} result come from ProxMox API (Not used yet)
func (*ProxMox) CheckResultType ¶
CheckResultType return error or custom error based on type of check, when {"data": null} or {"data": []} result come from ProxMox API
func (*ProxMox) CheckStorage ¶
CheckStorage return error when not found configured storage or any storages via ProxMox API
func (*ProxMox) CreateImage ¶
CreateImage - Creates image on v using nanos images
func (*ProxMox) CreateInstance ¶
CreateInstance - Creates instance on Proxmox.
func (*ProxMox) CreateVolume ¶
func (p *ProxMox) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
CreateVolume is a stub to satisfy VolumeService interface
func (*ProxMox) CustomizeImage ¶
CustomizeImage returns image path with adaptations needed by cloud provider
func (*ProxMox) DeleteImage ¶
DeleteImage deletes image from v
func (*ProxMox) DeleteInstance ¶
DeleteInstance deletes instance from Proxmox.
func (*ProxMox) DeleteVolume ¶
DeleteVolume is a stub to satisfy VolumeService interface
func (*ProxMox) DetachVolume ¶
DetachVolume is a stub to satisfy VolumeService interface
func (*ProxMox) GetAllVolumes ¶
GetAllVolumes is a stub to satisfy VolumeService interface
func (*ProxMox) GetInstanceByName ¶
func (p *ProxMox) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)
GetInstanceByName returns instance with given name
func (*ProxMox) GetInstanceLogs ¶
GetInstanceLogs gets instance related logs
func (*ProxMox) GetInstances ¶
GetInstances return all instances on ProxMox
func (*ProxMox) GetStorage ¶
GetStorage returns storage interface for cloud provider
func (*ProxMox) Initialize ¶
func (p *ProxMox) Initialize(config *types.ProviderConfig) error
Initialize provider
func (*ProxMox) InstanceStats ¶
InstanceStats show metrics for instances on proxmox
func (*ProxMox) ListImages ¶
ListImages lists images on ProxMox
func (*ProxMox) ListInstances ¶
ListInstances lists instances on Proxmox.
func (*ProxMox) PrintInstanceLogs ¶
PrintInstanceLogs writes instance logs to console
func (*ProxMox) RebootInstance ¶
RebootInstance reboots the instance.
func (*ProxMox) ResizeImage ¶
ResizeImage is not supported on ProxMox.
func (*ProxMox) StartInstance ¶
StartInstance starts an instance in Proxmox
func (*ProxMox) StopInstance ¶
StopInstance halts instance from Proxmox.