upcloud

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "upcloud"

ProviderName of the cloud platform provider

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider provides access to the UpCloud API.

func NewProvider

func NewProvider() *Provider

NewProvider UpCloud

func NewProviderWithService

func NewProviderWithService(service Service) *Provider

NewProviderWithService returns an instance of Upcloud provider and initializes upcloud service

func (*Provider) AttachVolume

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

AttachVolume attaches a storage to an upcloud server

func (*Provider) BuildImage

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

BuildImage creates local image

func (*Provider) BuildImageWithPackage

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

BuildImageWithPackage creates local image using package image

func (*Provider) CreateImage

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

CreateImage creates a storage object and upload image

func (*Provider) CreateInstance

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

CreateInstance uses a template to launch a server in upcloud

func (*Provider) CreateVolume

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

CreateVolume creates a local volume and uploads the volume to upcloud

func (*Provider) CustomizeImage

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

CustomizeImage is a stub

func (*Provider) DeleteImage

func (p *Provider) DeleteImage(ctx *lepton.Context, imagename string) (err error)

DeleteImage removes upcloud image

func (*Provider) DeleteInstance

func (p *Provider) DeleteInstance(ctx *lepton.Context, instancename string) (err error)

DeleteInstance removes server

func (*Provider) DeleteVolume

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

DeleteVolume deletes a volume from upcloud

func (*Provider) DetachVolume

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

DetachVolume detaches a storage from an upcloud server

func (*Provider) GetAllVolumes

func (p *Provider) GetAllVolumes(ctx *lepton.Context) (volumes *[]lepton.NanosVolume, err error)

GetAllVolumes returns every upcloud volume

func (*Provider) GetImages

func (p *Provider) GetImages(ctx *lepton.Context) (images []lepton.CloudImage, err error)

GetImages returns the list of images available

func (*Provider) GetInstanceByID

func (p *Provider) GetInstanceByID(ctx *lepton.Context, id string) (instance *lepton.CloudInstance, err error)

GetInstanceByID return a upcloud server details with ID specified

func (*Provider) GetInstanceByName

func (p *Provider) GetInstanceByName(ctx *lepton.Context, name string) (instance *lepton.CloudInstance, err error)

GetInstanceByName returns upcloud instance with given name

func (*Provider) GetInstanceLogs

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

GetInstanceLogs is a stub

func (*Provider) GetInstances

func (p *Provider) GetInstances(ctx *lepton.Context) (instances []lepton.CloudInstance, err error)

GetInstances returns the list of servers managed by upcloud

func (*Provider) Initialize

func (p *Provider) Initialize(c *types.ProviderConfig) error

Initialize checks conditions to use upcloud

func (*Provider) ListImages

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

ListImages prints upcloud images in table format

func (*Provider) ListInstances

func (p *Provider) ListInstances(ctx *lepton.Context) (err error)

ListInstances prints servers list managed by upcloud in table

func (*Provider) PrintInstanceLogs

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

PrintInstanceLogs prints server log on console

func (*Provider) RebootInstance

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

RebootInstance reboots the instance.

func (*Provider) ResizeImage

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

ResizeImage is a stub

func (*Provider) StartInstance

func (p *Provider) StartInstance(ctx *lepton.Context, instancename string) (err error)

StartInstance initiates server in upcloud

func (*Provider) StopInstance

func (p *Provider) StopInstance(ctx *lepton.Context, instancename string) (err error)

StopInstance stops server in upcloud

func (*Provider) SyncImage

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

SyncImage is a stub

type Service

type Service interface {
	service.Server
	service.Storage
	service.Tag
	service.Account
}

Service is the interface implemented by upcloud service

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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