linode

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

Documentation

Index

Constants

View Source
const ProviderName = "linode"

ProviderName of the cloud platform provider

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskStatus

type DiskStatus struct {
	ID     int    `json:"id"`
	Status string `json:"status"`
}

DiskStatus holds the status for a linode disk status.

type Image

type Image struct {
	CreatedBy string `json:"created_by"`
	ID        string `json:"id"`
	IsPublic  bool   `json:"is_public"`
	Label     string `json:"label"`
	Status    string `json:"status"`
}

Image represents a given linode image configuration.

type ImageListResponse

type ImageListResponse struct {
	Data []Image `json:"data"`
}

ImageListResponse is the set of instances available from linode in an images list call.

type Instance

type Instance struct {
	Created string   `json:"created"`
	ID      int      `json:"id"`
	Image   string   `json:"image"`
	IPv4    []string `json:"ipv4"`
	Region  string   `json:"region"`
	Status  string   `json:"status"`
}

Instance is the Linode configuration for a given instance.

type InstanceListResponse

type InstanceListResponse struct {
	Data []Instance `json:"data"`
}

InstanceListResponse is the set of instances available from linode.

type Linode

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

Linode Provider to interact with Linode infrastructure

func NewProvider

func NewProvider() *Linode

NewProvider Linode

func (*Linode) AttachVolume

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

AttachVolume is a stub to satisfy VolumeService interface

func (*Linode) BuildImage

func (v *Linode) BuildImage(ctx *lepton.Context) (string, error)

BuildImage to be upload on linode

func (*Linode) BuildImageWithPackage

func (v *Linode) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)

BuildImageWithPackage to upload on Linode.

func (*Linode) CreateImage

func (v *Linode) CreateImage(ctx *lepton.Context, imagePath string) error

CreateImage - Creates image on linode using nanos images

func (*Linode) CreateInstance

func (v *Linode) CreateInstance(ctx *lepton.Context) error

CreateInstance - Creates instance on Digital Ocean Platform

func (*Linode) CreateVolume

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

CreateVolume is a stub to satisfy VolumeService interface

func (*Linode) CustomizeImage

func (v *Linode) CustomizeImage(ctx *lepton.Context) (string, error)

CustomizeImage returns image path with adaptations needed by cloud provider

func (*Linode) DeleteImage

func (v *Linode) DeleteImage(ctx *lepton.Context, snapshotID string) error

DeleteImage deletes image from v

func (*Linode) DeleteInstance

func (v *Linode) DeleteInstance(ctx *lepton.Context, instanceID string) error

DeleteInstance deletes instance from linode

func (*Linode) DeleteVolume

func (v *Linode) DeleteVolume(ctx *lepton.Context, name string) error

DeleteVolume is a stub to satisfy VolumeService interface

func (*Linode) DetachVolume

func (v *Linode) DetachVolume(ctx *lepton.Context, image, name string) error

DetachVolume is a stub to satisfy VolumeService interface

func (*Linode) GetAllVolumes

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

GetAllVolumes is a stub to satisfy VolumeService interface

func (*Linode) GetImages

func (v *Linode) GetImages(ctx *lepton.Context) ([]lepton.CloudImage, error)

GetImages return all images on Linode

func (*Linode) GetInstanceByName

func (v *Linode) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error)

GetInstanceByName returns instance with given name

func (*Linode) GetInstanceLogs

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

GetInstanceLogs gets instance related logs

func (*Linode) GetInstances

func (v *Linode) GetInstances(ctx *lepton.Context) ([]lepton.CloudInstance, error)

GetInstances return all instances on Linode

func (*Linode) GetStorage

func (v *Linode) GetStorage() lepton.Storage

GetStorage returns storage interface for cloud provider

func (*Linode) Initialize

func (v *Linode) Initialize(config *types.ProviderConfig) error

Initialize provider

func (*Linode) ListImages

func (v *Linode) ListImages(ctx *lepton.Context) error

ListImages lists images on Linode

func (*Linode) ListInstances

func (v *Linode) ListInstances(ctx *lepton.Context) error

ListInstances lists instances on v

func (*Linode) PrintInstanceLogs

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

PrintInstanceLogs writes instance logs to console

func (*Linode) RebootInstance

func (v *Linode) RebootInstance(ctx *lepton.Context, instanceName string) error

RebootInstance reboots the instance.

func (*Linode) ResizeImage

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

ResizeImage is not supported on Linode.

func (*Linode) StartInstance

func (v *Linode) StartInstance(ctx *lepton.Context, instanceID string) error

StartInstance starts an instance in linode

func (*Linode) StopInstance

func (v *Linode) StopInstance(ctx *lepton.Context, instanceID string) error

StopInstance halts instance from v

func (*Linode) SyncImage

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

SyncImage syncs image from provider to another provider

type Objects

type Objects struct{}

Objects provides Linode 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 URLResponse

type URLResponse struct {
	Link string `json:"upload_to"`
}

URLResponse provides a url for uploading an image to Linode.

Jump to

Keyboard shortcuts

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