openstack

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

Documentation

Index

Constants

View Source
const ProviderName = "openstack"

ProviderName of the cloud platform provider

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenStack

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

OpenStack Provider to interact with OpenStack infrastructure

func NewProvider

func NewProvider() *OpenStack

NewProvider OpenStack

func (*OpenStack) AttachVolume

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

AttachVolume is a stub to satisfy VolumeService interface

func (*OpenStack) BuildImage

func (o *OpenStack) BuildImage(ctx *lepton.Context) (string, error)

BuildImage to be upload on OpenStack

func (*OpenStack) BuildImageWithPackage

func (o *OpenStack) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on OpenStack.

func (*OpenStack) CreateImage

func (o *OpenStack) CreateImage(ctx *lepton.Context, imagePath string) error

CreateImage - Creates image on OpenStack using nanos images

func (*OpenStack) CreateInstance

func (o *OpenStack) CreateInstance(ctx *lepton.Context) error

CreateInstance - Creates instance on OpenStack.

func (*OpenStack) CreateVolume

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

CreateVolume is a stub to satisfy VolumeService interface

func (*OpenStack) CreateZoneRecord

func (o *OpenStack) CreateZoneRecord(config *types.Config, zoneID string, record *lepton.DNSRecord) error

CreateZoneRecord creates a record in a DNS zone

func (*OpenStack) CustomizeImage

func (o *OpenStack) CustomizeImage(ctx *lepton.Context) (string, error)

CustomizeImage returns image path with adaptations needed by cloud provider

func (*OpenStack) DeleteImage

func (o *OpenStack) DeleteImage(ctx *lepton.Context, imagename string) error

DeleteImage deletes image from OpenStack

func (*OpenStack) DeleteInstance

func (o *OpenStack) DeleteInstance(ctx *lepton.Context, instancename string) error

DeleteInstance deletes instance from OpenStack

func (*OpenStack) DeleteVolume

func (o *OpenStack) DeleteVolume(ctx *lepton.Context, name string) error

DeleteVolume is a stub to satisfy VolumeService interface

func (*OpenStack) DeleteZoneRecordIfExists

func (o *OpenStack) DeleteZoneRecordIfExists(config *types.Config, zoneID string, recordName string) error

DeleteZoneRecordIfExists deletes a record from a DNS zone if it exists

func (*OpenStack) DetachVolume

func (o *OpenStack) DetachVolume(ctx *lepton.Context, image, name string) error

DetachVolume is a stub to satisfy VolumeService interface

func (*OpenStack) FindOrCreateZoneIDByName

func (o *OpenStack) FindOrCreateZoneIDByName(config *types.Config, dnsName string) (string, error)

FindOrCreateZoneIDByName searches for a DNS zone with the name passed by argument and if it doesn't exist it creates one

func (*OpenStack) GetAllVolumes

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

GetAllVolumes is a stub to satisfy VolumeService interface

func (*OpenStack) GetImages

func (o *OpenStack) GetImages(ctx *lepton.Context) ([]lepton.CloudImage, error)

GetImages return all images for openstack

func (*OpenStack) GetInstanceByName

func (o *OpenStack) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)

GetInstanceByName returns instance with given name

func (*OpenStack) GetInstanceLogs

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

GetInstanceLogs gets instance related logs.

func (*OpenStack) GetInstances

func (o *OpenStack) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)

GetInstances return all instances on OpenStack

func (*OpenStack) Initialize

func (o *OpenStack) Initialize(config *types.ProviderConfig) error

Initialize OpenStack related things

func (*OpenStack) ListImages

func (o *OpenStack) ListImages(ctx *lepton.Context) error

ListImages lists images on a datastore.

func (*OpenStack) ListInstances

func (o *OpenStack) ListInstances(ctx *lepton.Context) error

ListInstances lists instances on OpenStack. It essentially does:

func (*OpenStack) PrintInstanceLogs

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

PrintInstanceLogs writes instance logs to console

func (*OpenStack) RebootInstance

func (o *OpenStack) RebootInstance(ctx *lepton.Context, instancename string) error

RebootInstance reboots the instance.

func (*OpenStack) ResizeImage

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

ResizeImage is not supported on OpenStack.

func (*OpenStack) StartInstance

func (o *OpenStack) StartInstance(ctx *lepton.Context, instancename string) error

StartInstance starts an instance in OpenStack.

func (*OpenStack) StopInstance

func (o *OpenStack) StopInstance(ctx *lepton.Context, instancename string) error

StopInstance stops an instance from OpenStack

func (*OpenStack) SyncImage

func (o *OpenStack) 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