lxo

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParse = errors.New("parse error")
)

Functions

This section is empty.

Types

type LXO

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

LXO abstracts some of the lxd calls with additional functionality like retrying, idempotency and some level of error recovery. Usage stays the same as lxd.ContainerServer

func NewClient

func NewClient(server lxd.ContainerServer) *LXO

New creates LXO

func (*LXO) CopyImage

func (l *LXO) CopyImage(source lxd.ImageServer, image api.Image, args *lxd.ImageCopyArgs) error

CopyImage will copy an image from the specified server waits till operation is done

func (*LXO) CreateContainer

func (l *LXO) CreateContainer(container api.ContainersPost) error

CreateContainer will create the container and waits till operation is done

func (*LXO) CreateImage added in v0.4.1

func (l *LXO) CreateImage(image api.ImagesPost, args *lxd.ImageCreateArgs) (string, error)

CreateImage will create an image and waits till operation is done. Returns resulting fingerprint

func (*LXO) DeleteContainer

func (l *LXO) DeleteContainer(id string) error

DeleteContainer will delete the container and waits till operation is done

func (*LXO) DeleteImage

func (l *LXO) DeleteImage(hash string) error

DeleteImage will delete an image and waits till operation is done

func (*LXO) StartContainer

func (l *LXO) StartContainer(id string) error

StartContainer will start the container and waits till operation is done

func (*LXO) StopContainer

func (l *LXO) StopContainer(id string, timeout, retries int) error

StopContainer will try to stop the container and waits till operation is done

func (*LXO) UpdateContainer

func (l *LXO) UpdateContainer(id string, container api.ContainerPut, etag string) error

UpdateContainer will create the container and waits till operation is done

Jump to

Keyboard shortcuts

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