lxo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 copies an image from the specified server and wait till operation is done or return an error

func (*LXO) CreateContainer

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

CreateContainer will create the container and wait till operation is done or return an error

func (*LXO) DeleteContainer

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

DeleteContainer will delete the container and wait till operation is done or return an error

func (*LXO) DeleteImage

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

DeleteImage deletes an image and wait till operation is done or return an error

func (*LXO) StartContainer

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

StartContainer will start the container and wait till operation is done or return an error

func (*LXO) StopContainer

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

StopContainer will try to stop the container with provided name. It will retry for half a minute and return success when it's stopped.

func (*LXO) UpdateContainer

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

UpdateContainer will create the container and wait till operation is done or return an error

Jump to

Keyboard shortcuts

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